{"record":{"id":"d7e2896d2ded6e3e","repo":"theonedev/onedev","slug":"package-management-not-enabled-for-project-proj-d7e289","errorCode":null,"errorMessage":"Package management not enabled for project '${project.getPath()}'","messagePattern":"Package management not enabled for project '(.+?)'","errorType":"http","errorClass":"ClientException","httpStatus":406,"severity":"error","filePath":"server-plugin/server-plugin-pack-helm/src/main/java/io/onedev/server/plugin/pack/helm/HelmPackHandler.java","lineNumber":257,"sourceCode":"                pack.setPublishDate(new Date());\n\n                packService.createOrUpdate(pack, List.of(packBlob), true);\n                response.setStatus(SC_CREATED);\n            }));\n        } else {\n            throw new ClientException(SC_METHOD_NOT_ALLOWED, \"Method not allowed\");\n        }\n    }\n\n    @Override\n    public String getApiKey(HttpServletRequest request) {\n        return null;\n    }\n\n\tprivate Project checkProject(Long projectId, boolean needsToWrite) {\n\t\tvar project = projectService.load(projectId);\n\t\tif (!project.isPackManagement()) {\n\t\t\tthrow new ClientException(SC_NOT_ACCEPTABLE, \"Package management not enabled for project '\" + project.getPath() + \"'\");\n\t\t} else if (needsToWrite && !SecurityUtils.canWritePack(project)) {\n\t\t\tthrow new UnauthorizedException(\"No package write permission for project: \" + project.getPath());\n\t\t} else if (!needsToWrite && !SecurityUtils.canReadPack(project)) {\n\t\t\tthrow new UnauthorizedException(\"No package read permission for project: \" + project.getPath());\n\t\t}\n\t\treturn project;\n\t}\n\n\tprivate String getDownloadUrl(Pack pack) {\n\t\treturn String.format(\"/%s/~helm/%s-%s.tgz\",\n\t\t\t\tpack.getProject().getPath(), pack.getName(), pack.getVersion());\n\t}\n\n\t@Override\n\tpublic List<String> normalize(List<String> pathSegments) {\n        pathSegments = new ArrayList<>(pathSegments);\n        if (pathSegments.get(pathSegments.size() - 1).equals(\"charts\")) {\n            pathSegments.remove(pathSegments.size() - 1);","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-plugin/server-plugin-pack-helm/src/main/java/io/onedev/server/plugin/pack/helm/HelmPackHandler.java#L239-L275","documentation":"checkProject throws this 406 Not Acceptable ClientException when the target project has pack management disabled (project.isPackManagement() is false). The Helm pack registry endpoints are only usable for projects where the package management feature is turned on.","triggerScenarios":"GET/POST to a /~helm URL whose project has 'Package management' disabled in project settings; curl/helm clients pointed at the wrong project path.","commonSituations":"Freshly created projects where the feature flag was never enabled, projects migrated without pack settings, or users guessing a project path and hitting a project that never enabled packs.","solutions":["Enable 'Package management' in the project's settings (Project -> Package Management)","Verify the project path in the URL points to the intended project","Ask a project admin to enable pack management if you lack admin rights"],"exampleFix":"// before: project without packs\nPOST https://server/my-project/~helm  -> 406\n// after: enable Package Management for my-project, then retry\nPOST https://server/my-project/~helm","handlingStrategy":"validation","validationCode":"// check via OneDev API before pushing\nvar project = GET /api/projects/{path}\nif (!project.packManagement) enablePackManagement(project); // Project settings -> Package Management","typeGuard":null,"tryCatchPattern":"try { pushChart(); } catch (ClientException e) { if (e.getMessage().contains(\"Package management not enabled\")) promptEnablePackManagement(); }","preventionTips":["Enable Package Management on every project used as a registry","Verify the project path in the registry URL","Standardize project setup via provisioning scripts that enable packs"],"tags":["helm","project-config","feature-flag","packages"],"backgroundTag":"feature-not-enabled","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"}