{"record":{"id":"5c29cfb7d3f7452e","repo":"theonedev/onedev","slug":"unable-to-find-dependency-project-dependency","errorCode":null,"errorMessage":"Unable to find dependency project: \" + dependency.getProjectPath()","messagePattern":"Unable to find dependency project: \" \\+ dependency\\.getProjectPath\\(\\)","errorType":"exception","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/job/DefaultJobService.java","lineNumber":400,"sourceCode":"\t\t\t\t\tProjectScopedCommit.pop();\n\t\t\t\t}\n\t\t\t\tfor (var dependencyParamMap: dependencyParamMaps) {\n\t\t\t\t\tBuild dependencyBuild = doSubmit(user, project, commitId, interpolated.getJobName(), \n\t\t\t\t\t\t\tdependencyParamMap, refName, request, issue, reason);\n\t\t\t\t\tBuildDependence dependence = new BuildDependence();\n\t\t\t\t\tdependence.setDependency(dependencyBuild);\n\t\t\t\t\tdependence.setDependent(build);\n\t\t\t\t\tdependence.setRequireSuccessful(interpolated.isRequireSuccessful());\n\t\t\t\t\tdependence.setArtifacts(interpolated.getArtifacts());\n\t\t\t\t\tdependence.setDestinationPath(interpolated.getDestinationPath());\n\t\t\t\t\tbuild.getDependencies().add(dependence);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (ProjectDependency dependency : build.getJob().getProjectDependencies()) {\n\t\t\t\tdependency = interpolator.interpolateProperties(dependency);\n\t\t\t\tProject dependencyProject = projectService.findByPath(dependency.getProjectPath());\n\t\t\t\tif (dependencyProject == null)\n\t\t\t\t\tthrow new ExplicitException(\"Unable to find dependency project: \" + dependency.getProjectPath());\n\n\t\t\t\tSubject subject;\n\t\t\t\tif (dependency.getAccessTokenSecret() != null) {\n\t\t\t\t\tString secretValue = build.getJobAuthorizationContext().getSecretValue(dependency.getAccessTokenSecret());\n\t\t\t\t\tvar accessToken = accessTokenService.findByValue(secretValue);\n\t\t\t\t\tif (accessToken == null) {\n\t\t\t\t\t\tthrow new ExplicitException(\"Unable to access dependency project '\"\n\t\t\t\t\t\t\t\t+ dependency.getProjectPath() + \"': invalid access token\");\n\t\t\t\t\t}\n\t\t\t\t\tsubject = accessToken.asSubject();\n\t\t\t\t} else {\n\t\t\t\t\tsubject = SecurityUtils.asAnonymous();\n\t\t\t\t}\n\n\t\t\t\tBuild dependencyBuild = dependency.getBuildProvider().getBuild(dependencyProject);\n\t\t\t\tif (dependencyBuild == null) {\n\t\t\t\t\tString errorMessage = String.format(\"Unable to find dependency build in project '\"\n\t\t\t\t\t\t\t+ dependencyProject.getPath() + \"'\");","sourceCodeStart":382,"sourceCodeEnd":418,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/job/DefaultJobService.java#L382-L418","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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."],"exampleFix":"// before\nprojectDependencies:\n- projectName: core-lib   # project renamed to 'core-library'\n// after\nprojectDependencies:\n- projectName: core-library","handlingStrategy":"validation","validationCode":"for (ProjectDependency dep : job.getProjectDependencies()) {\n  if (projectService.findByPath(dep.getProjectPath()) == null)\n    throw new ValidationException(\"Dependency project not found: \" + dep.getProjectPath());\n}","typeGuard":null,"tryCatchPattern":"try { jobService.submit(...); } catch (ExplicitException e) { if (e.getMessage().startsWith(\"Unable to find dependency project\")) fixDependencyPath(); throw e; }","preventionTips":["Reference dependency projects by their full current path","Check for renames/deletions when updating build specs","Test property interpolation values that build dependency paths"],"tags":["ci","dependency","project"],"backgroundTag":"resource-not-found","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"}