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

Jenkins pipeline lock mechanism is throwing null pointer exceptions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • pipeline
    • None
    • Jenkins ver. 2.157

      I am getting this null pointer exception and the lock is not getting freed, it was working correctly for a long and suddenly started to throw this exceptions

       

      // code placeholder
      stage('Deploy to iDev') {
          steps {
              lock(resource: "$DEV_LOCK", inversePrecedence: true) {
                  script {
                     .
                      .
                      .
                  }
              }
          }
      }
      

       Below is the exception thrown:

       

      {{}}

      java.lang.NullPointerException at org.jenkins.plugins.lockableresources.LockableResourcesManager.freeResources(LockableResourcesManager.java:323) at org.jenkins.plugins.lockableresources.LockableResourcesManager.unlockNames(LockableResourcesManager.java:367) at org.jenkins.plugins.lockableresources.LockStepExecution$Callback.finished(LockStepExecution.java:125) at org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback$TailCall.onSuccess(BodyExecutionCallback.java:114) at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$SuccessAdapter.receive(CpsBodyExecution.java:368) at com.cloudbees.groovy.cps.Outcome.resumeFrom(Outcome.java:73)

      {{}}

       

            Unassigned Unassigned
            rgowdatmx rahul gowda
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: