{"record":{"id":"163d8b300e88722d","repo":"theonedev/onedev","slug":"error-validating-job-parameters-job-s-error-me","errorCode":null,"errorMessage":"Error validating job parameters (job: %s, error message: %s)","messagePattern":"Error validating job parameters \\(job: (.+?), error message: (.+?)\\)","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/buildspec/job/action/RunJobAction.java","lineNumber":148,"sourceCode":"\t@Override\n\tpublic String getDescription() {\n\t\treturn \"Run job '\" + jobName + \"'\";\n\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":130,"sourceCodeEnd":156,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/buildspec/job/action/RunJobAction.java#L130-L156","documentation":"RunJobAction.validateWith checks that the job to run exists and that its paramMatrix / excludeParamMaps conform to the job's parameter specs (ParamUtils.validateParamMatrix / validateParamMap). Any ValidationException is rewrapped as 'Error validating job parameters (job: %s, error message: %s)' with the job name and underlying message.","triggerScenarios":"validateWith runs and ParamUtils validation rejects the paramMatrix or an excludeParamMap — required param missing, value outside the spec's allowed values/show condition, unknown param name, or secret/dependency constraints violated.","commonSituations":"Target job's params renamed or made required after the action was authored; providing a value not in a choice parameter's list; matrix values with wrong keys; excludeParamMaps referencing params that no longer exist.","solutions":["Fix the parameter named in the wrapped message on the RunJobAction (paramMatrix/excludeParamMaps) to match the target job's current param specs.","Open the target job's definition and align param names and allowed values with its paramSpecs.","If the target job changed, update both the action's params and any exclude maps."],"exampleFix":"// before\nparamMatrix:\n  env:\n  - produktion   # typo, not in choice list\n// after\nparamMatrix:\n  env:\n  - production","handlingStrategy":"validation","validationCode":"// Check matrix keys against the target job's param specs\nvar specs = jobToRun.getParamSpecs();\nparamMatrix.keySet().forEach(name -> {\n    if (specs.stream().noneMatch(s -> s.getName().equals(name)))\n        throw new IllegalArgumentException(\"Unknown param: \" + name);\n});","typeGuard":null,"tryCatchPattern":"try { action.validateWith(buildSpec, job); } catch (ValidationException e) { alignParamsWithJob(e.getMessage()); }","preventionTips":["Re-check RunJobAction params after changing the target job's paramSpecs.","Only supply choice values that exist in the param's list of values.","Keep param names in sync via shared constants or copy-paste from the job definition."],"tags":["validation","job-parameters","buildspec","onedev"],"backgroundTag":"invalid-argument-value","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"}