Jenkins hanging at “Fetching upstream changes from origin”

后端 未结 8 2015
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-25 12:17

I\'m trying to set up Jenkins on a Windows Server 2012 machine, and I\'m having a lot of difficulty.

Things I\'ve done:

  • Created a password-less i
相关标签:
8条回答
  • 2020-12-25 12:56

    Here's how I fixed a similar issue:

    Msysgit installs two git.exe. One under C:\Program Files (x86)\Git\bin and a second one under C:\Program Files (x86)\Git\cmd. The first one cannot be used with Jenkins. It will hang after completing it's job. The second one works perfectly.

    Update your Jenkins Git settings to point to the correct cmd\git.exe and enjoy!

    0 讨论(0)
  • 2020-12-25 12:56

    Another link that I found very helpful when configuring jenkins on windows, especially when using the MSI installer is this: http://opensourcetester.co.uk/2013/06/28/jenkins-windows-ssh/

    And one more thing that I didn't find obvious was: you have to use SSH url when connecting to Github instead of default https one. Hopefully that will save time to someone.

    0 讨论(0)
  • 2020-12-25 13:00

    Version 2.6.1 of the Git client for Windows fixes this problem in Jenkins. Now “Fetching upstream changes from origin” has no delay.

    I am using the git cmd in Jenkins from:

    C:\Program Files\Git\cmd\git.exe

    0 讨论(0)
  • 2020-12-25 13:05

    For me it was the permissions on the $HOME/.ssh folder and its content. After setting it visible for the specific user group, Jenkins was able to fetch the changes after a restart.

    0 讨论(0)
  • 2020-12-25 13:09

    This is how I solved it:

    I ran the sysinternals tool psexec to spawn a CMD which is running under the LocalSystem account (same account like jenkins service is running)

    PSEXEC -i -s -d CMD
    

    In this cmd prompt I executed the same git command from the workspace directory as the hanging GIT.exe processes do. E.g.

    d:\Programs\Jenkins\jobs\jobname\workspace>D:\Programs\Git\bin\git.exe fetch -t ssh+git://gitpub@my.server.com:9360/data/gitpub/myRepository.git +refs/heads/:refs/remotes/origin/

    Et voila: I was prompted to enter "yes" to add the SSH key to the known list of known hosts.

    0 讨论(0)
  • 2020-12-25 13:09

    I spent few hours trying to figure this out and I found out that adding the password to the repo URL fixed the issue:

    https://USERNAME:PASSWORD@bitbucket.org/REPO.git
    

    Please note the : between username and password

    0 讨论(0)
提交回复
热议问题