jenkinsci/jenkins · error · IllegalArgumentException
No such item '{job_s}' exists.
Error message
No such item '{job_s}' exists. What it means
Thrown by the `reload-job` CLI command when getItemByFullName returns null or a non-AbstractItem, and Items.findNearest(AbstractItem.class, ...) returns null (no near match). Note the message uses Unicode curly quotes (\u2018 \u2019). The job variable stays null when the item is missing or is not an AbstractItem (e.g. a Folder).
Source
Thrown at core/src/main/java/hudson/cli/ReloadJobCommand.java:79
boolean errorOccurred = false;
final Jenkins jenkins = Jenkins.get();
final HashSet<String> hs = new HashSet<>(jobs);
for (String job_s : hs) {
AbstractItem job = null;
try {
Item item = jenkins.getItemByFullName(job_s);
if (item instanceof AbstractItem) {
job = (AbstractItem) item;
} else if (item != null) {
LOGGER.log(Level.WARNING, "Unsupported item type: {0}", item.getClass().getName());
}
if (job == null) {
AbstractItem project = Items.findNearest(AbstractItem.class, job_s, jenkins);
throw new IllegalArgumentException(project == null ?
"No such item \u2018" + job_s + "\u2019 exists." :
String.format("No such item \u2018%s\u2019 exists. Perhaps you meant \u2018%s\u2019?",
job_s, project.getFullName()));
}
job.checkPermission(Item.CONFIGURE);
job.doReload();
} catch (Exception e) {
if (hs.size() == 1) {
throw e;
}
final String errorMsg = job_s + ": " + e.getMessage();
stderr.println(errorMsg);
errorOccurred = true;
continue;
}
}View on GitHub (pinned to 2e228ff40b)
Solutions
- List reloadable items and copy the full name (including folder path).
- Confirm the target is an AbstractItem (job), not a Folder or view.
- Use the suggested name if one is offered.
Defensive patterns
Strategy: validation
Validate before calling
Item it = Jenkins.get().getItemByFullName(name);
if (!(it instanceof AbstractItem)) {
throw new IllegalArgumentException("Not a reloadable item: " + name);
} Type guard
boolean isReloadable(Item it) { return it instanceof AbstractItem; } Try / catch
catch (IllegalArgumentException e) { /* name missing/not a job */ } Prevention
- Resolve jobs via getItemByFullName and check AbstractItem before reload.
- Use full folder-qualified names.
When it happens
Trigger: `reload-job <name>` where <name> is not an existing AbstractItem and no near AbstractItem name exists.
Common situations: Job renamed/deleted; name refers to a Folder or other non-AbstractItem; missing the folder path prefix in a nested-job setup.
Related errors
- No such item '%s' exists. Perhaps you meant '%s'?
- Cannot build {0} because it is disabled.
- No such job '
- No such agent "{node_s}" exists.
- No such agent "{node_s}" exists. Did you mean "{adv}"?
AI-assisted analysis of jenkinsci/jenkins@2e228ff40b (2026-08-14).
Data as JSON: /api/errors/8f77d1ed585044a2.
Report an issue: GitHub.