-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Jenkins 2.277.2
Git plugin 4.7.1
workflow-multibranch 2.23
Jenkins on Windows Server 2016 x64
git cli version 2.31.1.windows.1
I have setup a Jenkins server on premise and use a git repository somewhere in the cloud
to reach internet I using a proxy server
mainly everything works fine
but from time to time I get such an error:
Started by user <user> > git.exe rev-parse --resolve-git-dir D:\JenkinsServices\Staging_8081\caches\git-60643e006805dab2d8449eb2c3018982\.git # timeout=10 Setting origin to https://bitbucket.<somewhere>.com/scm/<project>/repo.git > git.exe config remote.origin.url https://bitbucket.<somewhere>.com/scm/<project>/repo.git # timeout=10 Fetching origin... Fetching upstream changes from origin > git.exe --version # timeout=10 > git --version # 'git version 2.31.1.windows.1' > git.exe config --get remote.origin.url # timeout=10 using GIT_ASKPASS to set credentials Setting http proxy: <proxy.local>:8080 > git.exe fetch --tags --force --progress -- origin +refs/heads/*:refs/remotes/origin/* # timeout=10 hudson.plugins.git.GitException: Command "git.exe fetch --tags --force --progress -- origin +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: fatal: unable to access 'https://bitbucket.<somewhere>.com/scm/<project>/repo.git': Empty reply from server at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2639) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2079) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:84) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:601) at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:370) at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:330) at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:396) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:100) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:309) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Finished: FAILURE
see a short trend of my build:
what is struggling me:
I can't do anything
- pipeline can't adapt with retries because the error is before pipeline starts
- so I lose that trigger and I need to observe manually (not so nice)
I think ratio is 5 fails per 1000 succeeds
my idea to handle such very sporadic errors:
add an additional configuration for git operations where we can add a count of retries and a waiting time between this tries
In general it is better to resolve the fundamental issue that is causing the unreliable behavior between the git server and Jenkins.
If that can't be done, then you could use the Pipeline retry step. If you need a Freestyle job, you can use the "naginator" plugin to retry jobs automatically on failure.
I don't plan to implement a retry within the git plugin because retries are already available at higher levels.