{"record":{"id":"79970984900034d3","repo":"theonedev/onedev","slug":"job-not-found","errorCode":null,"errorMessage":"Job not found (","messagePattern":"Job not found \\(","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/buildspec/job/action/RunJobAction.java","lineNumber":151,"sourceCode":"\t}\n\n\t@Override\n\tpublic void validateWith(BuildSpec buildSpec, Job job) {\n\t\tsuper.validateWith(buildSpec, job);\n\t\t\n\t\tJob jobToRun = buildSpec.getJobMap().get(jobName);\n\t\tif (jobToRun != null) {\n\t\t\ttry {\n\t\t\t\tParamUtils.validateParamMatrix(jobToRun.getParamSpecs(), paramMatrix);\n\t\t\t\tfor (var exludeParamMap: excludeParamMaps)\n\t\t\t\t\tParamUtils.validateParamMap(jobToRun.getParamSpecs(), exludeParamMap.getParams());\n\t\t\t} catch (ValidationException e) {\n\t\t\t\tString errorMessage = String.format(\"Error validating job parameters (job: %s, error message: %s)\", \n\t\t\t\t\t\tjobToRun.getName(), e.getMessage());\n\t\t\t\tthrow new ValidationException(errorMessage);\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new ValidationException(\"Job not found (\" + jobName + \")\");\n\t\t}\n\t}\n\n}\n","sourceCodeStart":133,"sourceCodeEnd":156,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/buildspec/job/action/RunJobAction.java#L133-L156","documentation":"In RunJobAction.validateWith, if the jobName of the action does not resolve to a job in the current build spec (jobToRun == null), a ValidationException 'Job not found (<jobName>)' is thrown instead of validating parameters.","triggerScenarios":"validateWith(buildSpec, job) is called and buildSpec.getJobMap().get(jobName) yields nothing — the `job` field of the RunJobAction names a job absent from this project's build spec at validation time.","commonSituations":"Typo in the job name; the target job was renamed or deleted; the job lives in another project (should use RunProjectJobAction or an import); case mismatch between action and job definition.","solutions":["Correct the `job` field to the exact name of a job defined in the same build spec (names are case-sensitive).","Re-add the target job if it was deleted, or rename the action's reference after a job rename.","If the job belongs to another project, import that build spec or use RunProjectJobAction instead."],"exampleFix":"// before\n- !RunJobAction\n  job: deploy-to-prod\n// after (job actually named)\n- !RunJobAction\n  job: Deploy to production","handlingStrategy":"validation","validationCode":"var spec = project.getBuildSpec(commit);\nif (spec == null || spec.getJobMap().get(jobName) == null)\n    throw new IllegalArgumentException(\"Job not defined: \" + jobName);","typeGuard":null,"tryCatchPattern":"try { action.validateWith(buildSpec, job); } catch (ValidationException e) { correctJobReference(e.getMessage()); }","preventionTips":["Copy job names verbatim from the build spec; names are case-sensitive.","Search the spec for renamed/deleted jobs when refactoring.","Use RunProjectJobAction or imports when the target job is in another project."],"tags":["job","not-found","buildspec","onedev"],"backgroundTag":"record-not-found","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}