1

I had server issues and had to restart a bunch of times and now I can't clear the build queue which has 200 items built up.

Doing this in the script console times out Jenkins.instance.queue.clear(): Cancel queued builds and aborting executing builds using Groovy for Jenkins

The queue, as reported by Jenkins, seems to be totally stale.

Where does Jenkins store this info? On disk?

Is there a script I could run in the console to fix this? Or is there a way to force clear the queue by updating a file on disk?

EDIT

I just tried again and Jenkins.instance.queue.clear() worked so I don't know what was happening before.

For more info I wasn't suggesting it was timing out because there were too many jobs. Even targeting one queue item like this was timing out:

import hudson.model.*
def q = Jenkins.instance.queue
q.items.findAll { it.task.name.contains('my specific job name') }.each{ 
  q.cancel(it.task)
}

Still curious to know where the queue is held on jenkins to troubleshoot better in the future.

red888
  • 27,709
  • 55
  • 204
  • 392
  • I've had 800+ items in the queue and run same command. Queue is wiped instantly. – Ian W Jun 30 '22 at 05:38
  • How is this helpful @IanW? I'm super happy its working for you, but for me its timing out so clearly I have a problem. – red888 Jun 30 '22 at 10:23
  • 1
    Check the logs and see if they provide a clue. Just saying there should be no waiting. Don't believe it's stored on disk. – Ian W Jun 30 '22 at 10:29

0 Answers0