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

Regression: git < 1.6.2 not supported anymore (failing clone due to existing workspace dir)

      Jenkins 1.511 (git plugin 1.3.0, git client plugin 1.0.5) doesn't support git < 1.6.2 anymore since older git versions don't support cloning into existing directories (even if empty!):

      Last Built Revision: Revision <SHA1> (origin/master)
      Cloning the remote Git repository
      Cloning repository <myrepo-url>.git
      git --version
      git version 1.5.6.5
      ERROR: Error cloning remote repo 'origin' : Could not clone <myrepo-url>.git
      [...]
      stderr: fatal: destination directory '/home/jenkins/workspace/<build-workspace>' already exists.
      
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:773)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.clone(CliGitAPIImpl.java:217)
      	... 12 more
      Trying next repository
      ERROR: Could not clone repository
      

      Something seems to have changed in the build process lately as Jenkins 1.502 doesn't have this problem. It seems the workspace is created before cloning which seemingly wasn't the case in (at least) 1.502.

          [JENKINS-17629] Regression: git < 1.6.2 not supported anymore (failing clone due to existing workspace dir)

          Oliver Bock added a comment -

          The git clone enhancement was added in 55892d2 and got integrated in git 1.6.2.

          Oliver Bock added a comment - The git clone enhancement was added in 55892d2 and got integrated in git 1.6.2.

          Owen Mehegan added a comment -

          I have this problem too. I upgraded the Jenkins Git Plugin from 1.1.22 to 1.4.0 and this broke. I have git version 1.5.6.5.

          Owen Mehegan added a comment - I have this problem too. I upgraded the Jenkins Git Plugin from 1.1.22 to 1.4.0 and this broke. I have git version 1.5.6.5.

          Eberhard Leba added a comment -

          Jenkins 1.3.3 , Git plugin 1.3.0
          Got the same problem on one of three build systems running in a matrix project.
          Each build slave has a different linux distro (RHEL6, SLES11, debian squeeze)
          It is failing on SLES11 x86_64 and succeeds on the other two.
          The target directory (work space) exists and is empty (no .git directory in it).
          Workaround: remove target directory, do manual git clone into it and run the Jenkins build again. Wipe out is turned off BTW.

          Eberhard Leba added a comment - Jenkins 1.3.3 , Git plugin 1.3.0 Got the same problem on one of three build systems running in a matrix project. Each build slave has a different linux distro (RHEL6, SLES11, debian squeeze) It is failing on SLES11 x86_64 and succeeds on the other two. The target directory (work space) exists and is empty (no .git directory in it). Workaround: remove target directory, do manual git clone into it and run the Jenkins build again. Wipe out is turned off BTW.

          Any reason you run such an old version of git ?

          Nicolas De Loof added a comment - Any reason you run such an old version of git ?

          Owen Mehegan added a comment -

          It is the default version shipped with Debian Lenny, which we still have to build for. I was able to upgrade, but it seems like the breakage could be avoided. Maybe no one cares

          Owen Mehegan added a comment - It is the default version shipped with Debian Lenny, which we still have to build for. I was able to upgrade, but it seems like the breakage could be avoided. Maybe no one cares

          Oliver Bock added a comment - - edited

          Yep, same here. We have to build stuff on a number of legacy systems where git versions >= 1.6.2 might not be, well, aren't available.

          Oliver Bock added a comment - - edited Yep, same here. We have to build stuff on a number of legacy systems where git versions >= 1.6.2 might not be, well, aren't available.

          git 1.6.2 is pretty old. Even for exotic build servers, installing a recent git version is not such a big deal. As an alternative, git-plugin 2.0 offers JGit support

          Nicolas De Loof added a comment - git 1.6.2 is pretty old. Even for exotic build servers, installing a recent git version is not such a big deal. As an alternative, git-plugin 2.0 offers JGit support

            ndeloof Nicolas De Loof
            brevilo Oliver Bock
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: