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

Pipeline should gracefully error when receiving: GitException: Failed to merge AnyObjectId[

XMLWordPrintable

      When using the github-branch-source plugin (for example) and a merge to master occurs, the Pull Requests will be retriggered and attempt to merge from master. This is definitely a good behavior because previous Jenkins results for that Pull Request are now invalid.

      However, if there is a conflict between the master branch and the Pull Request, a big ugly stacktrace is thrown and not caught, leading to a very confused user.

      This should be a clearer message and perhaps (if possible) a listing of the conflicting files.

      [Pipeline] // stage
      [Pipeline] stage
      [Pipeline] { (Checkout source)
      [Pipeline] checkout
      Cloning the remote Git repository
      Cloning with configured refspecs honoured and without tags
      remote: Counting objects
      Receiving objects
      Resolving deltas
      Updating references
      Fetching without tags
      Merging remotes/origin/master commit c1469e687e31e91cea381a774caa5349bba87efe into PR head commit d22bc36c49eedee7e560afafe67364e57b447f05
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] echo
      Caught: hudson.plugins.git.GitException: Failed to merge AnyObjectId[c1469e687e31e91cea381a774caa5349bba87efe]
      [Pipeline] mail
      [Pipeline] End of Pipeline
      
      GitHub has been notified of this commit’s build result
      
      Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to ubuntu-jenkinsinfraf94690
      		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1693)
      		at hudson.remoting.UserResponse.retrieve(UserRequest.java:310)
      		at hudson.remoting.Channel.call(Channel.java:908)
      		at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
      		at sun.reflect.GeneratedMethodAccessor459.invoke(Unknown Source)
      		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      		at java.lang.reflect.Method.invoke(Method.java:498)
      		at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
      		at com.sun.proxy.$Proxy253.execute(Unknown Source)
      		at jenkins.plugins.git.MergeWithGitSCMExtension.decorateRevisionToBuild(MergeWithGitSCMExtension.java:122)
      		at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:1031)
      		at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1124)
      		at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
      		at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
      		at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
      		at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
      		at hudson.security.ACL.impersonate(ACL.java:260)
      		at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
      		at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      		at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      		at java.lang.Thread.run(Thread.java:745)
      hudson.plugins.git.GitException: Failed to merge AnyObjectId[c1469e687e31e91cea381a774caa5349bba87efe]
      	at org.jenkinsci.plugins.gitclient.JGitAPIImpl$6.execute(JGitAPIImpl.java:1560)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:207)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:53)
      	at hudson.remoting.Request$2.run(Request.java:358)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Finished: FAILURE
      
      

            Unassigned Unassigned
            rtyler R. Tyler Croy
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: