jenkinsci / jenkinsci/workflow-aggregator-plugin

[JENKINS-56242] Jenkins pipeline lock mechanism is throwing null pointer exceptions

Open
#952 0 comments 0 reactions 0 assignees View on GitHub
component:pipeline imported-jira-issue priority:critical resolution:unresolved
Dominant language
No language data
Stars
225
Forks
125
PR merge metrics
No merged PRs in 30d

Description

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)
```

{{}}

 

---
Originally reported by rgowdatmx, imported from: Jenkins pipeline lock mechanism is throwing null pointer exceptions


  • status: Open
  • priority: Critical
  • component(s): pipeline
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 2025-12-08

Raw content of original issue

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)


{{}}

 

  • environment: Jenkins ver. 2.157

Contributor guide

Open the contributing guide

Research direction

Start by inspecting LockableResourcesManager.java at lines 323 and 367, then follow the cleanup callback at LockStepExecution.java:125. Reproduce the supplied pipeline lock scenario and determine what causes the null pointer; done means the exception no longer occurs and the lock is freed correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.