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

Git fetch fails. Returns "Reference directory conflict: refs/heads/" with status code 128

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor

      I am noticing that the command bellow fails

      git -c core.askpass=true fetch --tags --progress https://github.com/myproject.git +refs/heads/*:refs/remotes/origin/*
      

      While tracing through the error log, I see that it fails to fetch the repo and then returns a status code of 128. What makes this very confusing is that is prints this out as the reason
      stderr: fatal: Reference directory conflict: refs/heads/

          [JENKINS-37653] Git fetch fails. Returns "Reference directory conflict: refs/heads/" with status code 128

          Emmanuel Esparza created issue -
          Emmanuel Esparza made changes -
          Environment Original: Jenkins 2.11
          Containerized Master Docker Version 1.11.1
          Backed by EFS
          Running on Amazon Linux ami aws-elasticbeanstalk-amzn-2016.03.2.x86_64-ecs-hvm-201606260408
          On demand EC2 agents using the same AMI
          New: Jenkins 2.11
          Containerized Master Docker Version 1.11.1
          Backed by EFS
          Running on Amazon Linux ami aws-elasticbeanstalk-amzn-2016.03.2.x86_64-ecs-hvm-201606260408
          On demand EC2 agents using the same AMI

          Git client version :
          Emmanuel Esparza made changes -
          Environment Original: Jenkins 2.11
          Containerized Master Docker Version 1.11.1
          Backed by EFS
          Running on Amazon Linux ami aws-elasticbeanstalk-amzn-2016.03.2.x86_64-ecs-hvm-201606260408
          On demand EC2 agents using the same AMI

          Git client version :
          New: Jenkins 2.11
          Containerized Master Docker Version 1.11.1
          Backed by EFS
          Running on Amazon Linux ami aws-elasticbeanstalk-amzn-2016.03.2.x86_64-ecs-hvm-201606260408
          On demand EC2 agents using the same AMI

          Git client version :1.21.0
          Git version: 2.5.3
          Mark Waite made changes -
          Description Original: I am noticing that the command bellow fails

           git -c core.askpass=true fetch --tags --progress https://github.com/myproject.git +refs/heads/*:refs/remotes/origin/*

          While tracing through the error log, I see that it fails to fetch the repo and then returns a status code of 128. What makes this very confusing is that is prints this out as the reason
          stderr: fatal: Reference directory conflict: refs/heads/

          New: I am noticing that the command bellow fails

          {{ git -c core.askpass=true fetch --tags --progress https://github.com/myproject.git +refs/heads/*:refs/remotes/origin/*}}

          While tracing through the error log, I see that it fails to fetch the repo and then returns a status code of 128. What makes this very confusing is that is prints this out as the reason
          stderr: fatal: Reference directory conflict: refs/heads/

          Mark Waite made changes -
          Description Original: I am noticing that the command bellow fails

          {{ git -c core.askpass=true fetch --tags --progress https://github.com/myproject.git +refs/heads/*:refs/remotes/origin/*}}

          While tracing through the error log, I see that it fails to fetch the repo and then returns a status code of 128. What makes this very confusing is that is prints this out as the reason
          stderr: fatal: Reference directory conflict: refs/heads/

          New: I am noticing that the command bellow fails

          {{ git -c core.askpass=true fetch --tags --progress https://github.com/myproject.git +refs/heads/*:refs/remotes/origin/*
          }}

          While tracing through the error log, I see that it fails to fetch the repo and then returns a status code of 128. What makes this very confusing is that is prints this out as the reason
          stderr: fatal: Reference directory conflict: refs/heads/

          Mark Waite made changes -
          Description Original: I am noticing that the command bellow fails

          {{ git -c core.askpass=true fetch --tags --progress https://github.com/myproject.git +refs/heads/*:refs/remotes/origin/*
          }}

          While tracing through the error log, I see that it fails to fetch the repo and then returns a status code of 128. What makes this very confusing is that is prints this out as the reason
          stderr: fatal: Reference directory conflict: refs/heads/

          New: I am noticing that the command bellow fails

          {code}
          git -c core.askpass=true fetch --tags --progress https://github.com/myproject.git +refs/heads/*:refs/remotes/origin/*
          {code}

          While tracing through the error log, I see that it fails to fetch the repo and then returns a status code of 128. What makes this very confusing is that is prints this out as the reason
          stderr: fatal: Reference directory conflict: refs/heads/

          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]

          Mark Waite added a comment -

          Considering the large number of installations and users of the git plugin and git client plugin, I suspect this is an issue in your local installation, not in the plugin. That message seems to indicate that command line git found an inconsistency in the .git/refs/heads directory of the workspace.

          You may be able to resolve that complaint by using "Wipe workspace" to delete the entire workspace.

          You may need to check your build process to investigate if it is damaging the contents of the .git directory.

          Mark Waite added a comment - Considering the large number of installations and users of the git plugin and git client plugin, I suspect this is an issue in your local installation, not in the plugin. That message seems to indicate that command line git found an inconsistency in the .git/refs/heads directory of the workspace. You may be able to resolve that complaint by using "Wipe workspace" to delete the entire workspace. You may need to check your build process to investigate if it is damaging the contents of the .git directory.

          Alex Nauda added a comment - - edited

          We are experiencing the same error message, in a GitHub pull request builder job. The first time we saw this was 8/22. We worked around it by removing the entire .git local repo under the job's workspace. The job then ran several times successfully, until it happened again today. We are also hosting our /var/lib/jenkins directory structure on an EFS filesystem. (EFS is Amazon's scalable filesystem product that is exposed to the Jenkins host OS as an NFS mount.)
          Jenkins 2.7.2 (Ubuntu 16.04 package)
          GitHub Pull Request Builder plugin 1.33.0
          Git client 2.7.4 against GitHub (Git 2.6.5)
          Jenkins is not containerized and this job does not involve docker.

          Should we investigate EFS/NFS as a common environment?

          Alex Nauda added a comment - - edited We are experiencing the same error message, in a GitHub pull request builder job. The first time we saw this was 8/22. We worked around it by removing the entire .git local repo under the job's workspace. The job then ran several times successfully, until it happened again today. We are also hosting our /var/lib/jenkins directory structure on an EFS filesystem. (EFS is Amazon's scalable filesystem product that is exposed to the Jenkins host OS as an NFS mount.) Jenkins 2.7.2 (Ubuntu 16.04 package) GitHub Pull Request Builder plugin 1.33.0 Git client 2.7.4 against GitHub (Git 2.6.5) Jenkins is not containerized and this job does not involve docker. Should we investigate EFS/NFS as a common environment?

          Yes, we are also using EFS/NFS.

          Emmanuel Esparza added a comment - Yes, we are also using EFS/NFS.

            Unassigned Unassigned
            eesparza Emmanuel Esparza
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: