Jenkins stops processing builds in the build queue after an error appears in the logs


Jenkins jobs will sit in the build queue, and not get started, even when there are build agents available for the chosen ‘label’, and you see stack traces in the logs similar to the one shown below:

SEVERE  hudson.triggers.SafeTimerTask#run: Timer task hudson.model.Queue$MaintainTask@XXXX failed

How do we know what is causing this queue freeze?



The Queue.MaintainTask is a periodic task which is run in the instance and it is responsible for maintenance operations such as adding elements to the queue, assigning elements in the queue to nodes or executors, etc. If for some reason, this task fails, this causes the queue to become unresponsive and the jobs eventually stop being run as they stay stuck in the queue.

In order to determine what is the cause for this problem, we need to pay special attention to the full stack trace of the error which shows up in the logs.

You will be able to see some potential causes below, the intent of the list below is to allow you understand the pattern that you might follow to determine the root cause of the failure, thus helping you recover the instance as fast as possible.

SEVERE  hudson.triggers.SafeTimerTask#run: Timer task hudson.model.Queue$MaintainTask@XXX failed
Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from XXXX/XXX:XXX
                at hudson.remoting.Channel.attachCallSiteStackTrace(
                at hudson.remoting.UserRequest$ExceptionResponse.retrieve(
                at hudson.Launcher$RemoteLauncher.launch(
                at hudson.Launcher$ProcStarter.start(
                at com.cloudbees.jenkins.plugins.nodesplus.CustomNodeProbeBuildFilterProperty.getProbeResult(

In the stacktrace we can clearly see that there is a correlation between the getProbeResult method and the task failure.

 SEVERE  hudson.triggers.SafeTimerTask#run: Timer task hudson.model.Queue$MaintainTask@XXX failed
java.lang.NoClassDefFoundError: Could not initialize class org.apache.logging.log4j.core.impl.Log4jLogEvent
    at org.apache.logging.log4j.core.impl.DefaultLogEventFactory.createEvent(
    at org.apache.logging.log4j.core.config.LoggerConfig.log(
    at org.apache.logging.log4j.core.config.DefaultReliabilityStrategy.log(
    at org.apache.logging.log4j.core.Logger.logMessage(
    at org.apache.logging.log4j.spi.AbstractLogger.tryLogMessage(
    at org.apache.logging.log4j.spi.AbstractLogger.logMessageSafely(
    at org.apache.logging.log4j.spi.AbstractLogger.logMessage(
    at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(
    at org.apache.logging.log4j.spi.AbstractLogger.error(

In this case, the exception thrown is different but the effect is the same, the periodic task starts failing.

SEVERE  hudson.triggers.SafeTimerTask#run: Timer task hudson.model.Queue$MaintainTask@XXX failed
java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0
    at java.util.regex.Pattern.error(
    at java.util.regex.Pattern.sequence(
    at java.util.regex.Pattern.expr(
    at java.util.regex.Pattern.compile(
    at java.util.regex.Pattern.<init>(
    at java.util.regex.Pattern.compile(
    at java.util.regex.Pattern.matches(
    at java.lang.String.matches(
    at hudson.plugins.buildblocker.BlockingJobsMonitor.checkForPlannedBuilds(
    at hudson.plugins.buildblocker.BlockingJobsMonitor.checkForQueueEntries(
    at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.checkAccordingToProperties(

Again, the stacktrace will allow us to determine the source of the problem affecting the queue.

SEVERE    hudson.triggers.SafeTimerTask#run: Timer task hudson.model.Queue$MaintainTask@XXX failed
java.lang.IndexOutOfBoundsException: Index: 0
    at java.util.Collections$EmptyList.get(
    at org.jenkinsci.plugins.workflow.graph.StandardGraphLookupView.bruteForceScanForEnclosingBlock(
    at org.jenkinsci.plugins.workflow.graph.StandardGraphLookupView.findEnclosingBlockStart(
    at org.jenkinsci.plugins.workflow.graph.StandardGraphLookupView.findAllEnclosingBlockStarts(
SEVERE  hudson.triggers.SafeTimerTask#run: Timer task hudson.model.Queue$MaintainTask@XXX failed
    at org.jenkinsci.plugins.blockqueuedjob.condition.JobResultBlockQueueCondition.isBlocked(
    at org.jenkinsci.plugins.blockqueuedjob.BlockItemQueueTaskDispatcher.canRun(
    at hudson.model.Queue.getCauseOfBlockageForItem(


Depending on the situation that you are experiencing, you might need to upgrade or disable (if possible) the corresponding plugin showing up as responsible for the failure.

Have more questions?


  • 0
    Ryan Campbell

    Please note that this general class of errors is tracked as

    The instances above are actually bugs in those particular plugins -- these RuntimeExceptions should be checked and appropriate responses made to the given extension point.

Please sign in to leave a comment.