How to Manually Clear Locks in Jenkins


Recently I got into a situation where I hit a bug with Jenkins where Jenkinsfile locks were not released if the job was terminated.

I tried:

  • Restarting Jenkins
  • Reinstalling the plugin
  • Removing the locks manually from the top level Jenkins page
  • Raising a bug

None of these worked.

I found a solution that involved manually hacking files.


  1. Find the file named:

    In the /var/jenkins_home​ folder (or wherever Jenkins is installed).

    It will look like this:


  2. <org.jenkins.plugins.lockableresources.LockableResource>

    Remove the line in bold containing the buildExternalizableId attribute.

  3. Change the queuingStarted item



  4. Restart Jenkins

Author is currently working on the second edition of Docker in Practice 

Get 39% off with the code: 39miell2

5 thoughts on “How to Manually Clear Locks in Jenkins

Leave a Reply to zwischenzugs Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.