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

Jenkins Build fails with “java.lang.NullPointerException”

    Details

    • Similar Issues:

      Description

       
      We have integrated Jenkins with Github to build jobs as and when PR is raised with the github pull request builder plugin.
      From yesterday when the job gets triggered we are seeing this failure "java.lang.NullPointerException" even before the pipeline starts to execute and the job reports the status to github as failed. Also in the console there is a log that mentions "Resuming build after jenkins restart" but there was no restart at the time when this job was triggered

      But in a little while the job starts executing and then passed the build again in jenkins?

      This happens often if we retrigger the job but not always!!!

      Any idea on why this is happening

       

      Jenkins Console:
      Resuming build at Thu May 09 16:30:11 UTC 2019 after Jenkins restart [Pipeline] End of Pipeline Setting status of b9d1bd39cfae59d607b1a8060f2a8ae2fc180a1e to FAILURE with url https://JENKINS_URL/job/JOB_NAME/103/ and message: 'Build finished. ' java.lang.NullPointerException Finished: FAILURE
       

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment -

          There aren't enough instructions for me to duplicate the problem and the null pointer exception stack trace is not included. Please check the Jenkins log and other locations to see if you can find the full stack trace.

          Show
          markewaite Mark Waite added a comment - There aren't enough instructions for me to duplicate the problem and the null pointer exception stack trace is not included. Please check the Jenkins log and other locations to see if you can find the full stack trace.
          Hide
          adharsh Adharsh M added a comment -

          Jenkins Log has the following entry :

           

          WARNING: Unexpected exception in CPS VM thread: CpsFlowExecution[Ownerprestaging-falcon-unit-integration-acceptance-tests-frontend-pullrequest-pipeline-1/9470:[prestaging-falcon-unit-integration-acceptance-tests-frontend-pullrequest-pipeline-1] #9470]
          java.lang.NullPointerException

          May 09, 2019 4:03:41 AM org.jenkinsci.plugins.workflow.job.WorkflowRun copyLogs
          WARNING: no such node 3
          May 09, 2019 4:03:41 AM org.jenkinsci.plugins.workflow.job.WorkflowRun copyLogs
          WARNING: no such node 47
          May 09, 2019 4:03:41 AM org.jenkinsci.plugins.workflow.job.WorkflowRun finish
          INFO: prestaging-falcon-unit-integration-acceptance-tests-frontend-pullrequest-pipeline-1 #9470 completed: FAILURE
          May 09, 2019 4:03:42 AM org.jenkinsci.plugins.workflow.job.WorkflowRun finish
          INFO: prestaging-falcon-unit-integration-acceptance-tests-frontend-pullrequest-pipeline-1 #9470 completed: SUCCESS
          May 09, 2019 4:03:43 AM org.jenkinsci.plugins.workflow.flow.FlowExecutionList unregister
          WARNING: Ownerprestaging-falcon-unit-integration-acceptance-tests-frontend-pullrequest-pipeline-1/9470:prestaging-falcon-unit-integration-acceptance-tests-frontend-pullrequest-pipeline-1 #9470 was not in the list to begin with: [Ownerprestaging-falcon-unit-integration-acceptance-tests-backend-pullrequest-pipeline/15804:prestaging-falcon-unit-integration-acceptance-tests-backend-pullrequest-pipeline #15804, Ownerprestaging-falcon-unit-integration-acceptance-tests-backend-pullrequest-pipeline/15805:prestaging-falcon-unit-integration-acceptance-tests-backend-pullrequest-pipeline #15805, Ownerprestaging-falcon-unit-integration-acceptance-tests-backend-pullrequest-pipeline/15809:prestaging-falcon-unit-integration-acceptance-tests-backend-pullrequest-pipeline #15809, Ownerprestaging-falcon-unit-integration-acceptance-tests-frontend-pullrequest-pipeline-1/9471:prestaging-falcon-unit-integration-acceptance-tests-frontend-pullrequest-pipeline-1 #9471, Ownerprestaging-falcon-unit-integration-acceptance-tests-frontend-pullrequest-pipeline-1/9472:prestaging-falcon-unit-integration-acceptance-tests-frontend-pullrequest-pipeline-1 #9472, Ownerprestaging-falcon-unit-integration-acceptance-tests-backend-pullrequest-pipeline/16124:prestaging-falcon-unit-integration-acceptance-tests-backend-pullrequest-pipeline #16124]
          May 09, 2019 4:03:51 AM org.jenkinsci.plugins.ghprb.GhprbRootAction handleAction

          Show
          adharsh Adharsh M added a comment - Jenkins Log has the following entry :   WARNING: Unexpected exception in CPS VM thread: CpsFlowExecution[Owner prestaging-falcon-unit-integration-acceptance-tests-frontend-pullrequest-pipeline-1/9470:[prestaging-falcon-unit-integration-acceptance-tests-frontend-pullrequest-pipeline-1] #9470 ] java.lang.NullPointerException May 09, 2019 4:03:41 AM org.jenkinsci.plugins.workflow.job.WorkflowRun copyLogs WARNING: no such node 3 May 09, 2019 4:03:41 AM org.jenkinsci.plugins.workflow.job.WorkflowRun copyLogs WARNING: no such node 47 May 09, 2019 4:03:41 AM org.jenkinsci.plugins.workflow.job.WorkflowRun finish INFO: prestaging-falcon-unit-integration-acceptance-tests-frontend-pullrequest-pipeline-1 #9470 completed: FAILURE May 09, 2019 4:03:42 AM org.jenkinsci.plugins.workflow.job.WorkflowRun finish INFO: prestaging-falcon-unit-integration-acceptance-tests-frontend-pullrequest-pipeline-1 #9470 completed: SUCCESS May 09, 2019 4:03:43 AM org.jenkinsci.plugins.workflow.flow.FlowExecutionList unregister WARNING: Owner prestaging-falcon-unit-integration-acceptance-tests-frontend-pullrequest-pipeline-1/9470:prestaging-falcon-unit-integration-acceptance-tests-frontend-pullrequest-pipeline-1 #9470 was not in the list to begin with: [Owner prestaging-falcon-unit-integration-acceptance-tests-backend-pullrequest-pipeline/15804:prestaging-falcon-unit-integration-acceptance-tests-backend-pullrequest-pipeline #15804 , Owner prestaging-falcon-unit-integration-acceptance-tests-backend-pullrequest-pipeline/15805:prestaging-falcon-unit-integration-acceptance-tests-backend-pullrequest-pipeline #15805 , Owner prestaging-falcon-unit-integration-acceptance-tests-backend-pullrequest-pipeline/15809:prestaging-falcon-unit-integration-acceptance-tests-backend-pullrequest-pipeline #15809 , Owner prestaging-falcon-unit-integration-acceptance-tests-frontend-pullrequest-pipeline-1/9471:prestaging-falcon-unit-integration-acceptance-tests-frontend-pullrequest-pipeline-1 #9471 , Owner prestaging-falcon-unit-integration-acceptance-tests-frontend-pullrequest-pipeline-1/9472:prestaging-falcon-unit-integration-acceptance-tests-frontend-pullrequest-pipeline-1 #9472 , Owner prestaging-falcon-unit-integration-acceptance-tests-backend-pullrequest-pipeline/16124:prestaging-falcon-unit-integration-acceptance-tests-backend-pullrequest-pipeline #16124 ] May 09, 2019 4:03:51 AM org.jenkinsci.plugins.ghprb.GhprbRootAction handleAction
          Hide
          adharsh Adharsh M added a comment -

          Let me know what else is needed

          Show
          adharsh Adharsh M added a comment - Let me know what else is needed
          Hide
          markewaite Mark Waite added a comment -

          We need either enough instructions to duplicate the problem or enough stack traces to identify the problem without duplicating it.

          Since the git plugin does not suppress exceptions, I'm reasonably confident that the issue is not in the git plugin. I suspect the exception is being thrown in the workflow CPS global lib plugin. That is the plugin which handles pipeline shared libraries. Have you made recent changes in the pipeline shared libraries that you are using? For example, if one of the shared libraries is causing a null pointer exception in its own code, that might cause the type of message you're seeing.

          I'll assign this to workflow-cps-global-lib plugin as a possible place for further investigation.

          Show
          markewaite Mark Waite added a comment - We need either enough instructions to duplicate the problem or enough stack traces to identify the problem without duplicating it. Since the git plugin does not suppress exceptions, I'm reasonably confident that the issue is not in the git plugin. I suspect the exception is being thrown in the workflow CPS global lib plugin. That is the plugin which handles pipeline shared libraries. Have you made recent changes in the pipeline shared libraries that you are using? For example, if one of the shared libraries is causing a null pointer exception in its own code, that might cause the type of message you're seeing. I'll assign this to workflow-cps-global-lib plugin as a possible place for further investigation.

            People

            • Assignee:
              Unassigned
              Reporter:
              adharsh Adharsh M
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: