{"record":{"id":"6ec21ac4b308b3fd","repo":"theonedev/onedev","slug":"name-unknown","errorCode":"NAME_UNKNOWN","errorMessage":"Unknown project: ${projectPath}","messagePattern":"Unknown project: (.+?)","errorType":"http","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"server-plugin/server-plugin-pack-container/src/main/java/io/onedev/server/plugin/pack/container/ContainerServlet.java","lineNumber":516,"sourceCode":"\t}\n\t\n\tprivate boolean isTag(String reference) {\n\t\treturn !reference.contains(\":\");\n\t}\n\t\n\tprivate Digest parseDigest(String digestString) {\n\t\tif (digestString.startsWith(\"sha256:\")) {\n\t\t\treturn new Digest(SHA256, digestString.substring(\"sha256:\".length()));\n\t\t} else {\n\t\t\tthrow new ClientException(SC_NOT_ACCEPTABLE, ErrorCode.UNSUPPORTED, \n\t\t\t\t\t\"Unsupported digest: \" + digestString);\n\t\t}\n\t}\n\t\n\tprivate Project checkProject(String projectPath, boolean needsToPush) {\n\t\tvar project = projectService.findByPath(projectPath);\n\t\tif (project == null) \n\t\t\tthrow new NotFoundException(ErrorCode.NAME_UNKNOWN, \"Unknown project: \" + projectPath);\n\t\telse if (!project.isPackManagement())\n\t\t\tthrow new ClientException(SC_NOT_ACCEPTABLE, ErrorCode.DENIED, \"Package management not enabled for project: \" + projectPath);\n\t\telse if (needsToPush && !SecurityUtils.canWritePack(project))\n\t\t\tthrow new UnauthorizedException(\"No package write permission for project: \" + project.getPath());\n\t\telse if (!needsToPush && !SecurityUtils.canReadPack(project))\n\t\t\tthrow new UnauthorizedException(\"No package read permission for project: \" + project.getPath());\n\t\telse\n\t\t\treturn project;\n\t}\n\n\tprivate String getChallenge() {\n\t\tvar serverUrl = settingService.getSystemSetting().getServerUrl();\n\t\treturn \"Bearer realm=\\\"\" + serverUrl + \"/v2/token\\\",service=\\\"onedev\\\",scope=\\\"*\\\"\";\n\t}\n\t\n}\n","sourceCodeStart":498,"sourceCodeEnd":533,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-plugin/server-plugin-pack-container/src/main/java/io/onedev/server/plugin/pack/container/ContainerServlet.java#L498-L533","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\ndocker push registry.example.com/wrong-path/app:1.0\n// after\ndocker push registry.example.com/correct-project/app:1.0","handlingStrategy":"validation","validationCode":"// verify the project path exists before push/pull\ncurl -u user:token https://onedev.example.com/api/projects?path=correct-project","typeGuard":null,"tryCatchPattern":"try { push() } catch (e) { if (e.httpStatus === 404 && e.code === 'NAME_UNKNOWN') { createProjectOrFixPath(); } else { throw e; } }","preventionTips":["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."],"tags":["container-registry","http-404","project-not-found"],"backgroundTag":"resource-not-found","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}