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

Linux: if there is a recursive directory within the git repo you're building, the initial checkout will fail badly

      If a recursive symlink is present in one's git repo the new git/git-client plugins will fail badly as shown below. While having such a symlink may not be ideal, until git 1.3.0/ git-client 1.0.4 Jenkins did not have problems with it (nor have I had any other git client or tool fail because of this symlink).

      This appears to be specifically related to changes in the new git 1.3.0 plugin or its dependency git-client 1.0.4. Downgrading to the git 1.2.0 plugin and manually downgrading to the git-client 1.0.3 plugin was enough to remove this issue entirely. The problems seems specific to jgit.

      Note that I'm using Jenkins 1.505 and all other plugins are up-to-date.

      The details below contrast the working and broken builds (the only difference is the versions of the git plugins and their effects).

      ----------------------------------------------------------------------------
      A normal build (when using git 1.2.0 and git-client 1.0.3):
      ----------------------------------------------------------------------------
      Retriggered by user myself for Gerrit: http://gerritserver/710
      Building on master in workspace /var/lib/jenkins/jobs/puppet/workspace
      Checkout:workspace / /var/lib/jenkins/jobs/puppet/workspace - hudson.remoting.LocalChannel@1307e9af
      Using strategy: Gerrit Trigger
      Last Built Revision: Revision b3f2bd79784969bd18866ff666f0ab46136ff196 (mybranch)
      Using shallow clone
      Wiping out workspace first.
      Cloning the remote Git repository
      Cloning repository git://gitserver/puppet
      git --version
      git version 1.7.9.5
      Fetching upstream changes from origin
      Commencing build of Revision b3f2bd79784969bd18866ff666f0ab46136ff196 (mybranch)
      Checking out Revision b3f2bd79784969bd18866ff666f0ab46136ff196 (mybranch)
      [workspace] $ /bin/bash -ex /tmp/hudson3918244826320546803.sh
      [--== ...and so on to a successful build ==--]

      ----------------------------------------------------------------------------
      Build break (when using git 1.3.0 and git-client 1.0.4):
      ----------------------------------------------------------------------------
      Retriggered by user myself for Gerrit: http://gerritserver/710
      Building on master in workspace /var/lib/jenkins/jobs/puppet/workspace
      Checkout:workspace / /var/lib/jenkins/jobs/puppet/workspace - hudson.remoting.LocalChannel@6f0bc962
      Using strategy: Gerrit Trigger
      Last Built Revision: Revision b3f2bd79784969bd18866ff666f0ab46136ff196 (mybranch)
      Using shallow clone
      Wiping out workspace first.
      Cloning the remote Git repository
      Cloning repository git://gitserver/puppet
      git --version
      git version 1.7.9.5
      Commencing build of Revision b3f2bd79784969bd18866ff666f0ab46136ff196 (mybranch)
      Checking out Revision b3f2bd79784969bd18866ff666f0ab46136ff196 (mybranch)
      FATAL: Could not checkout b3f2bd79784969bd18866ff666f0ab46136ff196
      hudson.plugins.git.GitException: Could not checkout b3f2bd79784969bd18866ff666f0ab46136ff196
      at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkout(JGitAPIImpl.java:68)
      at hudson.plugins.git.GitAPI.checkout(GitAPI.java:208)
      at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1273)
      at hudson.plugins.git.GitSCM.access$1100(GitSCM.java:57)
      at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1232)
      at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1208)
      at hudson.FilePath.act(FilePath.java:865)
      at hudson.FilePath.act(FilePath.java:838)
      at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1208)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1353)
      at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:683)
      at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:588)
      at hudson.model.Run.execute(Run.java:1567)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:237)
      Caused by: org.eclipse.jgit.api.errors.CheckoutConflictException: Checkout conflict with files:
      apt/spec/fixtures/modules/apt <------ [ this is a symlink to ../../.. ]
      apt/spec/fixtures/modules/apt/.gitignore
      apt/spec/fixtures/modules/apt/CHANGELOG
      apt/spec/fixtures/modules/apt/manifests
      apt/spec/fixtures/modules/apt/manifests/init.pp
      apt/spec/fixtures/modules/apt/spec
      apt/spec/fixtures/modules/apt/spec/fixtures
      apt/spec/fixtures/modules/apt/spec/fixtures/manifests
      apt/spec/fixtures/modules/apt/spec/fixtures/manifests/site.pp
      apt/spec/fixtures/modules/apt/spec/fixtures/modules
      apt/spec/fixtures/modules/apt/spec/fixtures/modules/apt <--------- [ and so on... ]
      apt/spec/fixtures/modules/apt/spec/fixtures/modules/apt/.gitignore
      apt/spec/fixtures/modules/apt/spec/fixtures/modules/apt/CHANGELOG

      [--== trimmed ~9 MB of recursive output ==--]

      apt/spec/fixtures/modules/apt/tests/source.pp
      at org.eclipse.jgit.dircache.DirCacheCheckout.doCheckout(DirCacheCheckout.java:411)
      at org.eclipse.jgit.dircache.DirCacheCheckout.checkout(DirCacheCheckout.java:391)
      at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:240)
      ... 17 more

      [--== build failed ==--]

          [JENKINS-17186] Linux: if there is a recursive directory within the git repo you're building, the initial checkout will fail badly

          Martin Falatic created issue -

          I'm changing this to a blocker because the only workaround is to downgrade the git plugins (or to entirely sidestep Jgit as suggested in other recent bugs).

          Martin Falatic added a comment - I'm changing this to a blocker because the only workaround is to downgrade the git plugins (or to entirely sidestep Jgit as suggested in other recent bugs).
          Martin Falatic made changes -
          Priority Original: Major [ 3 ] New: Blocker [ 1 ]

          Hi,
          I have the same issue on my building machine Ubuntu-10.04. This bug prevent me to build several projects.
          Where can I find the plug in the version 1.0.3 in order to use the workaround?
          Thanks in advance

          Nicolas Berniolles added a comment - Hi, I have the same issue on my building machine Ubuntu-10.04. This bug prevent me to build several projects. Where can I find the plug in the version 1.0.3 in order to use the workaround? Thanks in advance

          Note that I was able to downgrade the git plugin directly in the UI, but I had to actually do the git-client one manually. They're all available at:

          http://updates.jenkins-ci.org/download/plugins/

          Martin Falatic added a comment - Note that I was able to downgrade the git plugin directly in the UI, but I had to actually do the git-client one manually. They're all available at: http://updates.jenkins-ci.org/download/plugins/

          That's true. I was as well able to downgrade through Jenkins the git plugin, not this other one.
          Thanks for the tip

          Nicolas Berniolles added a comment - That's true. I was as well able to downgrade through Jenkins the git plugin, not this other one. Thanks for the tip

          When you say "the same" you mean you also have recursive symlinks? Also, did the plugin downgrade successfully resolve the issue for you?

          Martin Falatic added a comment - When you say "the same" you mean you also have recursive symlinks? Also, did the plugin downgrade successfully resolve the issue for you?

          Nicolas Berniolles added a comment - - edited

          Yes Martin. I have some recursive symlinks in my github's repo. The downgrade resolved successfully the issue.
          My projects are back online.

          Nicolas Berniolles added a comment - - edited Yes Martin. I have some recursive symlinks in my github's repo. The downgrade resolved successfully the issue. My projects are back online.

          Can you please explain your "recursive symlink" layout ? Looks odd

          Nicolas De Loof added a comment - Can you please explain your "recursive symlink" layout ? Looks odd

          Nicolas De Loof added a comment - probably related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=354367

            ndeloof Nicolas De Loof
            martymacgyver Martin Falatic
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: