KostyaSha / github-integration-plugin

Jenkins GitHub Integration Plugin
https://wiki.jenkins-ci.org/display/JENKINS/GitHub+Integration+Plugin
MIT License
98 stars 85 forks source link

java.lang.IllegalArgumentException: Arguments to class com.github.kostyasha.github.integration.multibranch.handler.GitHubBranchHandler have to be explicitly named #274

Open danielfm opened 6 years ago

danielfm commented 6 years ago

After updating to the latest version (0.2.0-rc-1) of this plugin a few hours ago, all pipeline executions failed at the very end with the following error:

[Pipeline] // node
[Pipeline] End of Pipeline

GitHub has been notified of this commit’s build result

java.lang.IllegalArgumentException: Arguments to class com.github.kostyasha.github.integration.multibranch.handler.GitHubBranchHandler have to be explicitly named
    at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:276)
    at sun.reflect.GeneratedMethodAccessor500.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.PojoMetaClassSite.call(PojoMetaClassSite.java:47)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callSafe(AbstractCallSite.java:87)
    at org.jenkinsci.plugins.pipeline.modeldefinition.Utils.instantiateDescribable(Utils.groovy:407)
    at org.jenkinsci.plugins.pipeline.modeldefinition.Utils$instantiateDescribable$3.callStatic(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:56)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:194)
    at org.kohsuke.groovy.sandbox.impl.Checker$2.call(Checker.java:188)
    at org.kohsuke.groovy.sandbox.GroovyInterceptor.onStaticCall(GroovyInterceptor.java:35)
    at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onStaticCall(SandboxInterceptor.java:158)
    at org.kohsuke.groovy.sandbox.impl.Checker$2.call(Checker.java:186)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedStaticCall(Checker.java:190)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:97)
    at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
    at WorkflowScript.run(WorkflowScript)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.instancesFromClosure(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:621)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateWhen(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:601)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:240)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inDeclarativeAgent(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:494)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inDeclarativeAgent(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:493)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:239)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.stageInput(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:304)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.stageInput(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:303)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:217)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inWrappers(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:521)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inWrappers(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:520)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:200)
    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.GeneratedMethodAccessor147.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.GeneratedMethodAccessor146.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:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE

Reverting to 0.1.0-rc29 fixed the problem. Maybe this is due to some bad interaction with other plugins (so far, this is the only plugin left to update in my Jenkins setup, so maybe some other plugin updated in such a way that causes problems with 0.2.0-rc-1).

Can anyone give some insights on why that happens? Also, feel free to ask me any relevant detail of my setup, if that helps uncover the underlying issue (and also forgive me if this is not the right repository, it's often hard to grasp the boundaries between plugins).

KostyaSha commented 6 years ago

What config do you have?

danielfm commented 6 years ago

Hi.

I'm running Jenkins ver. 2.107.3 on AWS.

Taking one of the failing jobs as an example (which is a declarative multi-branch pipeline):

screenshot from 2018-06-08 12-57-37

screenshot from 2018-06-08 13-07-02

And this is the Pipeline code, with some strings redacted:

def subdir = 'some-dir/deploy'

pipeline {
  agent {
    dockerfile {
      label 'linux'
      dir subdir
    }
  }

  options {
    timeout(time: 5, unit: 'MINUTES')
    disableConcurrentBuilds()
    buildDiscarder(logRotator(numToKeepStr: '10'))
  }

  environment {
    AWS_ACCESS_KEY_ID     = credentials('some-credential')
    AWS_SECRET_ACCESS_KEY = credentials('some-credential')

    // Store user-specific config in the current directory, instead of /
    HOME = '.'
  }

  stages {
    stage('Test') {
      failFast true
      parallel {
        stage('Step') {
          steps {
            sh "cd $subdir ; ./make/test.sh"
          }
        }

        stage('Lint') {
          steps {
            sh "cd $subdir ; ./make/lint.sh"
          }
        }
      }
    }

    stage('Publish') {
      when {
        branch 'master'
      }
      steps {
        sh "cd $subdir ; ./make/build.sh"
        sh "cd $subdir ; ./make/publish.sh"
      }
    }
  }
}

If by 'config' you meant other things, let me know so I can give you the correct data. :)

KostyaSha commented 6 years ago

will try https://github.com/KostyaSha/github-integration-plugin/pull/275

KostyaSha commented 6 years ago

Could you try /0.2.0-rc-2 ?

danielfm commented 6 years ago

Sure, I'll give it a shot in a few hours, when our CI activity slows down a little bit. I'll post an update here afterwards.

Thanks for your help!

zoellner commented 6 years ago

Having the same problem. Still happening with 0.2.0-rc-2 (Jenkins ver. 2.126)

KostyaSha commented 6 years ago

thanks for information

danielfm commented 6 years ago

Also tested the 0.2.0-rc-2 release and the error still happens, as reported above.

zoellner commented 6 years ago

did some debugging: one of our stages has

when {
  anyOf { branch 'master'; branch 'develop' }
}

when I take those lines out it works

KostyaSha commented 6 years ago

what structs-plugin version do you have?

zoellner commented 6 years ago

1.14

danielfm commented 6 years ago

Same here (the structs-plugin version, not removing the when; I'll try that later).

KostyaSha commented 6 years ago

@jglick why 'branch' symbol conflicts while it under other extension point tree?

danielfm commented 6 years ago

I also confirm that the pipeline only fails when using the branch condition in when; I tried other conditions, such as equals and changeset, and they both work.

davidgoate commented 6 years ago

This has also started happening to me today after updating jenkins plugins via the update UI.

davidgoate commented 6 years ago

FYI for anyone having this trouble, I downgraded via the Jenkins plugin UI back to 0.1.0-rc29 from 0.2.0-rc-2 and my builds are all working again now.

KostyaSha commented 6 years ago

when { anyOf { branch 'master'; branch 'develop' } }

is it declarative syntax?

KostyaSha commented 6 years ago

Could somebody fill issue in jenkins JIRA against pipeline? I think their syntax conflicts with symbols (that i think correctly implemented on my side).

KostyaSha commented 6 years ago

Could you try https://jitpack.io/com/github/KostyaSha/github-integration-plugin/github-pullrequest/bypassBuggyPipeline-0.2.0-rc-1-g395f9f9-5/github-pullrequest-bypassBuggyPipeline-0.2.0-rc-1-g395f9f9-5.hpi ?

zoellner commented 6 years ago

that didn't help

java.lang.IllegalArgumentException: Arguments to class com.github.kostyasha.github.integration.multibranch.handler.GitHubBranchHandler have to be explicitly named
    at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:276)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    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.PojoMetaClassSite.call(PojoMetaClassSite.java:47)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callSafe(AbstractCallSite.java:87)
    at org.jenkinsci.plugins.pipeline.modeldefinition.Utils.instantiateDescribable(Utils.groovy:407)
    at org.jenkinsci.plugins.pipeline.modeldefinition.Utils$instantiateDescribable$6.callStatic(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:56)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:194)
    at org.kohsuke.groovy.sandbox.impl.Checker$2.call(Checker.java:188)
    at org.kohsuke.groovy.sandbox.GroovyInterceptor.onStaticCall(GroovyInterceptor.java:35)
    at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onStaticCall(SandboxInterceptor.java:158)
    at org.kohsuke.groovy.sandbox.impl.Checker$2.call(Checker.java:186)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedStaticCall(Checker.java:190)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:97)
    at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
    at WorkflowScript.run(WorkflowScript)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.instancesFromClosure(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:621)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateWhen(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:601)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:240)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inDeclarativeAgent(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:494)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inDeclarativeAgent(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:493)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:239)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.stageInput(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:304)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.stageInput(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:303)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:217)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inWrappers(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:521)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inWrappers(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:520)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:200)
    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.GeneratedMethodAccessor238.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.GeneratedMethodAccessor241.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 jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
    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:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
someburner commented 6 years ago

Thanks @danielfm for your comment- wouldn't have thought to try alternative keywords. I can confirm it's only with branch. FYI- here's a workaround for anyone else in this situation:

            when {
                expression {
                   env.BRANCH_NAME.toString().equals('master') || env.BRANCH_NAME.toString().equals('develop')
                }
            }

They really need to beef up the documentation on these. For more usage examples using when/expression, see here

KostyaSha commented 6 years ago

And this https://jitpack.io/com/github/KostyaSha/github-integration-plugin/github-pullrequest/bypassBuggyPipeline-0.2.0-rc-1-gc0a8ff4-6/github-pullrequest-bypassBuggyPipeline-0.2.0-rc-1-gc0a8ff4-6.hpi ?

someburner commented 6 years ago

@KostyaSha I dont have experience debugging jenkins plugins, but willing to help out with testing. Do I need to uninstall current plugin first or just upload that directly and it will overwrite?

KostyaSha commented 6 years ago

yes, upload this hpi into your jenkins plugin manager, for rollback it will provide "downgrade" button new plugin version.

someburner commented 6 years ago

@KostyaSha Seems like that may have done the trick. I reverted my workarounds and re-introduced branch on 2 repos. both seem to be building like normal again.

KostyaSha commented 6 years ago

that mean that symbols has conflicts where they shouldn't @jglick CC

someburner commented 6 years ago

@KostyaSha props to you for debugging when not your fault! And yeah that would make sense since the issue only cropped up after updating other plugins. FYI this is jenkins 2.27

danielfm commented 6 years ago

Also tested the new .hpi with one of my jobs, and it worked. 🎉

KostyaSha commented 6 years ago

Filled https://issues.jenkins-ci.org/browse/JENKINS-51947

bencovi commented 6 years ago

Hey there, thanks for the fix - does 0.2.1 include the workaround?

KostyaSha commented 6 years ago

https://github.com/KostyaSha/github-integration-plugin/commits/master and 0.2.0 also

voodoo144 commented 6 years ago

in latest version it is not fixed yet, still cant use branch and tag keywords inside the pipeline.

jglick commented 5 years ago

Sorry, I have no context for this. If you think there is a bug in structs, please file it with steps to reproduce.

KostyaSha commented 5 years ago

Sounds like declarative or whatever else doesn't keep ExtensionPoint scope. Because of it every plugin should use unique symbols. One more jenkins disaster design if i correctly understood. So now i can only break existing configurations and replace symbols with prefixes. This is especially funny because duplicated functionality was implemented in cb plugins after this functionality was here, but symbols were added earlier.

dsiebel commented 5 years ago

To whomever else stumbles upon this trying to figure how to get their when condition working: There is a way to work around it that worked for me at least. Instead of

when { tag "release-*" }

use

 when { tag pattern: "release-\\d+", comparator: "REGEXP"}

source: https://jenkins.io/doc/book/pipeline/syntax/#when

sczerwinski commented 5 years ago

If anyone has this problem again, after using the workaround provided by @dsiebel, I got this error:

java.lang.ClassCastException: org.jenkinsci.plugins.pipeline.modeldefinition.when.impl.AnyOfConditional.children
expects org.jenkinsci.plugins.pipeline.modeldefinition.when.DeclarativeStageConditional<? extends org.jenkinsci.plugins.pipeline.modeldefinition.when.DeclarativeStageConditional>
but received class com.github.kostyasha.github.integration.multibranch.handler.GitHubTagHandler

But this worked for me:

when { buildingTag() }

instead of:

when { tag '*' }
KostyaSha commented 5 years ago

So symbols must be unique :(

cristianrat commented 5 years ago

To whomever else stumbles upon this trying to figure how to get their when condition working: There is a way to work around it that worked for me at least. Instead of

when { tag "release-*" }

use

 when { tag pattern: "release-\\d+", comparator: "REGEXP"}

source: https://jenkins.io/doc/book/pipeline/syntax/#when

can confirm it works

robbienohra commented 2 years ago

Any update on this?

I understand that the REGEX workaround is available, but is that the intended long-term solution?

KostyaSha commented 2 years ago

@Symbols doesn't follow domain like it's described in it's API, so it not a plugin bug