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:
i
I had this same issue on my laptop and I was able to figure out a solution, however this really only applies if you are running the Jenkins war in a Tomcat web container that is setup as a Windows service.
I just had to set the Tomcat service to logon as my windows user instead of Local System.
Just experience the freeze at 'Fetching upstream changes from origin' as well.
Running Jenkins as a service on a Windows based machine seems to (from what I have experienced) to have issues when using SSL.
Workaround Solution]
Details on Why I Choose this Solution]
I have followed other steps before with setting up the authorized host to accept the server and registering the Jenkins' key on the server to permit the connection. I've made sure I could successfully perform Git actions under my Local System account (which the Jenkins service was run under). Still, the fetch would freeze. To check that my Git and SSL was configured correctly, I even went to the initially configured Git repository in my Jenkins jobs directory and performed a successfully pull request under the local system account. It worked; therefore the keys have been setup correctly.
I forgot where I read this, but I heard issues arise when dealing with Git/SSH under a local system. With this knowledge, I played with my Git environment and altered the GIT_SSH environment variable to use plink (with a combination of Putty to remember the server key, puttygen to convert an OpenSSL key to a Putty key and pageant to remember my keys) for plink. Once I got it working with plink, I did not find it to be a useable solution. I order to correctly use plink, I had to also run pageant under my local system account to have the Jenkins service correctly negotiate SSH calls. After thinking how I would correctly setup my initial state on reboot, I didn't want to put all this effort into just getting the SSH connection working.
Instead, I decided it was easier to just run Jenkins under my local administrator account which was also configured to deal with the Git server. No having to deal with configured SSH keys for the local system account and my git actions worked fine.
Note, David Gageot's answer can apply to some. I did not have to alter any of my Git settings as when I installed Git, I choose the option Run Git from the Windows Command Prompt
which maps a path to the C:\Program Files (x86)\Git\bin\cmd\
directory.