theonedev/onedev · error · ValidationException

Error validating dependency job parameters (dependency job:

Error message

Error validating dependency job parameters (dependency job: %s, error message: %s)

What it means

When a job's dependency specifies a paramMatrix or excludeParamMaps that do not validate against the dependency job's paramSpecs, checkDependencies throws ValidationException 'Error validating dependency job parameters (dependency job: <name>, error message: <cause>)'. The dependency job name and underlying cause are embedded in the message.

Source

Thrown at server-core/src/main/java/io/onedev/server/buildspec/BuildSpec.java:538

	}
	
	private void checkDependencies(Job job, List<String> dependencyChain) {
		for (JobDependency dependency: job.getJobDependencies()) {
			if (dependencyChain.contains(dependency.getJobName())) {
				dependencyChain.add(dependency.getJobName());
				throw new ValidationException("Circular dependencies (" + dependencyChain + ")");
			} else {
				Job dependencyJob = getJobMap().get(dependency.getJobName());
				if (dependencyJob != null) {
					if (dependencyChain.isEmpty()) {
						try {
							ParamUtils.validateParamMatrix(dependencyJob.getParamSpecs(), dependency.getParamMatrix());
							for (var paramMap: dependency.getExcludeParamMaps())
								ParamUtils.validateParamMap(dependencyJob.getParamSpecs(), paramMap.getParams());
						} catch (ValidationException e) {
							String message = String.format("Error validating dependency job parameters (dependency job: %s, error message: %s)", 
									dependencyJob.getName(), e.getMessage());
							throw new ValidationException(message);
						}
					}
					List<String> newDependencyChain = new ArrayList<>(dependencyChain);
					newDependencyChain.add(dependency.getJobName());
					checkDependencies(dependencyJob, newDependencyChain);
				} else if (dependencyChain.isEmpty()) {
					throw new ValidationException("Dependency job not found (" + dependency.getJobName() + ")");
				}
			}
		}
	}
		
	@Nullable
	public static BuildSpec get() {
		BuildSpecAware buildSpecAware = HierarchicalContext.get().findData(BuildSpecAware.class);
		if (buildSpecAware != null) 
			return buildSpecAware.getBuildSpec();
		else

View on GitHub (pinned to d44925c47c)

Solutions

  1. Fix the paramMatrix in the jobDependencies entry to match the dependency job's declared paramSpecs
  2. Update the dependency job's paramSpecs if the new usage is intended
  3. Remove unknown parameters or fix choice values per the dependency job's spec
  4. Validate in the build spec editor, which flags parameter mismatches per job dependency

Example fix

# before: dependency job has no param 'version'
jobDependencies:
- jobName: build
  paramMatrix:
    version: '1.0'
# after
jobDependencies:
- jobName: build
  paramMatrix:
    release: '1.0'   # matches declared paramSpecs
Defensive patterns

Strategy: validation

Validate before calling

var depJob = buildSpec.getJobMap().get(dep.getJobName());
ParamUtils.validateParamMatrix(depJob.getParamSpecs(), dep.getParamMatrix());

Try / catch

try {
    buildSpec.isValid();
} catch (ValidationException e) {
    // message names the dependency job and the param error; align the paramMatrix
}

Prevention

When it happens

Trigger: A jobDependencies entry with a paramMatrix containing parameters the dependent job does not declare, missing required params, invalid choice values, or excludeParamMaps with unknown param names; only validated at the outermost level (empty chain).

Common situations: Changing a dependency job's paramSpecs after other jobs already reference it with the old param set; typos in parameter names in the dependency block; providing params to a job that takes none.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06). Data as JSON: /api/errors/2d13190826f866c7. Report an issue: GitHub.