{"record":{"id":"7c5ee96982ea8026","repo":"jenkinsci/jenkins","slug":"no-such-agent-node-s-exists-did-you-mean-ad","errorCode":null,"errorMessage":"No such agent \"{node_s}\" exists. Did you mean \"{adv}\"?","messagePattern":"No such agent \"(.+?)\" exists\\. Did you mean \"(.+?)\"\\?","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":"Same offline-node lookup as the no-advice case, but EditDistance.findNearest found a plausible match, so the message (Messages.Computer_NoSuchSlaveExists) appends a 'Did you mean ...?' suggestion. Fires only when getComputer returns null AND a near name exists.","triggerScenarios":"`offline-node <name>` where <name> is a typo close to a real agent name (e.g. 'agnt1' vs 'agent1').","commonSituations":"Minor typo in agent name; recently renamed agent whose old name is still half-remembered; case differences.","solutions":["Use the suggested name shown in the message.","Confirm with `Jenkins.get().getComputers()` and re-run with the exact name."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"List<String> names = ComputerSet.getComputerNames();\nif (!names.contains(nodeName)) {\n    String near = EditDistance.findNearest(nodeName, names);\n    // suggest `near` to the user / use it\n}","typeGuard":null,"tryCatchPattern":"catch (IllegalArgumentException e) { /* message already contains the suggestion */ }","preventionTips":["Present findNearest suggestions to interactive users.","Normalize agent names to a canonical form before use."],"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"}