{"record":{"id":"ff7eef2c1ea53063","repo":"jenkinsci/jenkins","slug":"no-longer-a-configured-node-for-0","errorCode":null,"errorMessage":"no longer a configured node for {0}","messagePattern":"no longer a configured node for (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/hudson/model/AbstractBuild.java","lineNumber":427,"sourceCode":"        /**\n         * Lease of the workspace.\n         */\n        private Lease lease;\n\n        /**\n         * Returns the current {@link Node} on which we are building.\n         * @return Returns the current {@link Node}\n         * @throws IllegalStateException if that cannot be determined\n         */\n        protected final @NonNull Node getCurrentNode() throws IllegalStateException {\n            Executor exec = Executor.currentExecutor();\n            if (exec == null) {\n                throw new IllegalStateException(\"not being called from an executor thread\");\n            }\n            Computer c = exec.getOwner();\n            Node node = c.getNode();\n            if (node == null) {\n                throw new IllegalStateException(\"no longer a configured node for \" + c.getName());\n            }\n            return node;\n        }\n\n        public Launcher getLauncher() {\n            return launcher;\n        }\n\n        public BuildListener getListener() {\n            return listener;\n        }\n\n        /**\n         * Allocates the workspace from {@link WorkspaceList}.\n         *\n         * @param n\n         *      Passed in for the convenience. The node where the build is running.\n         * @param wsl","sourceCodeStart":409,"sourceCodeEnd":445,"githubUrl":"https://github.com/jenkinsci/jenkins/blob/2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc/core/src/main/java/hudson/model/AbstractBuild.java#L409-L445","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Avoid deleting or reconfiguring agents while builds are running on them — drain the agent first","For cloud/ephemeral agents, ensure the agent is retained until builds complete (set idle timeout / retention appropriately)","Catch IllegalStateException in build logic and fail the build gracefully with a clear message","If the node must be removed, abort builds on it first via Jenkins API before removal"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"Computer c = Executor.currentExecutor().getOwner();\nif (c.getNode() == null) {\n    throw new AbortException(\"Node \" + c.getName() + \" was removed mid-build; aborting\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    Node node = build.getCurrentNode();\n} catch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"no longer a configured node\")) {\n        // fail the build cleanly; the agent was removed\n    }\n    throw e;\n}","preventionTips":["Never delete or deconfigure agents with running builds — drain first","For cloud agents, set retention so they survive until builds finish","Catch IllegalStateException in build wrappers and report a clear cause"],"tags":["build","agent","node","executor","concurrency","state"],"backgroundTag":null,"analyzedSha":"2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc","analyzedAt":"2026-08-14T07:07:15.274Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}