1

I have setup Jenkins server on windows10 pro and created a GitHub project job in it.

When I build this project, below command will be time out.
I have set the timeout value to be 1 hour but it is still timed out.
So I believe it relates to git command on windows.

C:\Users\devel\scoop\shims\git.exe fetch --tags --progress https://github.com/XXX/test.git/ +refs/heads/*:refs/remotes/origin/* # timeout=60

Then I tried to run below command manually through windows command window and it works fine.

C:\Users\devel\scoop\shims\git.exe fetch --tags --progress https://github.com/XXX/test.git/ +refs/heads/*:refs/remotes/origin/*

How to solve this issue on windows?

Joey Yi Zhao
  • 37,514
  • 71
  • 268
  • 523

1 Answers1

0

As mentioned in "Jenkins hangs at git fetch", it is probably a firewall issue, however it happens only for Jenkins and not from the command-line as a user. If Jenkins is running as the system account (instead of a user account), that could be the problem.

Check if using an ssh url works better: git@github.com

Regarding the error Couldn't find remote ref #, check what command you typed: you don't want to add the # timeout 60 at the end:

git fetch ... # timeout 60
              ^^^^^^^^^^^^^
              (wrong)

Try:

C:\Users\devel\scoop\shims\git.exe fetch --tags --progress https://github.com/XXX/test.git/ +refs/heads/*:refs/remotes/origin/*
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • sorry I was wrong about the window command. It was not hung actually, instead it return with an error message. I have posted it on the question. – Joey Yi Zhao Jun 20 '17 at 06:19
  • after remove the # timeout 60 from the command, it works fine in the command window. So I think this is only a comments added by jenkins. But Jenkins job still hang there. – Joey Yi Zhao Jun 20 '17 at 06:35
  • @ZhaoYi Check with what account your Jenkins slave is running: the system account might have an issue with http connection. Also, would an ssh url work better? – VonC Jun 20 '17 at 06:36
  • @ZhaoYi Great! I have edited the answer to make that root cause more visible. – VonC Jun 20 '17 at 06:41