theonedev/onedev · error · ClientException
Package management not enabled for project '${project.getPat
Error message
Package management not enabled for project '${project.getPath()}' What it means
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.
Source
Thrown at server-plugin/server-plugin-pack-helm/src/main/java/io/onedev/server/plugin/pack/helm/HelmPackHandler.java:257
pack.setPublishDate(new Date());
packService.createOrUpdate(pack, List.of(packBlob), true);
response.setStatus(SC_CREATED);
}));
} else {
throw new ClientException(SC_METHOD_NOT_ALLOWED, "Method not allowed");
}
}
@Override
public String getApiKey(HttpServletRequest request) {
return null;
}
private Project checkProject(Long projectId, boolean needsToWrite) {
var project = projectService.load(projectId);
if (!project.isPackManagement()) {
throw new ClientException(SC_NOT_ACCEPTABLE, "Package management not enabled for project '" + project.getPath() + "'");
} else if (needsToWrite && !SecurityUtils.canWritePack(project)) {
throw new UnauthorizedException("No package write permission for project: " + project.getPath());
} else if (!needsToWrite && !SecurityUtils.canReadPack(project)) {
throw new UnauthorizedException("No package read permission for project: " + project.getPath());
}
return project;
}
private String getDownloadUrl(Pack pack) {
return String.format("/%s/~helm/%s-%s.tgz",
pack.getProject().getPath(), pack.getName(), pack.getVersion());
}
@Override
public List<String> normalize(List<String> pathSegments) {
pathSegments = new ArrayList<>(pathSegments);
if (pathSegments.get(pathSegments.size() - 1).equals("charts")) {
pathSegments.remove(pathSegments.size() - 1);View on GitHub (pinned to d44925c47c)
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
Example fix
// before: project without packs POST https://server/my-project/~helm -> 406 // after: enable Package Management for my-project, then retry POST https://server/my-project/~helm
Defensive patterns
Strategy: validation
Validate before calling
// check via OneDev API before pushing
var project = GET /api/projects/{path}
if (!project.packManagement) enablePackManagement(project); // Project settings -> Package Management Try / catch
try { pushChart(); } catch (ClientException e) { if (e.getMessage().contains("Package management not enabled")) promptEnablePackManagement(); } Prevention
- 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
When it happens
Trigger: GET/POST to a /~helm URL whose project has 'Package management' disabled in project settings; curl/helm clients pointed at the wrong project path.
Common situations: 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.
Related errors
- Time tracking needs to be enabled for the project
- Time tracking needs to be enabled for the project
- Not authorized
- Not authorized
- Not authorized
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/d7e2896d2ded6e3e.
Report an issue: GitHub.