theonedev/onedev · error · NotFoundException
NAME_UNKNOWN
NAME_UNKNOWN
Error message
Unknown project: ${projectPath} What it means
checkProject resolves the project path embedded in the registry URL via projectService.findByPath; if no project matches, a 404 NotFoundException with OCI code NAME_UNKNOWN is thrown. The registry API reports unknown namespaces this way so clients know the repository name does not exist.
Source
Thrown at server-plugin/server-plugin-pack-container/src/main/java/io/onedev/server/plugin/pack/container/ContainerServlet.java:516
}
private boolean isTag(String reference) {
return !reference.contains(":");
}
private Digest parseDigest(String digestString) {
if (digestString.startsWith("sha256:")) {
return new Digest(SHA256, digestString.substring("sha256:".length()));
} else {
throw new ClientException(SC_NOT_ACCEPTABLE, ErrorCode.UNSUPPORTED,
"Unsupported digest: " + digestString);
}
}
private Project checkProject(String projectPath, boolean needsToPush) {
var project = projectService.findByPath(projectPath);
if (project == null)
throw new NotFoundException(ErrorCode.NAME_UNKNOWN, "Unknown project: " + projectPath);
else if (!project.isPackManagement())
throw new ClientException(SC_NOT_ACCEPTABLE, ErrorCode.DENIED, "Package management not enabled for project: " + projectPath);
else if (needsToPush && !SecurityUtils.canWritePack(project))
throw new UnauthorizedException("No package write permission for project: " + project.getPath());
else if (!needsToPush && !SecurityUtils.canReadPack(project))
throw new UnauthorizedException("No package read permission for project: " + project.getPath());
else
return project;
}
private String getChallenge() {
var serverUrl = settingService.getSystemSetting().getServerUrl();
return "Bearer realm=\"" + serverUrl + "/v2/token\",service=\"onedev\",scope=\"*\"";
}
}
View on GitHub (pinned to d44925c47c)
Solutions
- Verify the project path in the image name exactly matches an existing OneDev project (case-sensitive path).
- Create the project if it does not exist.
- If the project was renamed, update image tags/CI references to the new path.
Example fix
// before docker push registry.example.com/wrong-path/app:1.0 // after docker push registry.example.com/correct-project/app:1.0
Defensive patterns
Strategy: validation
Validate before calling
// verify the project path exists before push/pull curl -u user:token https://onedev.example.com/api/projects?path=correct-project
Try / catch
try { push() } catch (e) { if (e.httpStatus === 404 && e.code === 'NAME_UNKNOWN') { createProjectOrFixPath(); } else { throw e; } } Prevention
- Keep image names in sync with project paths (use variables in CI).
- Check project existence after renames/deletions and update consumers.
- Use exact, copy-pasted project paths; registry paths are case-sensitive.
When it happens
Trigger: Any registry API call (/v2/<projectPath>/...) where <projectPath> does not match an existing OneDev project path — typo in the image name, project renamed/deleted, or wrong casing.
Common situations: docker push/pull to a project that was deleted or renamed; mistyped image name (e.g. wrong path segment or trailing slash); pushing to a project that was never created.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Reference project not found: <projectPath>
- Reference project not found with key: <projectKey>
- Project not found:
- Project not found or inaccessible: ${path}
- Resource class not found: ${className}
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/6ec21ac4b308b3fd.
Report an issue: GitHub.