ls-remote causes a timeout and returns error code -1 when polling a git server through jenkins

921 Views Asked by At

I am trying to configure a Jenkins Server (ver 1.656) to trigger build on commit notification, but every polling scheduled or triggered after the notification received by Jenkins keeps timing out :

Started on 12.07.2016 13:49:39
Using strategy: Default
[poll] Last Built Revision: Revision 5d9aca316442628a4a4232f0d91db4aa364097c8 (refs/remotes/origin/<mybranch>)
using .gitcredentials to set credentials
 > git.exe --version # timeout=10
 > git.exe init C:\windows\TEMP\hudson5601032587070717608tmp # timeout=10
 > git.exe config --local credential.username <myuser> # timeout=10
 > git.exe config --local credential.helper store --file=\"C:\windows\TEMP\git5393454342982372389.credentials\" # timeout=10
 > git.exe -c core.askpass=true ls-remote -h http://<myrepo.git> # timeout=10
ERROR: Timeout after 10 minutes
 > git.exe config --local --remove-section credential # timeout=10
FATAL: hudson.plugins.git.GitException: Command "git.exe -c ore.askpass=true    ls-remote -h http://<myrepo.git>" returned status code -1:
stdout: 
stderr: 
hudson.util.IOException2: hudson.plugins.git.GitException: Command "git.exe -c core.askpass=true ls-remote -h http://<myrepo.git>" returned status code -1:
stdout: 
stderr: 
    at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:573)
    at hudson.scm.SCM.compareRemoteRevisionWith(SCM.java:381)
    at hudson.scm.SCM.poll(SCM.java:398)
    at hudson.model.AbstractProject._poll(AbstractProject.java:1446)
    at hudson.model.AbstractProject.poll(AbstractProject.java:1349)
    at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:526)
    at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:555)
    at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: hudson.plugins.git.GitException: Command "git.exe -c core.askpass=true ls-remote -h http://<myrepo.git>" returned status code -1:
stdout: 
stderr: 
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1719)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1463)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1349)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1340)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getHeadRev(CliGitAPIImpl.java:2441)
    at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:627)
    at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:571)
    ... 12 more
Done. Took 10 Minuten
No changes

Both server and slave are running on Windows, with git for windows application. The error happens on every jobs: 3 are working on different branches of a same repository, and the other is working on a second repository, placed on the same Bonobo server, accessed by HTML.

Also, if I try to execute the commands from my own PC (not the slave) or the server, it executes correctly, even if I set user names unknown to my computer and the repository.

Another strange thing I noticed is that it seems that credential might be a reason to this problem, since changing the job configuration to a wrong user causes the same error. I cannot access the slave itself, and launching the commands executed above through Jenkins' script console returns no line (I guess another timeout?). I also tried to look at the git config --list on it, which contains :

core.symlinks=false
core.autocrlf=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
http.sslcainfo=/bin/curl-ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
credential.helper=manager

Last, I don't know if it is relevant to this problem, but when I try a notifyCommit on the Jenkins server with curl from my own computer, it finds the jobs using the repository given but says No Git consumers using SCM API plugin for : <myrepo.git>, even if the polling are still launched by this notification.

Is there a link to the SSH hanging with git plugin ? If I am not mistaking, the access with an url shouldn't cause this problem, right? Also, I guess there is a place where credentials are kept that I am not aware of?

Thanks for your help guys.

0

There are 0 best solutions below