theonedev/onedev · error · ExplicitException
Unable to find dependency project: " + dependency.getProject
Error message
Unable to find dependency project: " + dependency.getProjectPath()
What it means
While submitting a build with project dependencies, DefaultJobService.doSubmit interpolates each dependency's project path and resolves it via projectService.findByPath. If no project exists at that path, an ExplicitException is thrown so the user knows the dependency configuration points at a non-existent project.
Source
Thrown at server-core/src/main/java/io/onedev/server/job/DefaultJobService.java:400
ProjectScopedCommit.pop();
}
for (var dependencyParamMap: dependencyParamMaps) {
Build dependencyBuild = doSubmit(user, project, commitId, interpolated.getJobName(),
dependencyParamMap, refName, request, issue, reason);
BuildDependence dependence = new BuildDependence();
dependence.setDependency(dependencyBuild);
dependence.setDependent(build);
dependence.setRequireSuccessful(interpolated.isRequireSuccessful());
dependence.setArtifacts(interpolated.getArtifacts());
dependence.setDestinationPath(interpolated.getDestinationPath());
build.getDependencies().add(dependence);
}
}
for (ProjectDependency dependency : build.getJob().getProjectDependencies()) {
dependency = interpolator.interpolateProperties(dependency);
Project dependencyProject = projectService.findByPath(dependency.getProjectPath());
if (dependencyProject == null)
throw new ExplicitException("Unable to find dependency project: " + dependency.getProjectPath());
Subject subject;
if (dependency.getAccessTokenSecret() != null) {
String secretValue = build.getJobAuthorizationContext().getSecretValue(dependency.getAccessTokenSecret());
var accessToken = accessTokenService.findByValue(secretValue);
if (accessToken == null) {
throw new ExplicitException("Unable to access dependency project '"
+ dependency.getProjectPath() + "': invalid access token");
}
subject = accessToken.asSubject();
} else {
subject = SecurityUtils.asAnonymous();
}
Build dependencyBuild = dependency.getBuildProvider().getBuild(dependencyProject);
if (dependencyBuild == null) {
String errorMessage = String.format("Unable to find dependency build in project '"
+ dependencyProject.getPath() + "'");View on GitHub (pinned to d44925c47c)
Solutions
- Fix the dependency's project path in the build spec to an existing project (check the project list for the exact path).
- Recreate the missing dependency project, or remove the dependency if it's no longer needed.
- If the path comes from property interpolation, verify the property values resolve correctly for this build.
Example fix
// before projectDependencies: - projectName: core-lib # project renamed to 'core-library' // after projectDependencies: - projectName: core-library
Defensive patterns
Strategy: validation
Validate before calling
for (ProjectDependency dep : job.getProjectDependencies()) {
if (projectService.findByPath(dep.getProjectPath()) == null)
throw new ValidationException("Dependency project not found: " + dep.getProjectPath());
} Try / catch
try { jobService.submit(...); } catch (ExplicitException e) { if (e.getMessage().startsWith("Unable to find dependency project")) fixDependencyPath(); throw e; } Prevention
- Reference dependency projects by their full current path
- Check for renames/deletions when updating build specs
- Test property interpolation values that build dependency paths
When it happens
Trigger: doSubmit (via submit or dependencyBuild) when a job's projectDependencies reference a projectPath that does not exist in the server (renamed, deleted, or mistyped project path).
Common situations: Dependency project renamed or deleted after the build spec was written; typos in the project path; copy-pasting specs between servers/instances where the project doesn't exist; interpolated property producing a wrong path.
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
- Unable to find dependency build in project '" + dependencyPr
- Allocated agent not connected to current server, please retr
- Dependency property not found: X
- Access denied
- Attachment not found:
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/5c29cfb7d3f7452e.
Report an issue: GitHub.