jenkinsci/jenkins · error · IllegalStateException

no longer a configured node for {0}

Error message

no longer a configured node for {0}

What it means

Thrown by AbstractBuild.AbstractBuildExecution.getCurrentNode() when Executor.currentExecutor() is non-null but its Computer's getNode() returns null. This means the executor is still alive but the node it was running on has been removed from the Jenkins configuration (decommissioned/deleted) while the build is still active. The message includes the computer (agent) name.

Source

Thrown at core/src/main/java/hudson/model/AbstractBuild.java:427

        /**
         * Lease of the workspace.
         */
        private Lease lease;

        /**
         * Returns the current {@link Node} on which we are building.
         * @return Returns the current {@link Node}
         * @throws IllegalStateException if that cannot be determined
         */
        protected final @NonNull Node getCurrentNode() throws IllegalStateException {
            Executor exec = Executor.currentExecutor();
            if (exec == null) {
                throw new IllegalStateException("not being called from an executor thread");
            }
            Computer c = exec.getOwner();
            Node node = c.getNode();
            if (node == null) {
                throw new IllegalStateException("no longer a configured node for " + c.getName());
            }
            return node;
        }

        public Launcher getLauncher() {
            return launcher;
        }

        public BuildListener getListener() {
            return listener;
        }

        /**
         * Allocates the workspace from {@link WorkspaceList}.
         *
         * @param n
         *      Passed in for the convenience. The node where the build is running.
         * @param wsl

View on GitHub (pinned to 2e228ff40b)

Solutions

  1. Avoid deleting or reconfiguring agents while builds are running on them — drain the agent first
  2. For cloud/ephemeral agents, ensure the agent is retained until builds complete (set idle timeout / retention appropriately)
  3. Catch IllegalStateException in build logic and fail the build gracefully with a clear message
  4. If the node must be removed, abort builds on it first via Jenkins API before removal
Defensive patterns

Strategy: try-catch

Validate before calling

Computer c = Executor.currentExecutor().getOwner();
if (c.getNode() == null) {
    throw new AbortException("Node " + c.getName() + " was removed mid-build; aborting");
}

Try / catch

try {
    Node node = build.getCurrentNode();
} catch (IllegalStateException e) {
    if (e.getMessage().startsWith("no longer a configured node")) {
        // fail the build cleanly; the agent was removed
    }
    throw e;
}

Prevention

When it happens

Trigger: Called from a build thread (run(), decideWorkspace(), or pre-checkout logic) after the agent/node was taken offline and removed from Jenkins while the build's executor was still allocated to it.

Common situations: An agent is deleted or its configuration is removed mid-build; a transient/ephemeral agent (cloud) is reaped while a build is running; a node rename or reconfiguration invalidates the computer-to-node mapping during a build.

Related errors


AI-assisted analysis of jenkinsci/jenkins@2e228ff40b (2026-08-14). Data as JSON: /api/errors/ff7eef2c1ea53063. Report an issue: GitHub.