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

108 views
Skip to first unread message

disflux2010@gmail.com (JIRA)

unread,
May 31, 2018, 10:10:03 AM5/31/18
to jenkinsc...@googlegroups.com
Dan Schladweiler created an issue
 
Jenkins / Bug JENKINS-51638
No Enum Constant Found - Default PreBuildMerge Failure
Issue Type: Bug Bug
Assignee: Mark Waite
Components: git-plugin
Created: 2018-05-31 14:09
Environment: Jenkins Version = 2.108
Git-Plugin = 3.9.0
Git-Client-Plugin = 2.7.2
OS = RHEL7
Priority: Major Major
Reporter: Dan Schladweiler

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.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

disflux2010@gmail.com (JIRA)

unread,
May 31, 2018, 10:11:02 AM5/31/18
to jenkinsc...@googlegroups.com
Dan Schladweiler updated an issue
Change By: Dan Schladweiler
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.
{code:java}
//         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"
                          ]]
                        ]
                    }
                }
            }
        }
{code}

This yields the following error:
{code:java}
// java.lang.IllegalArgumentException: No enum constant org.jenkinsci.plugins.gitclient.MergeCommand.Strategy.default
{code}

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

disflux2010@gmail.com (JIRA)

unread,
May 31, 2018, 10:22:01 AM5/31/18
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
May 31, 2018, 11:29:02 AM5/31/18
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
May 31, 2018, 11:30:02 AM5/31/18
to jenkinsc...@googlegroups.com
Mark Waite commented on Bug JENKINS-51638
 
Re: No Enum Constant Found - Default PreBuildMerge Failure

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

disflux2010@gmail.com (JIRA)

unread,
May 31, 2018, 11:48:02 AM5/31/18
to jenkinsc...@googlegroups.com

Mark Waite - 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.earl.waite@gmail.com (JIRA)

unread,
May 31, 2018, 12:00:02 PM5/31/18
to jenkinsc...@googlegroups.com

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.

disflux2010@gmail.com (JIRA)

unread,
May 31, 2018, 1:45:01 PM5/31/18
to jenkinsc...@googlegroups.com

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@gfs.com (JIRA)

unread,
Jul 2, 2018, 9:21:01 AM7/2/18
to jenkinsc...@googlegroups.com

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.

This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

amirbarkal@sparkbeyond.com (JIRA)

unread,
Jul 8, 2018, 5:08:02 AM7/8/18
to jenkinsc...@googlegroups.com

+1 on this issue.

Had to switch to upper case to workaround this issue.

shenrong87@gmail.com (JIRA)

unread,
Aug 7, 2018, 2:14:02 AM8/7/18
to jenkinsc...@googlegroups.com

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

owen@nerdnetworks.org (JIRA)

unread,
Aug 7, 2018, 3:06:02 AM8/7/18
to jenkinsc...@googlegroups.com

Changing

mergeStrategy: 'MergeCommand.Strategy.DEFAULT'

to

mergeStrategy: 'DEFAULT',

May also be necessary.

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 11, 2019, 4:05:02 PM2/11/19
to jenkinsc...@googlegroups.com
Mark Waite assigned an issue to Unassigned
 
Change By: Mark Waite
Assignee: Mark Waite
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

gnnjsj2006@126.com (JIRA)

unread,
Feb 20, 2019, 3:29:02 AM2/20/19
to jenkinsc...@googlegroups.com
Gao Ningning commented on Bug JENKINS-51638
 
Re: No Enum Constant Found - Default PreBuildMerge Failure

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.

jglick@cloudbees.com (JIRA)

unread,
Apr 1, 2019, 9:27:03 PM4/1/19
to jenkinsc...@googlegroups.com

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

jglick@cloudbees.com (JIRA)

unread,
Apr 2, 2019, 9:04:02 AM4/2/19
to jenkinsc...@googlegroups.com

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

jglick@cloudbees.com (JIRA)

unread,
Apr 8, 2019, 5:51:04 PM4/8/19
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Apr 8, 2019, 5:51:04 PM4/8/19
to jenkinsc...@googlegroups.com
Jesse Glick started work on Bug JENKINS-51638
 
Change By: Jesse Glick
Status: Open In Progress

jglick@cloudbees.com (JIRA)

unread,
Apr 9, 2019, 10:46:04 AM4/9/19
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Apr 26, 2019, 9:40:05 AM4/26/19
to jenkinsc...@googlegroups.com
 

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

Change By: Jesse Glick
Status: In Review Fixed but Unreleased
Resolution: Fixed

mark.earl.waite@gmail.com (JIRA)

unread,
Apr 27, 2019, 10:52:37 AM4/27/19
to jenkinsc...@googlegroups.com
Mark Waite commented on Bug JENKINS-51638
 
Re: No Enum Constant Found - Default PreBuildMerge Failure

The fix that Jesse Glick 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 Jesse Glick 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.

mark.earl.waite@gmail.com (JIRA)

unread,
Apr 27, 2019, 11:20:02 AM4/27/19
to jenkinsc...@googlegroups.com

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

mark.earl.waite@gmail.com (JIRA)

unread,
Apr 27, 2019, 11:42:06 AM4/27/19
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Bug JENKINS-51638
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:

{noformat}

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)
{noformat}

I'll refer to [my jenkins-bugs test repository|https://github.com/MarkEWaite/jenkins-bugs/tree/JENKINS-51638] for the details.


Problem logged as JENKINS-57205

mark.earl.waite@gmail.com (JIRA)

unread,
May 2, 2019, 5:30:02 PM5/2/19
to jenkinsc...@googlegroups.com
Mark Waite updated Bug JENKINS-51638
 

Released in git plugin 3.10.0 May 2, 2019.

Change By: Mark Waite
Status: Fixed but Unreleased Closed

mark.earl.waite@gmail.com (JIRA)

unread,
Jul 5, 2019, 7:46:05 PM7/5/19
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Jul 5, 2019, 7:46:08 PM7/5/19
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Jul 5, 2019, 7:46:11 PM7/5/19
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages