Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-65369

git multibranch pipeline through proxy fails sporadic cause of "Empty reply from server"

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • git-plugin
    • 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

          [JENKINS-65369] git multibranch pipeline through proxy fails sporadic cause of "Empty reply from server"

          Mark Waite added a comment -

          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.

          Mark Waite added a comment - 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.

          Thomas Patzig added a comment - - edited

          to markewaite

          exactly that pipeline retry steps can't be done because the error exists before we step into any pipeline

          • it is a git multibranch pipeline
          • a branch has a Jenkinsfile and get a new commit
          • this triggers its corresponding Jenkins job to checkout the branch on node and execute the checkout JenkinsFile
            -> but, checkout FAILS .. no pipeline .. no possibility to retry something .. and trigger is lost
          • ... and I need to trigger that branch manually

          => there exist no workaround and no plugin can help me here

          Thomas Patzig added a comment - - edited to markewaite exactly that pipeline retry steps can't be done because the error exists before we step into any pipeline it is a git multibranch pipeline a branch has a Jenkinsfile and get a new commit this triggers its corresponding Jenkins job to checkout the branch on node and execute the checkout JenkinsFile -> but, checkout FAILS .. no pipeline .. no possibility to retry something .. and trigger is lost ... and I need to trigger that branch manually => there exist no workaround and no plugin can help me here

          Thomas Patzig added a comment -

          to markewaite

          just wanna ensure that you have read my last comment

          Thomas Patzig added a comment - to markewaite just wanna ensure that you have read my last comment

          Mark Waite added a comment -

          Thanks thomaspatzig. I've read your comment. Thanks for the clarification. I don't plan to work on this issue.

          Mark Waite added a comment - Thanks thomaspatzig . I've read your comment. Thanks for the clarification. I don't plan to work on this issue.

          Thomas Patzig added a comment -

          understand

          Thomas Patzig added a comment - understand

            Unassigned Unassigned
            thomaspatzig Thomas Patzig
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: