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

Null pointer exception in milestone step after prep for shutdown and cancel

XMLWordPrintable

      The pipeline milestone plugin reported a null pointer exception in one of my jobs while I was alternating between "Prepare for shutdown" and "Cancel shutdown". The exception is in the build log and looks like this:

      [2021-03-24T17:31:09.813Z] Branch indexing
      [2021-03-24T17:31:09.956Z] Connecting to https://api.github.com using MarkEWaite/****** (MarkEWaite github token)
      [2021-03-24T17:31:10.719Z] Obtained Jenkinsfile from adea5231644899fe3c2d63297b86ace30e10023f
      [2021-03-24T17:31:10.719Z] Running in Durability level: PERFORMANCE_OPTIMIZED
      [2021-03-24T17:31:10.737Z] Loading library infra@my-own-master
      [2021-03-24T17:31:10.738Z] Attempting to resolve my-own-master from remote references...
      [2021-03-24T17:31:10.738Z]  > git --version # timeout=11
      [2021-03-24T17:31:10.802Z]  > git --version # 'git version 2.20.1'
      [2021-03-24T17:31:10.803Z] using GIT_ASKPASS to set credentials MarkEWaite github username/password
      [2021-03-24T17:31:10.803Z]  > git ls-remote -h -- https://github.com/MarkEWaite/pipeline-library # timeout=11
      [2021-03-24T17:31:11.183Z] Found match: refs/heads/my-own-master revision c59756fd3cc823528427390f6769bf04581bf8cf
      [2021-03-24T17:31:11.208Z] The recommended git tool is: NONE
      [2021-03-24T17:31:11.209Z] using credential MarkEWaite-github-username-password
      [2021-03-24T17:31:11.230Z] Cloning the remote Git repository
      [2021-03-24T17:31:11.230Z] Cloning with configured refspecs honoured and without tags
      [2021-03-24T17:31:11.230Z] Cloning repository https://github.com/MarkEWaite/pipeline-library
      [2021-03-24T17:31:11.230Z]  > git init /var/jenkins_home/workspace/_tests_install-latest-redhat-rpm@libs/infra # timeout=11
      [2021-03-24T17:31:11.263Z] Fetching upstream changes from https://github.com/MarkEWaite/pipeline-library
      [2021-03-24T17:31:11.263Z]  > git --version # timeout=11
      [2021-03-24T17:31:11.277Z]  > git --version # 'git version 2.20.1'
      [2021-03-24T17:31:11.277Z] using GIT_ASKPASS to set credentials MarkEWaite github username/password
      [2021-03-24T17:31:11.277Z]  > git fetch --no-tags --force --progress -- https://github.com/MarkEWaite/pipeline-library +refs/heads/*:refs/remotes/origin/* # timeout=11
      [2021-03-24T17:31:12.161Z]  > git config remote.origin.url https://github.com/MarkEWaite/pipeline-library # timeout=11
      [2021-03-24T17:31:12.195Z]  > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=11
      [2021-03-24T17:31:12.232Z] Avoid second fetch
      [2021-03-24T17:31:12.233Z] Checking out Revision c59756fd3cc823528427390f6769bf04581bf8cf (my-own-master)
      [2021-03-24T17:31:12.233Z]  > git config core.sparsecheckout # timeout=11
      [2021-03-24T17:31:12.251Z]  > git checkout -f c59756fd3cc823528427390f6769bf04581bf8cf # timeout=11
      [2021-03-24T17:31:12.276Z] Commit message: "Merge branch 'master' into my-own-master"
      [2021-03-24T17:31:12.887Z] [Pipeline] Start of Pipeline
      [2021-03-24T17:31:12.940Z] [Pipeline] milestone
      [2021-03-24T17:31:12.968Z] Trying to pass milestone 1
      [2021-03-24T17:31:12.973Z] [Pipeline] End of Pipeline
      [2021-03-24T17:31:13.347Z] 
      [2021-03-24T17:31:13.347Z] Could not update commit status, please check if your scan credentials belong to a member of the organization or a collaborator of the repository and repo:status scope is selected
      [2021-03-24T17:31:13.347Z] 
      [2021-03-24T17:31:13.347Z] 
      [2021-03-24T17:31:13.347Z] GitHub has been notified of this commit’s build result
      [2021-03-24T17:31:13.347Z] 
      [2021-03-24T17:31:13.430Z] java.lang.NullPointerException
      [2021-03-24T17:31:13.430Z] 	at org.jenkinsci.plugins.pipeline.milestone.MilestoneStepExecution.cleanUp(MilestoneStepExecution.java:304)
      [2021-03-24T17:31:13.430Z] 	at org.jenkinsci.plugins.pipeline.milestone.MilestoneStepExecution.tryToPass(MilestoneStepExecution.java:173)
      [2021-03-24T17:31:13.430Z] 	at org.jenkinsci.plugins.pipeline.milestone.MilestoneStepExecution.run(MilestoneStepExecution.java:80)
      [2021-03-24T17:31:13.430Z] 	at org.jenkinsci.plugins.pipeline.milestone.MilestoneStepExecution.run(MilestoneStepExecution.java:65)
      [2021-03-24T17:31:13.430Z] 	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:42)
      [2021-03-24T17:31:13.430Z] 	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:319)
      [2021-03-24T17:31:13.430Z] 	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:193)
      [2021-03-24T17:31:13.430Z] 	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)
      [2021-03-24T17:31:13.430Z] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [2021-03-24T17:31:13.430Z] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      [2021-03-24T17:31:13.430Z] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [2021-03-24T17:31:13.430Z] 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      [2021-03-24T17:31:13.430Z] 	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
      [2021-03-24T17:31:13.430Z] 	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      [2021-03-24T17:31:13.430Z] 	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
      [2021-03-24T17:31:13.430Z] 	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
      [2021-03-24T17:31:13.430Z] 	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
      [2021-03-24T17:31:13.430Z] 	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      [2021-03-24T17:31:13.430Z] 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
      [2021-03-24T17:31:13.430Z] 	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:163)
      [2021-03-24T17:31:13.430Z] 	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
      [2021-03-24T17:31:13.430Z] 	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:157)
      [2021-03-24T17:31:13.430Z] 	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:142)
      [2021-03-24T17:31:13.430Z] 	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:161)
      [2021-03-24T17:31:13.430Z] 	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:165)
      [2021-03-24T17:31:13.430Z] 	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
      [2021-03-24T17:31:13.430Z] 	at WorkflowScript.run(WorkflowScript:4)
      [2021-03-24T17:31:13.430Z] 	at ___cps.transform___(Native Method)
      [2021-03-24T17:31:13.430Z] 	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:86)
      [2021-03-24T17:31:13.430Z] 	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:113)
      [2021-03-24T17:31:13.430Z] 	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83)
      [2021-03-24T17:31:13.430Z] 	at jdk.internal.reflect.GeneratedMethodAccessor335.invoke(Unknown Source)
      [2021-03-24T17:31:13.430Z] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [2021-03-24T17:31:13.430Z] 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      [2021-03-24T17:31:13.430Z] 	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
      [2021-03-24T17:31:13.430Z] 	at com.cloudbees.groovy.cps.impl.LocalVariableBlock$LocalVariable.get(LocalVariableBlock.java:39)
      [2021-03-24T17:31:13.430Z] 	at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
      [2021-03-24T17:31:13.430Z] 	at com.cloudbees.groovy.cps.impl.LocalVariableBlock.evalLValue(LocalVariableBlock.java:28)
      [2021-03-24T17:31:13.430Z] 	at com.cloudbees.groovy.cps.LValueBlock$BlockImpl.eval(LValueBlock.java:55)
      [2021-03-24T17:31:13.430Z] 	at com.cloudbees.groovy.cps.LValueBlock.eval(LValueBlock.java:16)
      [2021-03-24T17:31:13.430Z] 	at com.cloudbees.groovy.cps.Next.step(Next.java:83)
      [2021-03-24T17:31:13.430Z] 	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
      [2021-03-24T17:31:13.430Z] 	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
      [2021-03-24T17:31:13.430Z] 	at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:129)
      [2021-03-24T17:31:13.430Z] 	at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268)
      [2021-03-24T17:31:13.430Z] 	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
      [2021-03-24T17:31:13.430Z] 	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
      [2021-03-24T17:31:13.430Z] 	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
      [2021-03-24T17:31:13.430Z] 	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
      [2021-03-24T17:31:13.430Z] 	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:400)
      [2021-03-24T17:31:13.430Z] 	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96)
      [2021-03-24T17:31:13.430Z] 	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:312)
      [2021-03-24T17:31:13.430Z] 	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:276)
      [2021-03-24T17:31:13.430Z] 	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
      [2021-03-24T17:31:13.430Z] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      [2021-03-24T17:31:13.430Z] 	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
      [2021-03-24T17:31:13.430Z] 	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      [2021-03-24T17:31:13.430Z] 	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
      [2021-03-24T17:31:13.430Z] 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      [2021-03-24T17:31:13.430Z] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      [2021-03-24T17:31:13.430Z] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      [2021-03-24T17:31:13.430Z] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      [2021-03-24T17:31:13.430Z] 	at java.base/java.lang.Thread.run(Thread.java:834)
      [2021-03-24T17:31:13.430Z] Finished: FAILURE
      

            Unassigned Unassigned
            markewaite Mark Waite
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: