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

Checkout fails with Multiple SCMs plugin on commit notification

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • Jenkins 1.568
      multiple-scms-plugin 0.4-beta-1
      git-plugin 2.3.5-SNAPSHOT

      also similar to https://github.com/janinko/ghprb/issues/171

      Setup:

      • free style project
      • multiple scms repository setting
      • two git repositories configured
      • stash notifications for both repositories
      • a commit is pushed to second repository

      Build console output:

      commit notification 108127644b30e28d326702752aa1150e05227156
      [EnvInject] - Loading node environment variables.
      [EnvInject] - Preparing an environment for the build.
      [EnvInject] - Keeping Jenkins system variables.
      [EnvInject] - Keeping Jenkins build variables.
      [EnvInject] - Injecting as environment variables the properties content 
      [EnvInject] - Variables injected successfully.
      [EnvInject] - Injecting contributions.
      Building on master in workspace /home/jenkins/workspace/TestNotification
       > /usr/local/bin/git rev-parse --is-inside-work-tree # timeout=10
      Fetching changes from the remote Git repository
       > /usr/local/bin/git config remote.origin.url ssh://git@git.mydomain.com:7999/project/repo1.git # timeout=10
      Fetching upstream changes from ssh://git@git.mydomain.com:7999/project/repo1.git
       > /usr/local/bin/git --version # timeout=10
       > /usr/local/bin/git -c core.askpass=true fetch --tags --progress ssh://git@git.mydomain.com:7999/project/repo1.git +refs/heads/*:refs/remotes/origin/*
       > /usr/local/bin/git rev-parse 108127644b30e28d326702752aa1150e05227156^{commit} # timeout=10
      FATAL: Command "/usr/local/bin/git rev-parse 108127644b30e28d326702752aa1150e05227156^{commit}" returned status code 128:
      stdout: 108127644b30e28d326702752aa1150e05227156^{commit}
      
      stderr: fatal: ambiguous argument '108127644b30e28d326702752aa1150e05227156^{commit}': unknown revision or path not in the working tree.
      Use '--' to separate paths from revisions, like this:
      'git <command> [<revision>...] -- [<file>...]'
      
      hudson.plugins.git.GitException: Command "/usr/local/bin/git rev-parse 108127644b30e28d326702752aa1150e05227156^{commit}" returned status code 128:
      stdout: 108127644b30e28d326702752aa1150e05227156^{commit}
      
      stderr: fatal: ambiguous argument '108127644b30e28d326702752aa1150e05227156^{commit}': unknown revision or path not in the working tree.
      Use '--' to separate paths from revisions, like this:
      'git <command> [<revision>...] -- [<file>...]'
      
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1457)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1433)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1429)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1117)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1127)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.revParse(CliGitAPIImpl.java:523)
      	at hudson.plugins.git.GitAPI.revParse(GitAPI.java:258)
      	at hudson.plugins.git.RevisionParameterAction.toRevision(RevisionParameterAction.java:85)
      	at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:872)
      	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:985)
      	at hudson.scm.SCM.checkout(SCM.java:488)
      	at org.jenkinsci.plugins.multiplescms.MultiSCM.checkout(MultiSCM.java:118)
      	at hudson.model.AbstractProject.checkout(AbstractProject.java:1252)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:624)
      	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:530)
      	at hudson.model.Run.execute(Run.java:1732)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:234)
      

      More detailed steps for reproduction:

      • download latest jenkins and start it
      • install GIT Plugin
      • install Multiple SCMs plugin
      • create freestyle project like in screenshots
      • unpack attached repos to ~ (if you choose different directory, you will need to modify job config and the url)
      • call http://<host>:<port>/git/notifyCommit?sha1=ba2ab18cf2323b131777b380f53137491e11d136&url=%7E%2FJENKINS-26587%2Frepo2

          [JENKINS-26587] Checkout fails with Multiple SCMs plugin on commit notification

          Mark Waite added a comment -

          Since you identified a new issue that needs to be investigated before 2.4.1 can release, my guess is that the 2.4.1 release won't be available for at least another few weeks.

          If you can identify the specific commit which caused that change of behavior, that would help me very much. If you can't, then I'll need to do that investigation, find the commit, then identify how to fix that.

          Mark Waite added a comment - Since you identified a new issue that needs to be investigated before 2.4.1 can release, my guess is that the 2.4.1 release won't be available for at least another few weeks. If you can identify the specific commit which caused that change of behavior, that would help me very much. If you can't, then I'll need to do that investigation, find the commit, then identify how to fix that.

          osama hf added a comment - - edited

          are there a solution of this issue ? i have installed the pre-release plugin of git, but the problem still exist.
          Any other solution ?

          thnx

          osama hf added a comment - - edited are there a solution of this issue ? i have installed the pre-release plugin of git, but the problem still exist. Any other solution ? thnx

          Mark Waite added a comment -

          Since you say that the solution in the pre-release does not work for you, please provided detailed instructions to duplicate the problem you are seeing with the pre-release. I've reopened the bug awaiting your detailed description to duplicate the problem.

          I'm not aware of any other technique to address the issue. Kenneth reported that the pre-release resolved the issue for him. I need to understand what's different in your case.

          Mark Waite added a comment - Since you say that the solution in the pre-release does not work for you, please provided detailed instructions to duplicate the problem you are seeing with the pre-release. I've reopened the bug awaiting your detailed description to duplicate the problem. I'm not aware of any other technique to address the issue. Kenneth reported that the pre-release resolved the issue for him. I need to understand what's different in your case.

          osama hf added a comment -

          markewaite I use the Jenkins1.639 version, and the pre-release 4.1 of git plugin.

          For my case am using a forked repository ( so i add a repository for every SCM). I get always the same problem,

          Merging Revision a54b7c523fb9703fb9bcff7ba7726c7d15bd0d17 (osama/hello/dev) to origin/dev, UserMergeOptions{mergeRemote='origin', mergeTarget='${gitlabTargetBranch}', mergeStrategy='default', fastForwardMode='--ff'}
           > git rev-parse origin/dev^{commit} # timeout=10
          FATAL: Command "git rev-parse origin/dev^{commit}" returned status code 128:
          stdout: origin/dev^{commit}
          
          stderr: fatal: ambiguous argument 'origin/dev^{commit}': unknown revision or path not in the working tree.
          Use '--' to separate paths from revisions, like this:
          'git <command> [<revision>...] -- [<file>...]'
          
          hudson.plugins.git.GitException: Command "git rev-parse origin/dev^{commit}" returned status code 128:
          stdout: origin/dev^{commit}
          
          stderr: fatal: ambiguous argument 'origin/dev^{commit}': unknown revision or path not in the working tree.
          Use '--' to separate paths from revisions, like this:
          'git <command> [<revision>...] -- [<file>...]'
          

          osama hf added a comment - markewaite I use the Jenkins1.639 version, and the pre-release 4.1 of git plugin. For my case am using a forked repository ( so i add a repository for every SCM). I get always the same problem, Merging Revision a54b7c523fb9703fb9bcff7ba7726c7d15bd0d17 (osama/hello/dev) to origin/dev, UserMergeOptions{mergeRemote= 'origin' , mergeTarget= '${gitlabTargetBranch}' , mergeStrategy= ' default ' , fastForwardMode= '--ff' } > git rev-parse origin/dev^{commit} # timeout=10 FATAL: Command "git rev-parse origin/dev^{commit}" returned status code 128: stdout: origin/dev^{commit} stderr: fatal: ambiguous argument 'origin/dev^{commit}' : unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this : 'git <command> [<revision>...] -- [<file>...]' hudson.plugins.git.GitException: Command "git rev-parse origin/dev^{commit}" returned status code 128: stdout: origin/dev^{commit} stderr: fatal: ambiguous argument 'origin/dev^{commit}' : unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this : 'git <command> [<revision>...] -- [<file>...]'

          Mark Waite added a comment -

          Please provide step by step instructions that will show the problem you're seeing in a freshly installed Jenkins using publicly hosted repositories. If you'd like a base starter Jenkins instance and are willing to use Docker and Linux, refer to my jenkins docker with updated plugins

          Mark Waite added a comment - Please provide step by step instructions that will show the problem you're seeing in a freshly installed Jenkins using publicly hosted repositories. If you'd like a base starter Jenkins instance and are willing to use Docker and Linux, refer to my jenkins docker with updated plugins

          osama hf added a comment -

          Hi markewaite

          You can see my Job in the 3 pictures below,

          When i create a merge request in my Gitlab, the job run the build to run the tests, so i get the same error.

          Merging Revision faa55d252e5ff0ec55f26b860696e6957a58df0b (osama/hi/master) to origin/master, UserMergeOptions{mergeRemote='origin', mergeTarget='${gitlabTargetBranch}', mergeStrategy='default', fastForwardMode='--ff'}
           > git rev-parse origin/master^{commit} # timeout=10
          FATAL: Command "git rev-parse origin/master^{commit}" returned status code 128:
          stdout: origin/master^{commit}
          
          stderr: fatal: ambiguous argument 'origin/master^{commit}': unknown revision or path not in the working tree.
          Use '--' to separate paths from revisions, like this:
          'git <command> [<revision>...] -- [<file>...]'
          
          hudson.plugins.git.GitException: Command "git rev-parse origin/master^{commit}" returned status code 128:
          stdout: origin/master^{commit}
          
          stderr: fatal: ambiguous argument 'origin/master^{commit}': unknown revision or path not in the working tree.
          Use '--' to separate paths from revisions, like this:
          'git <command> [<revision>...] -- [<file>...]'
          
          	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1640)
          	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1616)
          	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1612)
          	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1254)
          	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1266)
          	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.revParse(CliGitAPIImpl.java:628)
          	at hudson.plugins.git.GitAPI.revParse(GitAPI.java:316)
          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          	at java.lang.reflect.Method.invoke(Method.java:606)
          	at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:608)
          	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:583)
          	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:542)
          	at hudson.remoting.UserRequest.perform(UserRequest.java:120)
          	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:68)
          	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
          	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          	at java.lang.Thread.run(Thread.java:745)
          	at ......remote call to nodejsname-e0597da095d7(Native Method)
          	at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416)
          	at hudson.remoting.UserResponse.retrieve(UserRequest.java:220)
          	at hudson.remoting.Channel.call(Channel.java:781)
          	at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:250)
          	at com.sun.proxy.$Proxy101.revParse(Unknown Source)
          	at org.jenkinsci.plugins.gitclient.RemoteGitImpl.revParse(RemoteGitImpl.java:546)
          	at hudson.plugins.git.extensions.impl.PreBuildMerge.decorateRevisionToBuild(PreBuildMerge.java:64)
          	at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:965)
          	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1054)
          	at org.jenkinsci.plugins.multiplescms.MultiSCM.checkout(MultiSCM.java:129)
          	at hudson.scm.SCM.checkout(SCM.java:485)
          	at hudson.model.AbstractProject.checkout(AbstractProject.java:1276)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
          	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
          	at hudson.model.Run.execute(Run.java:1738)
          	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          	at hudson.model.ResourceController.execute(ResourceController.java:98)
          	at hudson.model.Executor.run(Executor.java:410)
          Finished: FAILURE
          



          osama hf added a comment - Hi markewaite You can see my Job in the 3 pictures below, When i create a merge request in my Gitlab, the job run the build to run the tests, so i get the same error. Merging Revision faa55d252e5ff0ec55f26b860696e6957a58df0b (osama/hi/master) to origin/master, UserMergeOptions{mergeRemote= 'origin' , mergeTarget= '${gitlabTargetBranch}' , mergeStrategy= ' default ' , fastForwardMode= '--ff' } > git rev-parse origin/master^{commit} # timeout=10 FATAL: Command "git rev-parse origin/master^{commit}" returned status code 128: stdout: origin/master^{commit} stderr: fatal: ambiguous argument 'origin/master^{commit}' : unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this : 'git <command> [<revision>...] -- [<file>...]' hudson.plugins.git.GitException: Command "git rev-parse origin/master^{commit}" returned status code 128: stdout: origin/master^{commit} stderr: fatal: ambiguous argument 'origin/master^{commit}' : unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this : 'git <command> [<revision>...] -- [<file>...]' at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1640) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1616) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1612) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1254) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1266) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.revParse(CliGitAPIImpl.java:628) at hudson.plugins.git.GitAPI.revParse(GitAPI.java:316) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:608) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:583) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:542) at hudson.remoting.UserRequest.perform(UserRequest.java:120) 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:68) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang. Thread .run( Thread .java:745) at ......remote call to nodejsname-e0597da095d7(Native Method) at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416) at hudson.remoting.UserResponse.retrieve(UserRequest.java:220) at hudson.remoting.Channel.call(Channel.java:781) at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:250) at com.sun.proxy.$Proxy101.revParse(Unknown Source) at org.jenkinsci.plugins.gitclient.RemoteGitImpl.revParse(RemoteGitImpl.java:546) at hudson.plugins.git.extensions.impl.PreBuildMerge.decorateRevisionToBuild(PreBuildMerge.java:64) at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:965) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1054) at org.jenkinsci.plugins.multiplescms.MultiSCM.checkout(MultiSCM.java:129) at hudson.scm.SCM.checkout(SCM.java:485) at hudson.model.AbstractProject.checkout(AbstractProject.java:1276) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529) at hudson.model.Run.execute(Run.java:1738) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Finished: FAILURE

          Mark Waite added a comment -

          Pull request PR296 has been included in git plugin 2.4.1 released 26 Dec 2015.

          Mark Waite added a comment - Pull request PR296 has been included in git plugin 2.4.1 released 26 Dec 2015.

          markewaite Did the issue with excessive git rev-parse invocations get resolved? I took a look through the post Dec 3 commit history and didn't see anything obvious. I plan to test this out over the holiday weekend to be sure and am hoping its is resolved.

          Kenneth Baltrinic added a comment - markewaite Did the issue with excessive git rev-parse invocations get resolved? I took a look through the post Dec 3 commit history and didn't see anything obvious. I plan to test this out over the holiday weekend to be sure and am hoping its is resolved.

          Mark Waite added a comment -

          No, I didn't take any steps to reduce the number of calls to git rev-parse in the git plugin 2.4.1 release or the git client plugin 1.19.1 release. I am interested if you still see the problem, but a fix for that problem will need to wait for the next release of the plugins.

          Mark Waite added a comment - No, I didn't take any steps to reduce the number of calls to git rev-parse in the git plugin 2.4.1 release or the git client plugin 1.19.1 release. I am interested if you still see the problem, but a fix for that problem will need to wait for the next release of the plugins.

          Just tested it out and yes, we are still seeing the issue. From our perspective, this is a major regression. I'll open up a separate ticket.

          Kenneth Baltrinic added a comment - Just tested it out and yes, we are still seeing the issue. From our perspective, this is a major regression. I'll open up a separate ticket.

            Unassigned Unassigned
            toypoodle Vasili Kvockin
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: