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

NullPointerException when using parameter separator in a pipeline

    Details

    • Type: Bug
    • Status: Fixed but Unreleased (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Jenkins 2.32.2
      Pipeline 2.5
      Pipeline Groovy 2.25
      Parameter Separator 1.0
    • Similar Issues:

      Description

      Using the parameter separator plug-in in a pipeline job will throw a NullPointerException when accessing global variable "params"

      java.lang.NullPointerException
      	at org.jenkinsci.plugins.workflow.cps.persistence.IteratorHack.writeReplace(IteratorHack.java:52)
      	at org.jenkinsci.plugins.workflow.cps.ParamsVariable.addValue(ParamsVariable.java:88)
      	at org.jenkinsci.plugins.workflow.cps.ParamsVariable.getValue(ParamsVariable.java:66)
      	at org.jenkinsci.plugins.workflow.cps.CpsScript.getProperty(CpsScript.java:121)
      	at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:172)
      	at groovy.lang.Closure.getPropertyTryThese(Closure.java:312)
      	at groovy.lang.Closure.getPropertyOwnerFirst(Closure.java:306)
      	at groovy.lang.Closure.getProperty(Closure.java:295)
      	at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:172)
      	at groovy.lang.Closure.getPropertyTryThese(Closure.java:312)
      	at groovy.lang.Closure.getPropertyOwnerFirst(Closure.java:306)
      	at groovy.lang.Closure.getProperty(Closure.java:295)
      	at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:172)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:456)
      	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.getProperty(DefaultInvoker.java:33)
      	at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
      	at Script2.run(Script2.groovy:178)
      	at ___cps.transform___(Native Method)
      	at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:74)
      	at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
      	at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:66)
      	at sun.reflect.GeneratedMethodAccessor463.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      	at java.lang.reflect.Method.invoke(Unknown Source)
      	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:74)
      	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
      	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:163)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:328)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:80)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:240)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:228)
      	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:63)
      	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      	at java.util.concurrent.FutureTask.run(Unknown Source)
      	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
      	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      	at java.util.concurrent.FutureTask.run(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      	at java.lang.Thread.run(Unknown Source)
      

        Attachments

          Issue Links

            Activity

            gordin Christoph Vogtländer created issue -
            abayer Andrew Bayer made changes -
            Field Original Value New Value
            Component/s workflow-cps-plugin [ 21713 ]
            Component/s pipeline [ 21692 ]
            Hide
            jglick Jesse Glick added a comment -

            ParamsVariable.addValue should treat null as Serializable. But I think it is also a bug in parameter-separator; ParameterValue.getValue should not return null AFAIK.

            Show
            jglick Jesse Glick added a comment - ParamsVariable.addValue should treat null as Serializable . But I think it is also a bug in parameter-separator ; ParameterValue.getValue should not return null AFAIK.
            heikkisi Heikki Simperi made changes -
            Priority Minor [ 4 ] Major [ 3 ]
            heikkisi Heikki Simperi made changes -
            Comment [ Same problem after Jenkins 2.46->2.48 with plugin update to newest.

            Jenkins 2.48
            Pipeline 2.5
            Pipeline Groovy 2.28
            no Parameter Separator installed.

            {code}
            java.lang.NullPointerException
            at org.jenkinsci.plugins.workflow.cps.persistence.IteratorHack.writeReplace(IteratorHack.java:52)
            at org.jenkinsci.plugins.workflow.cps.ParamsVariable.addValue(ParamsVariable.java:88)
            at org.jenkinsci.plugins.workflow.cps.ParamsVariable.getValue(ParamsVariable.java:66)
            at org.jenkinsci.plugins.workflow.cps.CpsScript.getProperty(CpsScript.java:121)
            at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:174)
            at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:456)
            at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:243)
            at org.kohsuke.groovy.sandbox.GroovyInterceptor.onGetProperty(GroovyInterceptor.java:52)
            at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:308)
            at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:241)
            at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:238)
            at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:28)
            at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
            at Script1.checkParameters(Script1.groovy:469)
            at Script1.runPipeline(Script1.groovy:84)
            at ___cps.transform___(Native Method)
            at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:74)
            at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
            at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:66)
            at sun.reflect.GeneratedMethodAccessor467.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:497)
            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:74)
            at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
            at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
            at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33)
            at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30)
            at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
            at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30)
            at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:165)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:328)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:80)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:240)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:228)
            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:112)
            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:745)
            {code} ]
            heikkisi Heikki Simperi made changes -
            Priority Major [ 3 ] Minor [ 4 ]
            heikkisi Heikki Simperi made changes -
            Link This issue relates to JENKINS-42367 [ JENKINS-42367 ]
            jglick Jesse Glick made changes -
            Component/s workflow-cps-plugin [ 21713 ]
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Michael Chmielewski
            Path:
            src/main/java/jenkins/plugins/parameter_separator/ParameterSeparatorValue.java
            http://jenkins-ci.org/commit/parameter-separator-plugin/2b292f47c45b6ca32b413ed63a5daa0816cefd16
            Log:
            JENKINS-41712: Overriding getValue()

            Based on bug, we should not return null, so we are returning toString() result instead.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michael Chmielewski Path: src/main/java/jenkins/plugins/parameter_separator/ParameterSeparatorValue.java http://jenkins-ci.org/commit/parameter-separator-plugin/2b292f47c45b6ca32b413ed63a5daa0816cefd16 Log: JENKINS-41712 : Overriding getValue() Based on bug, we should not return null, so we are returning toString() result instead.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Michael Chmielewski
            Path:
            src/main/java/jenkins/plugins/parameter_separator/ParameterSeparatorValue.java
            http://jenkins-ci.org/commit/parameter-separator-plugin/c2636df5d9cebf80fa2feffa63432560ef7b9825
            Log:
            JENKINS-41712: Update getvalue( ) to return String

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michael Chmielewski Path: src/main/java/jenkins/plugins/parameter_separator/ParameterSeparatorValue.java http://jenkins-ci.org/commit/parameter-separator-plugin/c2636df5d9cebf80fa2feffa63432560ef7b9825 Log: JENKINS-41712 : Update getvalue( ) to return String
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Michael Chmielewski
            Path:
            src/main/java/jenkins/plugins/parameter_separator/ParameterSeparatorValue.java
            http://jenkins-ci.org/commit/parameter-separator-plugin/2868e5feabac8955457cba16966ad66b75b5cc80
            Log:
            JENKINS-41712: Do not force @override

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michael Chmielewski Path: src/main/java/jenkins/plugins/parameter_separator/ParameterSeparatorValue.java http://jenkins-ci.org/commit/parameter-separator-plugin/2868e5feabac8955457cba16966ad66b75b5cc80 Log: JENKINS-41712 : Do not force @override
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Michael Chmielewski
            Path:
            src/main/java/jenkins/plugins/parameter_separator/ParameterSeparatorValue.java
            http://jenkins-ci.org/commit/parameter-separator-plugin/afd2131ebbb8587dc671dd0f03fb36115c9ace20
            Log:
            JENKINS-41712: Remove annotation

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michael Chmielewski Path: src/main/java/jenkins/plugins/parameter_separator/ParameterSeparatorValue.java http://jenkins-ci.org/commit/parameter-separator-plugin/afd2131ebbb8587dc671dd0f03fb36115c9ace20 Log: JENKINS-41712 : Remove annotation
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Michael Chmielewski
            Path:
            src/main/java/jenkins/plugins/parameter_separator/ParameterSeparatorValue.java
            http://jenkins-ci.org/commit/parameter-separator-plugin/560ec98eb47aac44e9e68dc665a8ad9ca8e9a932
            Log:
            JENKINS-41712: Overriding getValue() (#6)

            Based on bug, we should not return null, so we are returning toString() result instead.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michael Chmielewski Path: src/main/java/jenkins/plugins/parameter_separator/ParameterSeparatorValue.java http://jenkins-ci.org/commit/parameter-separator-plugin/560ec98eb47aac44e9e68dc665a8ad9ca8e9a932 Log: JENKINS-41712 : Overriding getValue() (#6) JENKINS-41712 : Overriding getValue() Based on bug, we should not return null, so we are returning toString() result instead. JENKINS-41712 : Update getvalue( ) to return String JENKINS-41712 : Do not force @override JENKINS-41712 : Remove annotation
            olhado22 Mike Chmielewski made changes -
            Status Open [ 1 ] Fixed but Unreleased [ 10203 ]
            Resolution Fixed [ 1 ]

              People

              • Assignee:
                Unassigned
                Reporter:
                gordin Christoph Vogtländer
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: