{"record":{"id":"d64ce163dd08c259","repo":"jenkinsci/jenkins","slug":"no-such-agent-node-s-exists","errorCode":null,"errorMessage":"No such agent \"{node_s}\" exists.","messagePattern":"No such agent \"(.+?)\" exists\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/hudson/cli/OfflineNodeCommand.java","lineNumber":72,"sourceCode":"        return Messages.OfflineNodeCommand_ShortDescription();\n    }\n\n    @Override\n    protected int run() throws Exception {\n        boolean errorOccurred = false;\n        final Jenkins jenkins = Jenkins.get();\n        final HashSet<String> hs = new HashSet<>(nodes);\n        List<String> names = null;\n\n        for (String node_s : hs) {\n            try {\n                Computer computer = jenkins.getComputer(node_s);\n                if (computer == null) {\n                    if (names == null) {\n                        names = ComputerSet.getComputerNames();\n                    }\n                    String adv = EditDistance.findNearest(node_s, names);\n                    throw new IllegalArgumentException(adv == null ?\n                            hudson.model.Messages.Computer_NoSuchSlaveExistsWithoutAdvice(node_s) :\n                            hudson.model.Messages.Computer_NoSuchSlaveExists(node_s, adv));\n                }\n                computer.cliOffline(cause);\n            } catch (Exception e) {\n                if (hs.size() == 1) {\n                    throw e;\n                }\n\n                stderr.println(node_s + \": \" + e.getMessage());\n                errorOccurred = true;\n                continue;\n            }\n        }\n\n        if (errorOccurred) {\n            throw new AbortException(CLI_LISTPARAM_SUMMARY_ERROR_TEXT);\n        }","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/jenkinsci/jenkins/blob/2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc/core/src/main/java/hudson/cli/OfflineNodeCommand.java#L54-L90","documentation":"Thrown by the `offline-node` CLI command when Jenkins has no Computer for the given name and EditDistance.findNearest cannot suggest a close match. The message comes from Messages.Computer_NoSuchSlaveExistsWithoutAdvice. The same IllegalArgumentException is reused for both the with-advice and without-advice cases via a ternary at OfflineNodeCommand.java:72.","triggerScenarios":"Running `jenkins-cli offline-node <name>` (or offline-node with multiple names where one is invalid) where `Jenkins.getComputer(node_s)` returns null and no existing computer name is within edit distance of <name>.","commonSituations":"Typo in the agent name; the agent was deleted or renamed after the script was written; passing the built-in node name when an agent name is expected; a stale node list fed from an external inventory.","solutions":["List valid agents first (`Jenkins.get().getComputers()` or the CLI `computer`/`node` listing) and copy the exact name.","Correct the spelling/case of the agent name in your command or script.","If the node was deleted, recreate it or drop it from the target list."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"Computer c = Jenkins.get().getComputer(nodeName);\nif (c == null) {\n    throw new IllegalArgumentException(\"No such agent: \" + nodeName\n        + \". Known: \" + ComputerSet.getComputerNames());\n}","typeGuard":null,"tryCatchPattern":"try {\n    computer.cliOffline(cause);\n} catch (IllegalArgumentException e) {\n    // name unknown; surface known names and continue\n    stderr.println(nodeName + \": \" + e.getMessage());\n}","preventionTips":["Resolve agent names from Jenkins.get().getComputers() at runtime rather than hard-coding them.","Trim/filter external node lists before passing them to the CLI."],"tags":["cli","agent","configuration","not-found"],"backgroundTag":null,"analyzedSha":"2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc","analyzedAt":"2026-08-14T07:07:15.274Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}