[jenkins] Jenkins not executing jobs (pending - waiting for next executor)

Jenkins won't execute any jobs. Having viewed this question, I have disabled all slave nodes but a simple job won't even run on the Master node.

What is wrong?

This question is related to jenkins

The answer is


In my case it is similar to @Michael Easter: I got a problem in a job due to lack of disk space. I cleared some space, restarted Jenkins but still the problem persisted.

The solution was to go to Jenkins -> Manage Jenkins -> Manage Nodes and just Click on the button to update the status.


You may have milestones set up and your job won't run until the previous job is complete.


  • go to Jenkins -> Manage Jenkins -> Manage Nodes
  • examine the "master" node.(Click on configure icon)

In my case No of executors was set to 0. Increased it and issue got fixed.


In my case, I had the following set in my JenkinsFile

node('node'){ ... }

There was no node called 'node', only master (the value had been left in there after following some basic tutorials). Changing the value to 'master' got the build working.


Short answer: Kill all the jobs which are running on the master.

In my case there were 3 jobs hung on the master for more than 10 days which were unnoticed. We usually do not run any jobs directly on the master, everything is run on slaves. I killed these 3 jobs which were hung, automatically the executors on the slave started picking up jobs.

Point to note that even though we have 8 slaves only 1 slave was in this affected state.

[EDIT] We found the answer to why only one slave was in this affected state. When a Jenkins slave goes down, all the pending jobs automatically get transferred over to the master. All the 3 hung jobs which I killed were from this slave, so its likely a connection issue between the master and this particular slave.


What worked for me: I finally noticed the Build Executor Status window on the left on the main Jenkins dashboard. I run a dev/test instance on my local system with 2 executors. Both were currently occupied with builds that were not running. Upon cancelling these to jobs, my third (pending) job was able to run.


I ran into a similar problem because my master was set to " # of executor (The maximum number of concurrent builds that Jenkins may perform on this agent).

Go to Jenkins --> Manage Jenkins --> Manage Nodes, and click on the configure button of your master node (increase the number of executor to run mutiple jobs at a time).


In my case I've to set Execute concurrent builds if necessary in job's General settings.


For me below solution worked.

Jenkins --> Manage Jenkins --> Manage Nodes --> master -> configure --> Node properties --> Restrict Jobs execution at node - is enabled and given access to specific users. I have given access myself and then job started to run.

If Restrict Jobs execution at node is enabled scheduled tasks cannot run.


I ran into a similar problem because my master was set to "Leave this machine for tied jobs only." So, even though I disabled the Slave, Jenkins kept on bypassing the Master, looking for something else.

Go to Jenkins --> Manage Jenkins --> Manage Nodes, and click on the configure button of your master node (looks like a screwdriver and a wrench). Check the Usage and make sure it's on "Utilize this slave as much as possible."


In my case it was caused by number of executors (I had 1) and running Jenkins Job (Project) from Pipeline (my pipeline script started other Job in Jenkins). It caused deadlock - my pipeline held executor and was waiting for its job, but the job was waiting for free executor.

The solution may be increasing of # of executors in Jenkins -> Manage Jenkins -> Manage Nodes -> Configure (icon on required node).


In my case, I noticed this behavior when the box was out of memory (RAM) I went to Jenkins -> Manage Jenkins -> Manage Nodes and found an out of memory exception. I just freed up some memory on the machine and the jobs started to go into the executors.


I'm a little late to the game, but this may help others.

In my case my jenkins master has a shared external resource, which is allocated to jenkins jobs by the external-resource-dispatcher-plugin. Due to bug JENKINS-19439 in the plugin (which is in beta), I found that my resource had been locked by a previous job, but wasn't unlocked when that previous job was cancelled.

To find out if a resource is currently in the locked state, navigate to the affected jenkins node, Jenkins -> Manage Jenkins -> Manage Nodes -> master

You should see the current state of any external resources. If any are unexpectedly locked this may be the reason why jobs are waiting for an executor.

I couldn't find any details of how to manually resolve this issue.
Restarting jenkins didn't resolve the problem.
In the end I went with the brutal approach:

  • Remove the external resource
    (see Jenkins -> Manage Jenkins -> Manage Nodes -> master -> configure)
  • Restart jenkins
  • Re-create the external resource

In my case, I had just installed the "Authorize Project" plugin and incorrectly setup the strategy in "Manage Jenkins -> Configure Global Security -> Access Control for Builds" as "Run as anonymous". So 'anonymous' had no rights to execute the job.

Setting the first strategy as "Run as User who Triggered Build" unlocked the queued jobs.


For me I have to restart the executors manually. Click on "Dead" under "Build Executor Status" and push the restart button.