{"record":{"id":"8df15c1e0906ac65","repo":"jenkinsci/jenkins","slug":"no-such-job-src-perhaps-you-meant-nearest-g","errorCode":null,"errorMessage":"No such job '{src}'; perhaps you meant '{nearest.getFullName()}'?","messagePattern":"No such job '(.+?)'; perhaps you meant '(.+?)'\\?","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/hudson/cli/handlers/GenericItemOptionHandler.java","lineNumber":75,"sourceCode":"    protected abstract Class<T> type();\n\n    @Override public int parseArguments(Parameters params) throws CmdLineException {\n        final Jenkins j = Jenkins.get();\n        final String src = params.getParameter(0);\n        T s = j.getItemByFullName(src, type());\n        if (s == null) {\n            final Authentication who = Jenkins.getAuthentication2();\n            try (ACLContext acl = ACL.as2(ACL.SYSTEM2)) {\n                Item actual = j.getItemByFullName(src);\n                if (actual == null) {\n                    LOGGER.log(Level.FINE, \"really no item exists named {0}\", src);\n                } else {\n                    LOGGER.log(Level.WARNING, \"running as {0} could not find {1} of {2}\", new Object[] {who.getPrincipal(), actual, type()});\n                }\n            }\n            T nearest = Items.findNearest(type(), src, j);\n            if (nearest != null) {\n                throw new IllegalArgumentException(\"No such job '\" + src + \"'; perhaps you meant '\" + nearest.getFullName() + \"'?\");\n            } else {\n                throw new IllegalArgumentException(\"No such job '\" + src + \"'\");\n            }\n        }\n        setter.addValue(s);\n        return 1;\n    }\n\n    @Override public String getDefaultMetaVariable() {\n        return \"ITEM\";\n    }\n\n}\n","sourceCodeStart":57,"sourceCodeEnd":89,"githubUrl":"https://github.com/jenkinsci/jenkins/blob/2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc/core/src/main/java/hudson/cli/handlers/GenericItemOptionHandler.java#L57-L89","documentation":"IllegalArgumentException from the args4j GenericItemOptionHandler during option parsing: the named item could not be resolved as the requested type, and Items.findNearest found a suggestion. Note the prior ACL.as2(SYSTEM) block: if the item exists but the current user cannot see it, the code logs a WARNING and still reports 'no such job' — so this can be a permission problem, not just a typo.","triggerScenarios":"Any CLI command taking an ITEM option (e.g. -j / positional JOB) with a name that is missing or invisible to the current user, where a near item exists.","commonSituations":"Running the CLI as a user without Job.READ on the item (item exists but reads as missing); typo; renamed job; cross-folder name without the full path.","solutions":["Authenticate the CLI as a user with READ on the item (API token / login).","Use the suggested full name.","Supply the fully-qualified name including the folder path."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"Item it;\ntry (ACLContext ctx = ACL.as2(ACL.SYSTEM2)) {\n    it = Jenkins.get().getItemByFullName(name);\n}\nif (it == null) { /* truly absent vs. permission: re-check as current user */ }","typeGuard":null,"tryCatchPattern":"catch (CmdLineException | IllegalArgumentException e) { /* item unresolved or not visible to user */ }","preventionTips":["Authenticate the CLI with credentials holding READ on the item.","Use fully-qualified item names in folders."],"tags":["cli","job","permissions","not-found"],"backgroundTag":null,"analyzedSha":"2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc","analyzedAt":"2026-08-14T07:07:15.274Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}