{"record":{"id":"2e45fdbbeb38b431","repo":"theonedev/onedev","slug":"dependency-job-not-found","errorCode":null,"errorMessage":"Dependency job not found (","messagePattern":"Dependency job not found \\(","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/buildspec/BuildSpec.java","lineNumber":545,"sourceCode":"\t\t\t} else {\n\t\t\t\tJob dependencyJob = getJobMap().get(dependency.getJobName());\n\t\t\t\tif (dependencyJob != null) {\n\t\t\t\t\tif (dependencyChain.isEmpty()) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tParamUtils.validateParamMatrix(dependencyJob.getParamSpecs(), dependency.getParamMatrix());\n\t\t\t\t\t\t\tfor (var paramMap: dependency.getExcludeParamMaps())\n\t\t\t\t\t\t\t\tParamUtils.validateParamMap(dependencyJob.getParamSpecs(), paramMap.getParams());\n\t\t\t\t\t\t} catch (ValidationException e) {\n\t\t\t\t\t\t\tString message = String.format(\"Error validating dependency job parameters (dependency job: %s, error message: %s)\", \n\t\t\t\t\t\t\t\t\tdependencyJob.getName(), e.getMessage());\n\t\t\t\t\t\t\tthrow new ValidationException(message);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tList<String> newDependencyChain = new ArrayList<>(dependencyChain);\n\t\t\t\t\tnewDependencyChain.add(dependency.getJobName());\n\t\t\t\t\tcheckDependencies(dependencyJob, newDependencyChain);\n\t\t\t\t} else if (dependencyChain.isEmpty()) {\n\t\t\t\t\tthrow new ValidationException(\"Dependency job not found (\" + dependency.getJobName() + \")\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\t\n\t@Nullable\n\tpublic static BuildSpec get() {\n\t\tBuildSpecAware buildSpecAware = HierarchicalContext.get().findData(BuildSpecAware.class);\n\t\tif (buildSpecAware != null) \n\t\t\treturn buildSpecAware.getBuildSpec();\n\t\telse\n\t\t\treturn null;\n\t}\n\t\n\tpublic static List<InputSuggestion> suggestVariables(String matchWith, \n\t\t\tboolean withBuildVersion, boolean withDynamicVariables, boolean withPauseCommand) {\n\t\tList<InputSuggestion> suggestions = new ArrayList<>();\n\t\tBuildSpec buildSpec = get();","sourceCodeStart":527,"sourceCodeEnd":563,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/buildspec/BuildSpec.java#L527-L563","documentation":"checkDependencies throws ValidationException 'Dependency job not found (<name>)' when a job dependency names a job that does not exist in the build spec's job map, checked at the top level (empty dependency chain). Nested jobs referencing missing jobs deeper in the chain are not flagged here.","triggerScenarios":"A jobDependencies entry's jobName does not match any job defined in the same build spec; fired during isValid().","commonSituations":"Renaming or deleting a job that other jobs still depend on; typos in jobName; depending on a job that exists only on another branch; building specs from imported revisions where the referenced job is absent.","solutions":["Add the referenced job to the build spec","Correct the jobName to match an existing job (exact, case-sensitive name)","Remove the dependency entry if the job was intentionally deleted","Check that the imported spec (if using Import) resolves to the revision containing the job"],"exampleFix":"# before\n- name: deploy\n  jobDependencies: [{jobName: biuld}]   # typo\n# after\n- name: deploy\n  jobDependencies: [{jobName: build}]","handlingStrategy":"validation","validationCode":"for (var job : buildSpec.getJobs())\n    for (var dep : job.getJobDependencies())\n        if (!buildSpec.getJobMap().containsKey(dep.getJobName()))\n            throw new ExplicitException(\"Unknown job dependency: \" + dep.getJobName());","typeGuard":null,"tryCatchPattern":"try {\n    buildSpec.isValid();\n} catch (ValidationException e) {\n    // 'Dependency job not found (name)': add/rename/remove the dependency\n}","preventionTips":["When renaming or deleting jobs, update all jobDependencies references","Verify dependency names against getJobMap() before saving","Avoid depending on jobs that exist only on other branches","Validate specs in the editor"],"tags":["buildspec","jobs","dependencies","validation"],"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"}