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

Caused by: org.eclipse.jgit.api.errors.CheckoutConflictException: Checkout conflict with files

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • git-plugin
    • None
    • git-client > 1.0.2

      The jGIT client has lots of repository compatibility issues as compared to the normal command line git client. Updating to git-client 1.0.4 results in:

      Building remotely on mac mini 1 in workspace /Users/jenkins/workspace/Fuji
      Checkout:Fuji / /Users/jenkins/workspace/Fuji - hudson.remoting.Channel@c27576:mac mini 1
      Using strategy: Default
      Last Built Revision: Revision 88877737299f64f83e8230928e8b2db4ebe1826b (origin/master)
      Fetching changes from 1 remote Git repository
      Commencing build of Revision 124296a2ae55606a975ed1888c4e030dd9e0f3e4 (origin/master)
      Checking out Revision 124296a2ae55606a975ed1888c4e030dd9e0f3e4 (origin/master)
      FATAL: Could not checkout 124296a2ae55606a975ed1888c4e030dd9e0f3e4
      hudson.plugins.git.GitException: Could not checkout 124296a2ae55606a975ed1888c4e030dd9e0f3e4
      	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$FileCallableWrapper.call(FilePath.java:2348)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      	at hudson.remoting.Request$2.run(Request.java:326)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:680)
      Caused by: org.eclipse.jgit.api.errors.CheckoutConflictException: Checkout conflict with files: 
      support/tools/relink/macholib/MachO.py
      

      whereas the normal command line git client is happy with the repository.

      Can we get a work around of a configuration setting to say use either the command line git client or jGIT?

          [JENKINS-17198] Caused by: org.eclipse.jgit.api.errors.CheckoutConflictException: Checkout conflict with files

          Craig Newell created issue -

          short term workaround is either to run jenkins with -Dorg.jenkinsci.plugins.gitclient.Git.useCLI=true, or check "clean workspace after checkout" - this option will clean workspace ...before (sic!) checkout and avoid conflict.

          Could you also tell me if there is anything during your build that could have touched support/tools/relink/macholib/MachO.py ? I'm looking for a public git repository I could use to reproduce this issue.

          Nicolas De Loof added a comment - short term workaround is either to run jenkins with -Dorg.jenkinsci.plugins.gitclient.Git.useCLI=true, or check "clean workspace after checkout" - this option will clean workspace ...before (sic!) checkout and avoid conflict. Could you also tell me if there is anything during your build that could have touched support/tools/relink/macholib/MachO.py ? I'm looking for a public git repository I could use to reproduce this issue.

          We also experienced this issue after upgrading. We determined that our issue was due to JGit (and therefore git-plugin) not supporting symbolic links and our git repository has multiple symbolic links. We also used the workaround -Dorg.jenkinsci.plugins.gitclient.Git.useCLI=true to resolve the issue, but we're wondering what the actual implementation will be to resolve this issue.

          Dallas Gutauckis added a comment - We also experienced this issue after upgrading. We determined that our issue was due to JGit (and therefore git-plugin) not supporting symbolic links and our git repository has multiple symbolic links. We also used the workaround -Dorg.jenkinsci.plugins.gitclient.Git.useCLI=true to resolve the issue, but we're wondering what the actual implementation will be to resolve this issue.

          Nicolas De Loof added a comment - Can you please try SNASPHOT build https://jenkins.ci.cloudbees.com/job/plugins/job/git-client-plugin/33/org.jenkins-ci.plugins$git-client/artifact/org.jenkins-ci.plugins/git-client/1.0.5-SNAPSHOT/git-client-1.0.5-SNAPSHOT.hpi ? This one includes a possible fix to ask JGit to handle the detected conflict by itself

          Nicolas De Loof added a comment - relates to https://bugs.eclipse.org/bugs/show_bug.cgi?id=354367
          Nicolas De Loof made changes -
          Link New: This issue is duplicated by JENKINS-17186 [ JENKINS-17186 ]

          https://jenkins.ci.cloudbees.com/job/plugins/job/git-client-plugin/34/org.jenkins-ci.plugins$git-client/ provably is a better candidate to get this issue fixed : it used a patched version of JGit to include https://bugs.eclipse.org/bugs/show_bug.cgi?id=354367 proposed fix

          Nicolas De Loof added a comment - https://jenkins.ci.cloudbees.com/job/plugins/job/git-client-plugin/34/org.jenkins-ci.plugins$git-client/ provably is a better candidate to get this issue fixed : it used a patched version of JGit to include https://bugs.eclipse.org/bugs/show_bug.cgi?id=354367 proposed fix

          Matt Chotin added a comment -

          I installed https://jenkins.ci.cloudbees.com/job/plugins/job/git-client-plugin/34/org.jenkins-ci.plugins$git-client/ and restarted Jenkins and still have this issue.

          hudson.plugins.git.GitException: Could not checkout 00f6e95c8ff6cc6f7ca544fa07124dd3edaa0586
          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:1261)
          at hudson.plugins.git.GitSCM.access$1200(GitSCM.java:57)
          at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1220)
          at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1196)
          at hudson.FilePath.act(FilePath.java:865)
          at hudson.FilePath.act(FilePath.java:838)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1196)
          at hudson.model.AbstractProject.checkout(AbstractProject.java:1353)
          at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:689)
          at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:594)
          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 file: Cannot delete file: ios/PorkButt/opentok-ios-sdk/Opentok.framework/Headers/OTError.h
          at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:246)
          at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkout(JGitAPIImpl.java:64)
          ... 16 more
          Caused by: org.eclipse.jgit.errors.CheckoutConflictException: Checkout conflict with file: Cannot delete file: ios/PorkButt/opentok-ios-sdk/Opentok.framework/Headers/OTError.h
          at org.eclipse.jgit.dircache.DirCacheCheckout.cleanUpConflicts(DirCacheCheckout.java:1011)
          at org.eclipse.jgit.dircache.DirCacheCheckout.doCheckout(DirCacheCheckout.java:413)
          at org.eclipse.jgit.dircache.DirCacheCheckout.checkout(DirCacheCheckout.java:391)
          at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:242)
          ... 17 more

          There are symlinks in there.

          Matt Chotin added a comment - I installed https://jenkins.ci.cloudbees.com/job/plugins/job/git-client-plugin/34/org.jenkins-ci.plugins$git-client/ and restarted Jenkins and still have this issue. hudson.plugins.git.GitException: Could not checkout 00f6e95c8ff6cc6f7ca544fa07124dd3edaa0586 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:1261) at hudson.plugins.git.GitSCM.access$1200(GitSCM.java:57) at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1220) at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1196) at hudson.FilePath.act(FilePath.java:865) at hudson.FilePath.act(FilePath.java:838) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1196) at hudson.model.AbstractProject.checkout(AbstractProject.java:1353) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:689) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:594) 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 file: Cannot delete file: ios/PorkButt/opentok-ios-sdk/Opentok.framework/Headers/OTError.h at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:246) at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkout(JGitAPIImpl.java:64) ... 16 more Caused by: org.eclipse.jgit.errors.CheckoutConflictException: Checkout conflict with file: Cannot delete file: ios/PorkButt/opentok-ios-sdk/Opentok.framework/Headers/OTError.h at org.eclipse.jgit.dircache.DirCacheCheckout.cleanUpConflicts(DirCacheCheckout.java:1011) at org.eclipse.jgit.dircache.DirCacheCheckout.doCheckout(DirCacheCheckout.java:413) at org.eclipse.jgit.dircache.DirCacheCheckout.checkout(DirCacheCheckout.java:391) at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:242) ... 17 more There are symlinks in there.

          In our environment, this workaround doesn't solve this issue.

           -Dorg.jenkinsci.plugins.gitclient.Git.useCLI=true
          

          However, we solved with combination below, which described at http://mrkn.hatenablog.com/entry/2013/03/18/225556 (Japanese).

          • Git Plugin : 1.3.0
          • Git Client Plugin : 1.0.3

          Takayuki Okazaki added a comment - In our environment, this workaround doesn't solve this issue. -Dorg.jenkinsci.plugins.gitclient.Git.useCLI= true However, we solved with combination below, which described at http://mrkn.hatenablog.com/entry/2013/03/18/225556 (Japanese). Git Plugin : 1.3.0 Git Client Plugin : 1.0.3

          If you're using a master/slave configuration you need to set the argument in your slave configuration as well.

          Dallas Gutauckis added a comment - If you're using a master/slave configuration you need to set the argument in your slave configuration as well.

            ndeloof Nicolas De Loof
            craign Craig Newell
            Votes:
            9 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved: