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

No Enum Constant Found - Default PreBuildMerge Failure

XMLWordPrintable

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

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

              Created:
              Updated:
              Resolved: