theonedev/onedev · error · ExplicitException

Upload project not found:

Error message

Upload project not found: 

What it means

During cache/upload provisioning, when config.getUploadProjectPath() is set, ServerCacheProvisioner.upload looks up that project path via getProjectService().findByPath. If no project matches, it throws ExplicitException "Upload project not found: <path>", aborting the upload because the target project for uploaded cache/site data does not exist.

Source

Thrown at server-core/src/main/java/io/onedev/server/cache/ServerCacheProvisioner.java:97

				}
			}
		} else {
			return CacheAvailability.NOT_FOUND;
		}
	}

	@Override
	protected boolean upload(CacheConfigFacade config, String path, File pathDir, List<String> excludes) {
		var key = config.getKey();
		var checksum = config.getChecksum();

		var projectId = getSessionService().call(() -> {
			Project uploadProject;
			if (config.getUploadProjectPath() != null) {
				var uploadProjectPath = config.getUploadProjectPath();
				uploadProject = getProjectService().findByPath(uploadProjectPath);
				if (uploadProject == null)
					throw new ExplicitException("Upload project not found: " + uploadProjectPath);
			} else {
				uploadProject = getProjectService().load(getProjectId());
			}

			var accessTokenValue = config.getUploadAccessToken();
			if (canUploadTo(uploadProject)) {
				return uploadProject.getId();
			} else if (accessTokenValue != null) {
				var accessToken = getAccessTokenService().findByValue(accessTokenValue);
				if (accessToken != null && SecurityUtils.canUploadCache(accessToken.asSubject(), uploadProject))
					return uploadProject.getId();
			}
			return null;

		});

		if (projectId != null) {
			var activeServer = getProjectService().getActiveServer(projectId, true);

View on GitHub (pinned to d44925c47c)

Solutions

  1. Verify the project path in your server cache/cluster config and correct it to an existing project path (visible in the project URL).
  2. Create the referenced project or recreate it with the same path if it was deleted/renamed.
  3. Remove uploadProjectPath from the config to fall back to loading the project by the configured project id.
  4. Run against the correct server instance that actually contains the referenced project.

Example fix

// before (cluster config)
uploadProjectPath: /my-projet   // typo

// after
uploadProjectPath: /my-project  // must match an existing project path
Defensive patterns

Strategy: validation

Validate before calling

var project = OneDev.getInstance(ProjectService.class).findByPath(uploadProjectPath);
if (project == null)
    throw new ExplicitException("Fix uploadProjectPath in server cache config: " + uploadProjectPath);

Try / catch

try {
    provisioner.upload(config);
} catch (ExplicitException e) {
    // e.getMessage() names the missing upload project path; fix config and retry
}

Prevention

When it happens

Trigger: Running a cache upload (e.g. cache provisioning between cluster members) where server cache/cluster config specifies uploadProjectPath that does not exist on the server: typo in path, project renamed, project deleted, or wrong server/instance targeted.

Common situations: Config copied from another OneDev instance where the project path differs; project renamed after the config was written; leading/trailing slash or case mismatch in the project path; running the upload against a fresh instance that lacks the project.

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


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