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

NPE from SymbolLookup after job-dsl update without configuration-as-code

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • job-dsl 1.74

      I update job-dsl-plugin to 1.73

      My pipeline job with

       

      withCredentials([file(credentialsId: 'gcp-credential.json', variable: 'MY_CREDENTIAL')]) {
       // ...
      }

       

      failed with this trace:

       

      java.lang.NullPointerException
      	at org.jenkinsci.plugins.structs.SymbolLookup.findDescriptor(SymbolLookup.java:147)
      	at org.jenkinsci.plugins.workflow.steps.StepDescriptor.metaStepsOf(StepDescriptor.java:316)
      	at org.jenkinsci.plugins.workflow.cps.DSL.invokeDescribable(DSL.java:322)
      	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:179)
      	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)
      	at sun.reflect.GeneratedMethodAccessor517.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:158)
      	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
      	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:157)
      	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:142)
      	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:156)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:160)
      	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
      	at WorkflowScript.getGoogleCredentialsObject(WorkflowScript:162)
      	at WorkflowScript.run(WorkflowScript:35)
      	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.GeneratedMethodAccessor288.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.GeneratedMethodAccessor287.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:129)
      	at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268)
      	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
      	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:347)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$200(CpsThreadGroup.java:93)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:259)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:247)
      	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)
      

       

      After rollback to job-dsl-plugins 1.72, pipeline job work fine (I extract Environment information from this)

      I don't know what is changing and causing it between the two versions.

          [JENKINS-57218] NPE from SymbolLookup after job-dsl update without configuration-as-code

          Omit Rathore added a comment -

          I second that , it is a blocker for some teams , please look into this issue as soon as possible , we are unable to upgrade based on security advisory recommendations because of this issue.

          Omit Rathore added a comment - I second that , it is a blocker for some teams , please look into this issue as soon as possible , we are unable to upgrade based on security advisory recommendations because of this issue.

          Why should the Pipeline DSL pick the Job DSL FromFileScriptSource in this case? Shouldn't symbols have their descriptor type as namespace? This looks like a Pipeline problem to me.

          Daniel Spilker added a comment - Why should the Pipeline DSL pick the Job DSL FromFileScriptSource in this case? Shouldn't symbols have their descriptor type as namespace? This looks like a Pipeline problem to me.

          Andrew Bayer added a comment -

          Normally it does scope the symbols - I wonder if this is something to do with withCredentials taking a list somehow messing with the resolution?

          Andrew Bayer added a comment - Normally it does scope the symbols - I wonder if this is something to do with withCredentials taking a list somehow messing with the resolution?

          Andrew Bayer added a comment -

          cc jglick to see if anything jumps out for him.

          Andrew Bayer added a comment - cc jglick to see if anything jumps out for him.

          Jesse Glick added a comment -

          I have no idea offhand. Is there a minimal, self-contained, reproducible test case?

          Jesse Glick added a comment - I have no idea offhand. Is there a minimal, self-contained, reproducible test case?

          Jesse Glick added a comment -

          FromFileScriptSource.DescriptorImpl does have an @Extension. Ah but it has an optional dependency on configuration-as-code yet fails to use @Extension(optional = true); I have in fact noticed tons of errors printed during startup from this job-dsl update.

          Jesse Glick added a comment - FromFileScriptSource.DescriptorImpl does have an @Extension . Ah but it has an optional dependency on configuration-as-code yet fails to use @Extension(optional = true) ; I have in fact noticed tons of errors printed during startup from this job-dsl update.

          Jesse Glick added a comment -

          I filed structs #45 for robustness, without a test case so far, though I suspect the root problem is a broken optional dependency. If true, the workaround would be simple: install the Configuration as Code plugin.

          Jesse Glick added a comment - I filed structs #45 for robustness, without a test case so far, though I suspect the root problem is a broken optional dependency. If true, the workaround would be simple: install the Configuration as Code plugin.

          Jesse Glick added a comment -

          Another case of JENKINS-19508: do not use optional dependencies unless you are sure you know what you are doing and have carefully tested all plugin scenarios with the dependency missing (or disabled).

          Jesse Glick added a comment - Another case of JENKINS-19508 : do not use optional dependencies unless you are sure you know what you are doing and have carefully tested all plugin scenarios with the dependency missing (or disabled).

          Jesse Glick added a comment -

          fails to use @Extension(optional = true)

          That is still a bug in job-dsl; nonetheless, the current code in structs would still break even if that were added, due to the weird Guice hacks. My patch should fix it in either case.

          Jesse Glick added a comment - fails to use @Extension(optional = true) That is still a bug in job-dsl ; nonetheless, the current code in structs would still break even if that were added, due to the weird Guice hacks. My patch should fix it in either case.

          Jesse Glick added a comment -

          Reopening unless there was some fix in job-dsl I did not see.

          Jesse Glick added a comment - Reopening unless there was some fix in job-dsl I did not see.

          Ivan Dimitrov added a comment -

          I can confirm that the issue still exists.

          Ivan Dimitrov added a comment - I can confirm that the issue still exists.

          Jesse Glick added a comment -

          dobber update the Structs plugin

          Jesse Glick added a comment - dobber update the Structs plugin

          Hello, today, with this plugins list, my pipeline work fine.

          +++ install configuration-as-code
          +++ install configuration-as-code-groovy
          +++ update this latest version

           

          ace-editor: 1.1
          ansible: 1.0
          ansicolor: 0.6.2
          ant: 1.9
          antisamy-markup-formatter: 1.5
          apache-httpcomponents-client-4-api: 4.5.5-3.0
          authentication-tokens: 1.3
          blueocean-autofavorite: 1.2.4
          blueocean-bitbucket-pipeline: 1.16.0
          blueocean-commons: 1.16.0
          blueocean-config: 1.16.0
          blueocean-core-js: 1.16.0
          blueocean-dashboard: 1.16.0
          blueocean-display-url: 2.2.0
          blueocean-events: 1.16.0
          blueocean-executor-info: 1.16.0
          blueocean-git-pipeline: 1.16.0
          blueocean-github-pipeline: 1.16.0
          blueocean-i18n: 1.16.0
          blueocean-jira: 1.16.0
          blueocean-jwt: 1.16.0
          blueocean-personalization: 1.16.0
          blueocean-pipeline-api-impl: 1.16.0
          blueocean-pipeline-editor: 1.16.0
          blueocean-pipeline-scm-api: 1.16.0
          blueocean-rest-impl: 1.16.0
          blueocean-rest: 1.16.0
          blueocean-web: 1.16.0
          blueocean: 1.16.0
          bouncycastle-api: 2.17
          branch-api: 2.4.0
          build-timeout: 1.19
          cloudbees-bitbucket-branch-source: 2.4.4
          cloudbees-folder: 6.8
          command-launcher: 1.3
          config-file-provider: 3.6
          configuration-as-code-groovy: 1.1
          configuration-as-code-support: 1.13
          configuration-as-code: 1.13
          credentials-binding: 1.18
          credentials: 2.1.18
          display-url-api: 2.3.1
          docker-commons: 1.14
          docker-workflow: 1.18
          durable-task: 1.29
          email-ext: 2.66
          emailext-template: 1.1
          favorite: 2.3.2
          git-client: 2.7.7
          git-server: 1.7
          git: 3.10.0
          github-api: 1.95
          github-branch-source: 2.5.1
          github: 1.29.4
          google-admin-sdk: 1.2.2
          google-compute-engine: 3.1.1
          google-container-registry-auth: 0.3
          google-login: 1.4
          google-metadata-plugin: 0.2
          google-oauth-plugin: 0.8
          google-storage-plugin: 1.2
          gradle: 1.31
          handlebars: 1.1.1
          handy-uri-templates-2-api: 2.1.7-1.0
          htmlpublisher: 1.18
          jackson2-api: 2.9.8
          jdk-tool: 1.2
          jenkins-design-language: 1.16.0
          jira: 3.0.7
          job-dsl: 1.74
          jquery-detached: 1.2.1
          jsch: 0.1.55
          junit: 1.27
          ldap: 1.20
          lockable-resources: 2.5
          mailer: 1.23
          mapdb-api: 1.0.9.0
          matrix-auth: 2.4.2
          matrix-project: 1.14
          mercurial: 2.6
          momentjs: 1.1.1
          nexus-artifact-uploader: 2.10
          nexus-jenkins-plugin: 3.5.20190425-152158.c63841b
          oauth-credentials: 0.3
          pam-auth: 1.5
          pipeline-build-step: 2.9
          pipeline-github-lib: 1.0
          pipeline-graph-analysis: 1.9
          pipeline-input-step: 2.10
          pipeline-maven: 3.6.11
          pipeline-milestone-step: 1.3.1
          pipeline-model-api: 1.3.8
          pipeline-model-declarative-agent: 1.1.1
          pipeline-model-definition: 1.3.8
          pipeline-model-extensions: 1.3.8
          pipeline-multibranch-defaults: 2.0
          pipeline-rest-api: 2.11
          pipeline-stage-step: 2.3
          pipeline-stage-tags-metadata: 1.3.8
          pipeline-stage-view: 2.11
          pipeline-utility-steps: 2.3.0
          plain-credentials: 1.5
          pubsub-light: 1.12
          resource-disposer: 0.12
          scm-api: 2.4.1
          script-security: 1.58
          simple-theme-plugin: 0.5.1
          sonar: 2.8.1
          sse-gateway: 1.17
          ssh-credentials: 1.16
          ssh-slaves: 1.29.4
          ssh-steps: 1.2.1
          structs: 1.19
          subversion: 2.12.1
          timestamper: 1.9
          token-macro: 2.7
          trilead-api: 1.0.3
          variant: 1.2
          windows-slaves: 1.4
          workflow-aggregator: 2.6
          workflow-api: 2.33
          workflow-basic-steps: 2.15
          workflow-cps-global-lib: 2.13
          workflow-cps: 2.67
          workflow-durable-task-step: 2.30
          workflow-job: 2.32
          workflow-multibranch: 2.21
          workflow-scm-step: 2.7
          workflow-step-api: 2.19
          workflow-support: 3.3
          ws-cleanup: 0.37
          xml-job-to-job-dsl: 0.1.10

          Gwenael Pellen added a comment - Hello, today, with this plugins list, my pipeline work fine. +++ install configuration-as-code +++ install configuration-as-code-groovy +++ update this latest version   ace-editor: 1.1 ansible: 1.0 ansicolor: 0.6.2 ant: 1.9 antisamy-markup-formatter: 1.5 apache-httpcomponents-client-4-api: 4.5.5-3.0 authentication-tokens: 1.3 blueocean-autofavorite: 1.2.4 blueocean-bitbucket-pipeline: 1.16.0 blueocean-commons: 1.16.0 blueocean-config: 1.16.0 blueocean-core-js: 1.16.0 blueocean-dashboard: 1.16.0 blueocean-display-url: 2.2.0 blueocean-events: 1.16.0 blueocean-executor-info: 1.16.0 blueocean-git-pipeline: 1.16.0 blueocean-github-pipeline: 1.16.0 blueocean-i18n: 1.16.0 blueocean-jira: 1.16.0 blueocean-jwt: 1.16.0 blueocean-personalization: 1.16.0 blueocean-pipeline-api-impl: 1.16.0 blueocean-pipeline-editor: 1.16.0 blueocean-pipeline-scm-api: 1.16.0 blueocean-rest-impl: 1.16.0 blueocean-rest: 1.16.0 blueocean-web: 1.16.0 blueocean: 1.16.0 bouncycastle-api: 2.17 branch-api: 2.4.0 build-timeout: 1.19 cloudbees-bitbucket-branch-source: 2.4.4 cloudbees-folder: 6.8 command-launcher: 1.3 config-file-provider: 3.6 configuration-as-code-groovy: 1.1 configuration-as-code-support: 1.13 configuration-as-code: 1.13 credentials-binding: 1.18 credentials: 2.1.18 display-url-api: 2.3.1 docker-commons: 1.14 docker-workflow: 1.18 durable-task: 1.29 email-ext: 2.66 emailext-template: 1.1 favorite: 2.3.2 git-client: 2.7.7 git-server: 1.7 git: 3.10.0 github-api: 1.95 github-branch-source: 2.5.1 github: 1.29.4 google-admin-sdk: 1.2.2 google-compute-engine: 3.1.1 google-container-registry-auth: 0.3 google-login: 1.4 google-metadata-plugin: 0.2 google-oauth-plugin: 0.8 google-storage-plugin: 1.2 gradle: 1.31 handlebars: 1.1.1 handy-uri-templates-2-api: 2.1.7-1.0 htmlpublisher: 1.18 jackson2-api: 2.9.8 jdk-tool: 1.2 jenkins-design-language: 1.16.0 jira: 3.0.7 job-dsl: 1.74 jquery-detached: 1.2.1 jsch: 0.1.55 junit: 1.27 ldap: 1.20 lockable-resources: 2.5 mailer: 1.23 mapdb-api: 1.0.9.0 matrix-auth: 2.4.2 matrix-project: 1.14 mercurial: 2.6 momentjs: 1.1.1 nexus-artifact-uploader: 2.10 nexus-jenkins-plugin: 3.5.20190425-152158.c63841b oauth-credentials: 0.3 pam-auth: 1.5 pipeline-build-step: 2.9 pipeline-github-lib: 1.0 pipeline-graph-analysis: 1.9 pipeline-input-step: 2.10 pipeline-maven: 3.6.11 pipeline-milestone-step: 1.3.1 pipeline-model-api: 1.3.8 pipeline-model-declarative-agent: 1.1.1 pipeline-model-definition: 1.3.8 pipeline-model-extensions: 1.3.8 pipeline-multibranch-defaults: 2.0 pipeline-rest-api: 2.11 pipeline-stage-step: 2.3 pipeline-stage-tags-metadata: 1.3.8 pipeline-stage-view: 2.11 pipeline-utility-steps: 2.3.0 plain-credentials: 1.5 pubsub-light: 1.12 resource-disposer: 0.12 scm-api: 2.4.1 script-security: 1.58 simple-theme-plugin: 0.5.1 sonar: 2.8.1 sse-gateway: 1.17 ssh-credentials: 1.16 ssh-slaves: 1.29.4 ssh-steps: 1.2.1 structs: 1.19 subversion: 2.12.1 timestamper: 1.9 token-macro: 2.7 trilead-api: 1.0.3 variant: 1.2 windows-slaves: 1.4 workflow-aggregator: 2.6 workflow-api: 2.33 workflow-basic-steps: 2.15 workflow-cps-global-lib: 2.13 workflow-cps: 2.67 workflow-durable-task-step: 2.30 workflow-job: 2.32 workflow-multibranch: 2.21 workflow-scm-step: 2.7 workflow-step-api: 2.19 workflow-support: 3.3 ws-cleanup: 0.37 xml-job-to-job-dsl: 0.1.10

          Today update, plus install configure-as-code, pipeline works.

          Gwenael Pellen added a comment - Today update, plus install configure-as-code, pipeline works.

          Jesse Glick added a comment -

          Yes the defensiveness in structs was released. There is still a misuse of an optional dependency in job-dsl.

          Jesse Glick added a comment - Yes the defensiveness in structs was released. There is still a misuse of an optional dependency in job-dsl .

          jglick jobdsl #1175 should hopefully fix it unless you are referring to another issue.

          Joseph Petersen (old) added a comment - jglick jobdsl #1175 should hopefully fix it unless you are referring to another issue.

          Jesse Glick added a comment -

          OK, thanks for update!

          Jesse Glick added a comment - OK, thanks for update!

            daspilker Daniel Spilker
            gwenaelpellenarkeup Gwenael Pellen
            Votes:
            3 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: