theonedev/onedev · error · ValidationException

Missing job parameter (

Error message

Missing job parameter (

What it means

Thrown by ParamUtils.validateParamNames when a parameter declared in the job's param specs has no corresponding entry in the supplied parameter names (map or matrix). Every defined job parameter must be provided a value; a missing one would leave the job runnable configuration incomplete.

Source

Thrown at server-core/src/main/java/io/onedev/server/buildspec/param/ParamUtils.java:99

				for (String each: paramValue) {
					if (each.startsWith(SecretInput.LITERAL_VALUE_PREFIX))
						displayValue.add(SecretInput.MASK);
					else
						displayValue.add(each);
				}
			} else {
				displayValue = paramValue;
			}
			String errorMessage = String.format("Error validating param value (param: %s, value: %s, error message: %s", 
					paramName, displayValue, e.getMessage() != null? e.getMessage(): e.getClass());
			throw new ValidationException(errorMessage);
		}
	}

	private static void validateParamNames(Collection<String> paramSpecNames, Collection<String> paramNames) {
		for (String paramSpecName: paramSpecNames) {
			if (!paramNames.contains(paramSpecName))
				throw new ValidationException("Missing job parameter (" + paramSpecName + ")");
		}
		for (String paramName: paramNames) {
			if (!paramSpecNames.contains(paramName))
				throw new ValidationException("Unknown job parameter (" + paramName + ")");
		}
	}
	
	public static void validateParamMap(List<ParamSpec> paramSpecs, Map<String, List<String>> paramMap) {
		Map<String, ParamSpec> paramSpecMap = ParamUtils.getParamSpecMap(paramSpecs);
		validateParamNames(paramSpecMap.keySet(), paramMap.keySet());
		for (Map.Entry<String, List<String>> entry: paramMap.entrySet()) {
			if (entry.getValue() != null) {
				ParamSpec paramSpec = Preconditions.checkNotNull(paramSpecMap.get(entry.getKey()));
				validateParamValue(paramSpec, entry.getKey(), entry.getValue());
			}
		}
	}
	

View on GitHub (pinned to d44925c47c)

Solutions

  1. Add a value entry for the missing parameter (name in the message is inside parentheses)
  2. Remove the parameter from the job spec if it is no longer needed
  3. Update job dependencies/triggers that pass params to include the new parameter

Example fix

// before: params supplied: os only; spec has os, version
params: {os: ubuntu}
// after
params: {os: ubuntu, version: "1.0"}
Defensive patterns

Strategy: validation

Validate before calling

Set<String> specNames = paramSpecs.stream().map(ParamSpec::getName).collect(Collectors.toSet());
Set<String> given = paramMap.keySet();
Set<String> missing = new HashSet<>(specNames); missing.removeAll(given);
if (!missing.isEmpty()) throw new IllegalArgumentException("missing params: " + missing);

Try / catch

try { ParamUtils.validateParamMap(specs, paramMap); } catch (ValidationException e) { /* extract 'Missing job parameter (name)' and add entry */ }

Prevention

When it happens

Trigger: Calling validateParamMatrix or validateParamMap where paramSpecs contains a name absent from the param names collection — e.g. job defines param 'version' but the param map/matrix only supplies 'os'.

Common situations: Adding a new parameter to the job but forgetting to add it to run/trigger param values; renaming a parameter in the spec without updating callers (job dependencies, scheduled crons, triggers passing params).

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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