theonedev/onedev · error · ValidationException
Error validating job parameters (job: %s, error message: %s)
Error message
Error validating job parameters (job: %s, error message: %s)
What it means
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.
Source
Thrown at server-core/src/main/java/io/onedev/server/buildspec/job/action/RunJobAction.java:148
@Override
public String getDescription() {
return "Run job '" + jobName + "'";
}
@Override
public void validateWith(BuildSpec buildSpec, Job job) {
super.validateWith(buildSpec, job);
Job jobToRun = buildSpec.getJobMap().get(jobName);
if (jobToRun != null) {
try {
ParamUtils.validateParamMatrix(jobToRun.getParamSpecs(), paramMatrix);
for (var exludeParamMap: excludeParamMaps)
ParamUtils.validateParamMap(jobToRun.getParamSpecs(), exludeParamMap.getParams());
} catch (ValidationException e) {
String errorMessage = String.format("Error validating job parameters (job: %s, error message: %s)",
jobToRun.getName(), e.getMessage());
throw new ValidationException(errorMessage);
}
} else {
throw new ValidationException("Job not found (" + jobName + ")");
}
}
}
View on GitHub (pinned to d44925c47c)
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.
Example fix
// before paramMatrix: env: - produktion # typo, not in choice list // after paramMatrix: env: - production
Defensive patterns
Strategy: validation
Validate before calling
// Check matrix keys against the target job's param specs
var specs = jobToRun.getParamSpecs();
paramMatrix.keySet().forEach(name -> {
if (specs.stream().noneMatch(s -> s.getName().equals(name)))
throw new IllegalArgumentException("Unknown param: " + name);
}); Try / catch
try { action.validateWith(buildSpec, job); } catch (ValidationException e) { alignParamsWithJob(e.getMessage()); } Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- Error validating issue fields:
- State is required
- Issue ${issueReference} is not in current project
- Pull request submitter cannot be reviewer
- Job name is required
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/163d8b300e88722d.
Report an issue: GitHub.