3

On Jenkins (1.504) using Git-plugin (1.3.0) we often get this error when pulling from a git repo

    hudson.plugins.git.GitException: Command "C:\Program Files (x86)\Git\bin\git.exe fetch -t origin +refs/heads/*:refs/remotes/origin/*" returned status code 128:
    stdout: 
    stderr: error: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure while accessing https://user:password@git.internal.com/scm/projet/project.git/info/refs?service=git-upload-pack
    fatal: HTTP request failed

        at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:772)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:772)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:738)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.fetch(CliGitAPIImpl.java:159)
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:797)
    at hudson.plugins.git.GitSCM.access$000(GitSCM.java:57)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:976)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:941)
    at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2348)
    at hudson.remoting.UserRequest.perform(UserRequest.java:118)
    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    at hudson.remoting.Request$2.run(Request.java:326)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at hudson.remoting.Engine$1$1.run(Engine.java:58)
    at java.lang.Thread.run(Unknown Source)
ERROR: Could not fetch from any repository

another variant:

stderr: error: The requested URL returned error: 400 while accessing https://user:password@git.internal.com/scm/projet/project.git/info/refs
fatal: HTTP request failed

    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:772)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:738)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.fetch(CliGitAPIImpl.java:159)
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:797)
    at hudson.plugins.git.GitSCM.access$000(GitSCM.java:57)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:976)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:941)
    at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2348)
    at hudson.remoting.UserRequest.perform(UserRequest.java:118)
    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    at hudson.remoting.Request$2.run(Request.java:326)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
ERROR: Could not fetch from any repository

typically its just a matter of restarting the job and then it works fine. But instead of manually having to restart the job it could be great to find a solution.

u123
  • 15,603
  • 58
  • 186
  • 303
  • The `SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure` suggests that the server may have more info/logs about why SSL is failing. Also, [this question](http://stackoverflow.com/questions/3705078) suggests that navigating to the workspace and pulling the repo may help. – cjc343 Mar 18 '13 at 19:06

1 Answers1

2

Click on "Advanced Project Options" on your job configuration page. You will see an option "Retry Count". Tick the box and enter the number of times you want to retry when the checkout fails.

As the commenter suggested, you should also investigate why the checkout sometimes fails in the first place. Even if you configure a high number of retries it is still possible that all of them will fail if the underlying problem isn't fixed.

Lars Kotthoff
  • 107,425
  • 16
  • 204
  • 204