theonedev/onedev · error · ValidationException

Error validating param value (param: %s, value: %s, error me

Error message

Error validating param value (param: %s, value: %s, error message: %s

What it means

A wrapping error from ParamUtils.validateParamValue: any exception raised while converting/validating a single param value (via paramSpec.convertToObject) is reformatted with the param name, the display value, and the original message or exception class. Note the message string has an unbalanced open parenthesis (missing closing ')'). It indicates the raw value failed type/range validation for that param spec.

Source

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

		} catch (Exception e) {
			if (e.getMessage() == null)
				logger.error("Error validating field value", e);
			
			List<String> displayValue;
			if (paramSpec instanceof SecretParam) {
				displayValue = new ArrayList<>();
				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()) {

View on GitHub (pinned to d44925c47c)

Solutions

  1. Check the embedded 'error message' for the underlying conversion failure
  2. Fix the value to match the param's declared type and choices
  3. For choice params, use one of the values listed in the param spec

Example fix

// before: Error validating param value (param: parallel, value: yeses, error message: ...
// after
- name: parallel
  type: boolean
  value: "true"
Defensive patterns

Strategy: validation

Validate before calling

// validate each value against the spec type before submission
Object converted = paramSpec.convertToObject(value); // throws with details if invalid

Try / catch

try { ParamUtils.validateParamMap(specs, params); } catch (ValidationException e) { /* message contains param, value and root cause; log and surface */ }

Prevention

When it happens

Trigger: Calling validateParamValue (via validateParamMatrix or validateParamMap) with a value that paramSpec.convertToObject rejects — e.g. a non-boolean string for a boolean param, a number out of range, or a choice value not in the allowed choices.

Common situations: Typo in a choice value; wrong type for a typed param (number/boolean/date); secret validation failure wrapped here too (error 173); BuildSpec saved with mismatched value formats.

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


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