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

Checkout fails with Multiple SCMs plugin on commit notification

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • Jenkins 1.568
      multiple-scms-plugin 0.4-beta-1
      git-plugin 2.3.5-SNAPSHOT

    Description

      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

      Attachments

        Activity

          osama_hf 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 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
          markewaite Mark Waite added a comment -

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

          markewaite 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.

          kbaltrinic 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.
          markewaite 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.

          markewaite 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.

          kbaltrinic 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.

          People

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

            Dates

              Created:
              Updated:
              Resolved: