Skip to content

[JENKINS-73522] IllegalStateException with "Failed to proceed after CpsStepContext" #1688

@jenkins-infra-bot

Description

@jenkins-infra-bot

I am seeing warnings and exceptions in my systemd journal for scheduled builds:

WARNING    o.j.p.w.cps.CpsStepContext$2#onFailure: Failed to proceed after CpsStepContext[129:build]:Owner[name_all/865:name_all #865]
java.lang.IllegalStateException: completed or broken execution
     at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.onLoad(CpsFlowExecution.java:833)
     at PluginClassLoader for workflow-job//org.jenkinsci.plugins.workflow.job.WorkflowRun.getExecution(WorkflowRun.java:719)
     at PluginClassLoader for workflow-job//org.jenkinsci.plugins.workflow.job.WorkflowRun$Owner.get(WorkflowRun.java:992)
     at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsStepContext.getExecution(CpsStepContext.java:217)
     at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsStepContext.getNode(CpsStepContext.java:302)
     at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsStepContext.scheduleNextRun(CpsStepContext.java:368)
     at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsStepContext.completed(CpsStepContext.java:326)
     at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsStepContext.onFailure(CpsStepContext.java:314)
     at PluginClassLoader for pipeline-build-step//org.jenkinsci.plugins.workflow.support.steps.build.BuildTriggerListener.lambda$onDeleted$1(BuildTriggerListener.java:86)
     at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:67)
     at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
     at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
     at java.base/java.lang.Thread.run(Thread.java:829)

Relevant section from the pipeline:

def buildJobs = [:]
List jobsToBuild = getJobsToBuild()
for (jobName in jobsToBuild) {
    def job = jobName
    buildJobs["${job}"] = {
        stage("${job}") {
            catchError(buildResult: 'Failure', stageResult: 'Failure') {
                build job: "${job}"
            }
        }
    }
}
parallel buildJobs

Some background: This is a scheduled pipeline which invokes multiple other pipelines - I can see this for cases where all "sub-pipelines" are STABLE and for mixed cases of STABLE and UNSTABLE. The overall pipeline result is always as expected from the "sub-pipelines". The build log itself shows no errors. The above stacktrace is shown when setting the overall pipeline result according to the timestamps.

Build number 865, which is part of the warning/stacktrace, is not the latest build, but the oldest one being removed in this case due to the "Discard old builds" option being configured to "Log Rotation" with a fixed age.


Originally reported by stefan6419846, imported from: IllegalStateException with "Failed to proceed after CpsStepContext"
  • status: Open
  • priority: Minor
  • component(s): workflow-cps-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 6
  • imported: 2025-12-07
Raw content of original issue

I am seeing warnings and exceptions in my systemd journal for scheduled builds:

WARNING    o.j.p.w.cps.CpsStepContext$2#onFailure: Failed to proceed after CpsStepContext[129:build]:Owner[name_all/865:name_all #865]
java.lang.IllegalStateException: completed or broken execution
     at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.onLoad(CpsFlowExecution.java:833)
     at PluginClassLoader for workflow-job//org.jenkinsci.plugins.workflow.job.WorkflowRun.getExecution(WorkflowRun.java:719)
     at PluginClassLoader for workflow-job//org.jenkinsci.plugins.workflow.job.WorkflowRun$Owner.get(WorkflowRun.java:992)
     at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsStepContext.getExecution(CpsStepContext.java:217)
     at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsStepContext.getNode(CpsStepContext.java:302)
     at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsStepContext.scheduleNextRun(CpsStepContext.java:368)
     at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsStepContext.completed(CpsStepContext.java:326)
     at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsStepContext.onFailure(CpsStepContext.java:314)
     at PluginClassLoader for pipeline-build-step//org.jenkinsci.plugins.workflow.support.steps.build.BuildTriggerListener.lambda$onDeleted$1(BuildTriggerListener.java:86)
     at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:67)
     at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
     at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
     at java.base/java.lang.Thread.run(Thread.java:829)

Relevant section from the pipeline:

def buildJobs = [:]
List jobsToBuild = getJobsToBuild()
for (jobName in jobsToBuild) {
    def job = jobName
    buildJobs["${job}"] = {
        stage("${job}") {
            catchError(buildResult: 'Failure', stageResult: 'Failure') {
                build job: "${job}"
            }
        }
    }
}
parallel buildJobs

Some background: This is a scheduled pipeline which invokes multiple other pipelines - I can see this for cases where all "sub-pipelines" are STABLE and for mixed cases of STABLE and UNSTABLE. The overall pipeline result is always as expected from the "sub-pipelines". The build log itself shows no errors. The above stacktrace is shown when setting the overall pipeline result according to the timestamps.

Build number 865, which is part of the warning/stacktrace, is not the latest build, but the oldest one being removed in this case due to the "Discard old builds" option being configured to "Log Rotation" with a fixed age.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions