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

No Enum Constant Found - Default PreBuildMerge Failure

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • git-plugin
    • Jenkins Version = 2.108
      Git-Plugin = 3.9.0
      Git-Client-Plugin = 2.7.2
      OS = RHEL7

      Experiencing a bug with the latest release of the Git-Pugin (3.9.0).

      The following stage within a Declarative Pipeline yields a Java enum constant failure in relation to the git-client plugin.

               stage("Clone source, execute local merge"){
                  steps{
                      dir("source"){
                          script{
                              // Pull the source and test a merge
                              def sourceScmCheck = checkout changelog: true, poll: true, scm: [
                                $class: 'GitSCM',
                                branches: [[name: "origin/sourceBranch"]],
                                doGenerateSubmoduleConfigurations: false,
                                extensions: [[
                                  $class: 'PreBuildMerge',
                                  options: [
                                    fastForwardMode: 'FF',
                                    mergeRemote: 'origin',
                                    mergeStrategy: 'default',
                                    mergeTarget: "targetBranch"
                                  ]
                                ]],
                                submoduleCfg: [],
                                userRemoteConfigs: [[
                                  credentialsId: 'gitcredentialshere',
                                  name: 'origin',
                                  url: "https://somegit.somewhere"
                                ]]
                              ]
                          }
                      }
                  }
              }
      

      This yields the following error:

      java.lang.IllegalArgumentException: No enum constant org.jenkinsci.plugins.gitclient.MergeCommand.Strategy.default
          at java.lang.Enum.valueOf(Enum.java:238)
          at org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:404)
          at org.jenkinsci.plugins.structs.describable.DescribableModel.injectSetters(DescribableModel.java:360)
          at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:283)
      Caused: java.lang.IllegalArgumentException: Could not instantiate {mergeStrategy=default, fastForwardMode=FF, mergeTarget=targetBranch, mergeRemote=origin} for UserMergeOptions(mergeTarget: String, fastForwardMode?: GitPluginFastForwardMode[FF, FF_ONLY, NO_FF], mergeRemote?: String, mergeStrategy?: Strategy[DEFAULT, RESOLVE, RECURSIVE, OCTOPUS, OURS, SUBTREE, RECURSIVE_THEIRS])
          at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:286)
          at org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:402)
          at org.jenkinsci.plugins.structs.describable.DescribableModel.buildArguments(DescribableModel.java:340)
          at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:281)
      Caused: java.lang.IllegalArgumentException: Could not instantiate {options={fastForwardMode=FF, mergeRemote=origin, mergeStrategy=default, mergeTarget=targetBranch}} for PreBuildMerge(options: UserMergeOptions(mergeTarget: String, fastForwardMode?: GitPluginFastForwardMode[FF, FF_ONLY, NO_FF], mergeRemote?: String, mergeStrategy?: Strategy[DEFAULT, RESOLVE, RECURSIVE, OCTOPUS, OURS, SUBTREE, RECURSIVE_THEIRS]))
          at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:286)
          at org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:402)
          at org.jenkinsci.plugins.structs.describable.DescribableModel.coerceList(DescribableModel.java:485)
          at org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:387)
          at org.jenkinsci.plugins.structs.describable.DescribableModel.buildArguments(DescribableModel.java:340)
          at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:281)
      Caused: java.lang.IllegalArgumentException: Could not instantiate {extensions=[{$class=PreBuildMerge, options={fastForwardMode=FF, mergeRemote=origin, mergeStrategy=default, mergeTarget=targetBranch}}], submoduleCfg=[], userRemoteConfigs=[{credentialsId=gitcredentials, name=origin, url=https://somegit.somewhere/redacted}], doGenerateSubmoduleConfigurations=false, branches=[{name=origin/sourceBranch}]} for GitSCM(userRemoteConfigs: UserRemoteConfig(url: String, name: String, refspec: String, credentialsId: String)[], branches: BranchSpec(name: String)[], doGenerateSubmoduleConfigurations: boolean, submoduleCfg: org.kohsuke.stapler.NoStaplerConstructorException: There's no @DataBoundConstructor on any constructor of class hudson.plugins.git.SubmoduleConfig[], browser: GitRepositoryBrowser{AssemblaWeb(repoUrl: String) | BitbucketWeb(repoUrl: String) | CGit(repoUrl: String) | FisheyeGitRepositoryBrowser(repoUrl: String) | GitBlitRepositoryBrowser(repoUrl: String, projectName: String) | GitLab(repoUrl: String, version: String) | GitList(repoUrl: String) | GitWeb(repoUrl: String) | GithubWeb(repoUrl: String) | Gitiles(repoUrl: String) | GitoriousWeb(repoUrl: String) | GogsGit(repoUrl: String) | KilnGit(repoUrl: String) | Phabricator(repoUrl: String, repo: String) | RedmineWeb(repoUrl: String) | RhodeCode(repoUrl: String) | Stash(repoUrl: String) | TFS2013GitRepositoryBrowser(repoUrl: String) | ViewGitWeb(repoUrl: String, projectName: String)}, gitTool: String, extensions: GitSCMExtension{AuthorInChangelog() | BuildChooserSetting(buildChooser: BuildChooser{AncestryBuildChooser(maximumAgeInDays: int, ancestorCommitSha1: String) | DefaultBuildChooser() | InverseBuildChooser()}) | ChangelogToBranch(options: ChangelogToBranchOptions(compareRemote: String, compareTarget: String)) | CheckoutOption(timeout: int) | CleanBeforeCheckout() | CleanCheckout() | CloneOption(shallow: boolean, noTags: boolean, reference: String, timeout: int, depth?: int, honorRefspec?: boolean) | DisableRemotePoll() | GitLFSPull() | IgnoreNotifyCommit() | LocalBranch(localBranch: String) | MessageExclusion(excludedMessage: String) | PathRestriction(includedRegions: String, excludedRegions: String) | PerBuildTag() | PreBuildMerge(options: UserMergeOptions(mergeTarget: String, fastForwardMode?: GitPluginFastForwardMode[FF, FF_ONLY, NO_FF], mergeRemote?: String, mergeStrategy?: Strategy[DEFAULT, RESOLVE, RECURSIVE, OCTOPUS, OURS, SUBTREE, RECURSIVE_THEIRS])) | PruneStaleBranch() | RelativeTargetDirectory(relativeTargetDir: String) | ScmName(name: String) | SparseCheckoutPaths(sparseCheckoutPaths: SparseCheckoutPath(path: String)[]) | SubmoduleOption(disableSubmodules: boolean, recursiveSubmodules: boolean, trackingSubmodules: boolean, reference: String, timeout: int, parentCredentials: boolean) | UserExclusion(excludedUsers: String) | UserIdentity(name: String, email: String) | WipeWorkspace()}[])
          at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:286)
          at org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:402)
          at org.jenkinsci.plugins.structs.describable.DescribableModel.buildArguments(DescribableModel.java:340)
          at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:281)
          at org.jenkinsci.plugins.workflow.steps.StepDescriptor.newInstance(StepDescriptor.java:201)
          at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:208)
          at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:153)
          at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)
          at sun.reflect.GeneratedMethodAccessor655.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
          at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
          at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
          at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
          at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
          at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:157)
          at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
          at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:133)
          at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:155)
          at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:159)
          at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:129)
          at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:129)
          at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:129)
          at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
      Caused: java.lang.IllegalArgumentException: Could not instantiate {changelog=true, poll=true, scm={$class=GitSCM, branches=[{name=origin/sourceBranch}], doGenerateSubmoduleConfigurations=false, extensions=[{$class=PreBuildMerge, options={fastForwardMode=FF, mergeRemote=origin, mergeStrategy=default, mergeTarget=targetBranch}}], submoduleCfg=[], userRemoteConfigs=[{credentialsId=gitcredentials, name=origin, url=https://somegit.somewhere/redacted}]}} for GenericSCMStep(scm: SCM{GitSCM(userRemoteConfigs: UserRemoteConfig(url: String, name: String, refspec: String, credentialsId: String)[], branches: BranchSpec(name: String)[], doGenerateSubmoduleConfigurations: boolean, submoduleCfg: org.kohsuke.stapler.NoStaplerConstructorException: There's no @DataBoundConstructor on any constructor of class hudson.plugins.git.SubmoduleConfig[], browser: GitRepositoryBrowser{AssemblaWeb(repoUrl: String) | BitbucketWeb(repoUrl: String) | CGit(repoUrl: String) | FisheyeGitRepositoryBrowser(repoUrl: String) | GitBlitRepositoryBrowser(repoUrl: String, projectName: String) | GitLab(repoUrl: String, version: String) | GitList(repoUrl: String) | GitWeb(repoUrl: String) | GithubWeb(repoUrl: String) | Gitiles(repoUrl: String) | GitoriousWeb(repoUrl: String) | GogsGit(repoUrl: String) | KilnGit(repoUrl: String) | Phabricator(repoUrl: String, repo: String) | RedmineWeb(repoUrl: String) | RhodeCode(repoUrl: String) | Stash(repoUrl: String) | TFS2013GitRepositoryBrowser(repoUrl: String) | ViewGitWeb(repoUrl: String, projectName: String)}, gitTool: String, extensions: GitSCMExtension{AuthorInChangelog() | BuildChooserSetting(buildChooser: BuildChooser{AncestryBuildChooser(maximumAgeInDays: int, ancestorCommitSha1: String) | DefaultBuildChooser() | InverseBuildChooser()}) | ChangelogToBranch(options: ChangelogToBranchOptions(compareRemote: String, compareTarget: String)) | CheckoutOption(timeout: int) | CleanBeforeCheckout() | CleanCheckout() | CloneOption(shallow: boolean, noTags: boolean, reference: String, timeout: int, depth?: int, honorRefspec?: boolean) | DisableRemotePoll() | GitLFSPull() | IgnoreNotifyCommit() | LocalBranch(localBranch: String) | MessageExclusion(excludedMessage: String) | PathRestriction(includedRegions: String, excludedRegions: String) | PerBuildTag() | PreBuildMerge(options: UserMergeOptions(mergeTarget: String, fastForwardMode?: GitPluginFastForwardMode[FF, FF_ONLY, NO_FF], mergeRemote?: String, mergeStrategy?: Strategy[DEFAULT, RESOLVE, RECURSIVE, OCTOPUS, OURS, SUBTREE, RECURSIVE_THEIRS])) | PruneStaleBranch() | RelativeTargetDirectory(relativeTargetDir: String) | ScmName(name: String) | SparseCheckoutPaths(sparseCheckoutPaths: SparseCheckoutPath(path: String)[]) | SubmoduleOption(disableSubmodules: boolean, recursiveSubmodules: boolean, trackingSubmodules: boolean, reference: String, timeout: int, parentCredentials: boolean) | UserExclusion(excludedUsers: String) | UserIdentity(name: String, email: String) | WipeWorkspace()}[]) | NullSCM()}, changelog?: boolean, poll?: boolean)
          at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:286)
          at org.jenkinsci.plugins.workflow.steps.StepDescriptor.newInstance(StepDescriptor.java:201)
          at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:208)
          at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:153)
          at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)
          at sun.reflect.GeneratedMethodAccessor655.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
          at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
          at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
          at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
          at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
          at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:157)
          at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
          at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:133)
          at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:155)
          at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:159)
          at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:129)
          at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:129)
          at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:129)
          at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
          at WorkflowScript.run(WorkflowScript:43)
          at ___cps.transform___(Native Method)
          at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57)
          at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
          at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
          at sun.reflect.GeneratedMethodAccessor510.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
          at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
          at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
          at sun.reflect.GeneratedMethodAccessor513.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
          at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
          at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
          at sun.reflect.GeneratedMethodAccessor513.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
          at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
          at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
          at sun.reflect.GeneratedMethodAccessor513.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
          at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
          at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
          at sun.reflect.GeneratedMethodAccessor513.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
          at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:103)
          at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
          at sun.reflect.GeneratedMethodAccessor510.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
          at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:60)
          at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
          at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
          at sun.reflect.GeneratedMethodAccessor510.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
          at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
          at com.cloudbees.groovy.cps.Next.step(Next.java:83)
          at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
          at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
          at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)
          at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)
          at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
          at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$101(SandboxContinuable.java:34)
          at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.lambda$run0$0(SandboxContinuable.java:59)
          at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
          at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:58)
          at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:332)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$200(CpsThreadGroup.java:83)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:244)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:232)
          at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131)
          at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
          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:748)
      Finished: FAILURE
      

      Downgrading the git-plugin to version 3.8.0 resolves the issue. No changes to the git-client plugin were needed.

          [JENKINS-51638] No Enum Constant Found - Default PreBuildMerge Failure

          Possibly related to changes made as part of JENKINS-34070

          Dan Schladweiler added a comment - Possibly related to changes made as part of JENKINS-34070

          Mark Waite added a comment -

          Is the problem resolved if you change the value of the mergeStrategy from 'default' to 'DEFAULT'?

          Mark Waite added a comment - Is the problem resolved if you change the value of the mergeStrategy from 'default' to 'DEFAULT'?

          markewaite - Yes, it is. Looks like the case insensitivity got lost somewhere. Is that something that can get added back in, or should we move to uppercase?

          Dan Schladweiler added a comment - markewaite - Yes, it is. Looks like the case insensitivity got lost somewhere. Is that something that can get added back in, or should we move to uppercase?

          Mark Waite added a comment -

          Move to upper case is something you can do immediately, rather than waiting for a new release of the plugin. I'll need to add regression tests of pipeline based pre-build merge. Once I've added those regression tests (in my jenkins-bugs repository), then I would investigate the necessary code change to fix the regression tests.

          Mark Waite added a comment - Move to upper case is something you can do immediately, rather than waiting for a new release of the plugin. I'll need to add regression tests of pipeline based pre-build merge. Once I've added those regression tests (in my jenkins-bugs repository), then I would investigate the necessary code change to fix the regression tests.

          I think making those code changes would be beneficial. The majority of resources online that depict how to do pre-build merges use lowercase in their examples (See the GitLab plugin GitHub page as an example). I expect quite a few people will run into this issue once they upgrade the plugin.

          Dan Schladweiler added a comment - I think making those code changes would be beneficial. The majority of resources online that depict how to do pre-build merges use lowercase in their examples (See the GitLab plugin GitHub page as an example). I expect quite a few people will run into this issue once they upgrade the plugin.

          Daniel Mish added a comment -

          I had this issue after the upgrade, however, the mergeStrategy was already DEFAULT, so I suspect there is something else going on here. Only downgrading resolved the issue.

          Daniel Mish added a comment - I had this issue after the upgrade, however, the mergeStrategy was already DEFAULT, so I suspect there is something else going on here. Only downgrading resolved the issue.

          Amir Barkal added a comment -

          +1 on this issue.

          Had to switch to upper case to workaround this issue.

          Amir Barkal added a comment - +1 on this issue. Had to switch to upper case to workaround this issue.

          Rong Shen added a comment -

          I'm also seeing this, and I'm already using uppercase and still not help. 

          Rong Shen added a comment - I'm also seeing this, and I'm already using uppercase and still not help. 

          Owen Mehegan added a comment -

          Changing

          mergeStrategy: 'MergeCommand.Strategy.DEFAULT'
          

          to

          mergeStrategy: 'DEFAULT',
          

          May also be necessary.

          Owen Mehegan added a comment - Changing mergeStrategy: 'MergeCommand.Strategy.DEFAULT' to mergeStrategy: 'DEFAULT', May also be necessary.

          Gao Ningning added a comment -

          Also met the same issue, change the value of the mergeStrategy from 'default' to 'DEFAULT' can solve problem.

          It is interesting that 'default' can work in lower Git Plugin version, but exception happened in high verison.

          Gao Ningning added a comment - Also met the same issue, change the value of the mergeStrategy from 'default' to 'DEFAULT' can solve problem. It is interesting that 'default' can work in lower Git Plugin version, but exception happened in high verison.

          Jesse Glick added a comment -

          mergeStrategy: 'DEFAULT' (or similarly uppercase for the other options) is correct, or simply omit this parameter since DEFAULT is, well, the default. It is hard to say what would have been legal in older plugin versions (actually honored values) since it performed no validation on this parameter and (as in JENKINS-34070) the snippet generator was broken. I do not see a good way to make this plugin tolerate the lowercase syntax; there is not a general API in DescribableModel permitting arbitrary customizations to the introspected structure. (At top level, a StepDescriptor can override newInstance and uninstantiate, but this does not apply to structures used as nested arguments.)

          Jesse Glick added a comment - mergeStrategy: 'DEFAULT' (or similarly uppercase for the other options) is correct, or simply omit this parameter since DEFAULT is, well, the default. It is hard to say what would have been legal in older plugin versions (actually honored values) since it performed no validation on this parameter and (as in JENKINS-34070 ) the snippet generator was broken. I do not see a good way to make this plugin tolerate the lowercase syntax; there is not a general API in DescribableModel permitting arbitrary customizations to the introspected structure. (At top level, a StepDescriptor can override newInstance and uninstantiate , but this does not apply to structures used as nested arguments.)

          Jesse Glick added a comment -

          A proper fix would require something like JENKINS-44892, which has been discussed for some time but never prototyped.

          Jesse Glick added a comment - A proper fix would require something like JENKINS-44892 , which has been discussed for some time but never prototyped.

          Jesse Glick added a comment -

          Fix merged in the 4.x trunk, and a 3.10.x backport is in preparation.

          Jesse Glick added a comment - Fix merged in the 4.x trunk, and a 3.10.x backport is in preparation.

          Mark Waite added a comment - - edited

          The fix that jglick has provided is working well in my testing of git plugin 4.0 pre-release. I can see the failure with git plugin 3.9.4 and can confirm that it is resolved in the 4.0 pre-release. I haven't yet tested it with the git plugin 3.10 pre-release, but I expect no issue in that pre-release version either.

          While testing the fix that jglick has provided for git plugin 4.0 and git plugin 3.10, I found a null pointer exception that I need to investigate further when using JGit as the git implementation. The stack trace was:

          java.lang.NullPointerException
          	at hudson.plugins.git.util.GitUtils.getRevisionForSHA1(GitUtils.java:166)
          	at hudson.plugins.git.extensions.impl.PreBuildMerge.decorateRevisionToBuild(PreBuildMerge.java:119)
          	at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:1058)
          	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1151)
          	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:120)
          	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:90)
          	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:77)
          	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
          	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
          	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
          	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
          	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
          	at java.base/java.lang.Thread.run(Thread.java:834)
          

          I'll refer to my jenkins-bugs test repository for the details.

          Problem logged as JENKINS-57205

          Mark Waite added a comment - - edited The fix that jglick has provided is working well in my testing of git plugin 4.0 pre-release. I can see the failure with git plugin 3.9.4 and can confirm that it is resolved in the 4.0 pre-release. I haven't yet tested it with the git plugin 3.10 pre-release, but I expect no issue in that pre-release version either. While testing the fix that jglick has provided for git plugin 4.0 and git plugin 3.10, I found a null pointer exception that I need to investigate further when using JGit as the git implementation. The stack trace was: java.lang.NullPointerException at hudson.plugins.git.util.GitUtils.getRevisionForSHA1(GitUtils.java:166) at hudson.plugins.git.extensions.impl.PreBuildMerge.decorateRevisionToBuild(PreBuildMerge.java:119) at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:1058) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1151) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:120) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:90) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:77) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) I'll refer to my jenkins-bugs test repository for the details. Problem logged as JENKINS-57205

          Mark Waite added a comment -

          Interactive tests passed with the git plugin 3.10 pre-release as well.

          Mark Waite added a comment - Interactive tests passed with the git plugin 3.10 pre-release as well.

          Mark Waite added a comment -

          Released in git plugin 3.10.0 May 2, 2019.

          Mark Waite added a comment - Released in git plugin 3.10.0 May 2, 2019.

          Mark Waite added a comment - - edited

          Fixed in Git plugin 4.0.0-beta10 released July 5, 2019

          Mark Waite added a comment - - edited Fixed in Git plugin 4.0.0-beta10 released July 5, 2019

            jglick Jesse Glick
            disflux Dan Schladweiler
            Votes:
            5 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: