theonedev/onedev · error · EntityNotFoundException

No project found with path '${projectPath}'

Error message

No project found with path '${projectPath}'

What it means

PackFilter routes pack-related HTTP requests (e.g. artifact/package downloads) by parsing the URL path; the leading segments are treated as a project path. If projectService.findByPath finds no project, EntityNotFoundException 'No project found with path <path>' is thrown, resulting in a 404 for the request.

Source

Thrown at server-core/src/main/java/io/onedev/server/pack/PackFilter.java:70

    @Override
	protected boolean onPreHandle(ServletRequest request, ServletResponse response, Object mappedValue) {
		var httpRequest = (HttpServletRequest) request;
		var httpResponse = (HttpServletResponse) response;
		var pathSegments = Splitter.on('/').trimResults().omitEmptyStrings()
				.splitToList(httpRequest.getRequestURI());
		for (var packHandler: packHandlers) {
			var handlerMark = "~" + packHandler.getHandlerId();
			if (pathSegments.contains(handlerMark)) {
				pathSegments = packHandler.normalize(pathSegments);
				var handlerMarkIndex = pathSegments.indexOf(handlerMark);
				request.setAttribute(DefaultSubjectContext.SESSION_CREATION_ENABLED, Boolean.FALSE);
				var projectPath = Joiner.on('/').join(pathSegments.subList(0, handlerMarkIndex));
				var projectId = sessionService.call(() -> {
					var project = projectService.findByPath(projectPath);
					if (project != null)
						return project.getId();
					else
						throw new EntityNotFoundException("No project found with path '" + projectPath + "'");
				});

				Long buildId = null;
				var apiKey = packHandler.getApiKey(httpRequest);
				if (apiKey != null) {
					var colonIndex = apiKey.indexOf(':');
					String jobToken;
					String accessTokenValue;
					if (colonIndex != -1) {
						jobToken = apiKey.substring(0, colonIndex);
						accessTokenValue = apiKey.substring(colonIndex +1);
					} else {
						jobToken = null;
						accessTokenValue = apiKey;
					}
					if (jobToken != null) {
						var jobContext = jobService.getJobContext(jobToken, false);
						if (jobContext != null)

View on GitHub (pinned to d44925c47c)

Solutions

  1. Fix the URL to use the exact current project path (check project settings)
  2. Verify the project exists and was not renamed or deleted
  3. Use the project id or re-resolve the path via OneDev API before constructing the URL

Example fix

// before
curl https://onedev.example.com/my-proj/~pack/file.zip  // project is 'myproj'
// after
curl https://onedev.example.com/myproj/~pack/file.zip
Defensive patterns

Strategy: try-catch

Validate before calling

Project p = OneDev.getInstance(ProjectService.class).findByPath(projectPath);
if (p == null) throw new IllegalArgumentException("Unknown project path: " + projectPath);

Try / catch

try {
    downloadPack(url);
} catch (HttpClientResponseException e) {
    if (e.getStatusCode() == 404)
        refreshProjectPathAndRetry();
}

Prevention

When it happens

Trigger: HTTP GET/PUT to a pack URL like /<projectPath>/~pack/... where the path prefix does not match any project path — wrong project name, renamed/moved project, or extra/missing path segments.

Common situations: CI scripts publishing/downloading packages with outdated project paths after a project rename; typos in download URLs; accessing packs on a project that was deleted.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06). Data as JSON: /api/errors/ca4bfd448731f62c. Report an issue: GitHub.