{"record":{"id":"cc994b838f750d67","repo":"theonedev/onedev","slug":"error-validating-param-value-param-s-value-s","errorCode":null,"errorMessage":"Error validating param value (param: %s, value: %s, error message: %s","messagePattern":"Error validating param value \\(param: (.+?), value: (.+?), error message: (.+?)","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/buildspec/param/ParamUtils.java","lineNumber":92,"sourceCode":"\t\t} catch (Exception e) {\n\t\t\tif (e.getMessage() == null)\n\t\t\t\tlogger.error(\"Error validating field value\", e);\n\t\t\t\n\t\t\tList<String> displayValue;\n\t\t\tif (paramSpec instanceof SecretParam) {\n\t\t\t\tdisplayValue = new ArrayList<>();\n\t\t\t\tfor (String each: paramValue) {\n\t\t\t\t\tif (each.startsWith(SecretInput.LITERAL_VALUE_PREFIX))\n\t\t\t\t\t\tdisplayValue.add(SecretInput.MASK);\n\t\t\t\t\telse\n\t\t\t\t\t\tdisplayValue.add(each);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdisplayValue = paramValue;\n\t\t\t}\n\t\t\tString errorMessage = String.format(\"Error validating param value (param: %s, value: %s, error message: %s\", \n\t\t\t\t\tparamName, displayValue, e.getMessage() != null? e.getMessage(): e.getClass());\n\t\t\tthrow new ValidationException(errorMessage);\n\t\t}\n\t}\n\n\tprivate static void validateParamNames(Collection<String> paramSpecNames, Collection<String> paramNames) {\n\t\tfor (String paramSpecName: paramSpecNames) {\n\t\t\tif (!paramNames.contains(paramSpecName))\n\t\t\t\tthrow new ValidationException(\"Missing job parameter (\" + paramSpecName + \")\");\n\t\t}\n\t\tfor (String paramName: paramNames) {\n\t\t\tif (!paramSpecNames.contains(paramName))\n\t\t\t\tthrow new ValidationException(\"Unknown job parameter (\" + paramName + \")\");\n\t\t}\n\t}\n\t\n\tpublic static void validateParamMap(List<ParamSpec> paramSpecs, Map<String, List<String>> paramMap) {\n\t\tMap<String, ParamSpec> paramSpecMap = ParamUtils.getParamSpecMap(paramSpecs);\n\t\tvalidateParamNames(paramSpecMap.keySet(), paramMap.keySet());\n\t\tfor (Map.Entry<String, List<String>> entry: paramMap.entrySet()) {","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/buildspec/param/ParamUtils.java#L74-L110","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the embedded 'error message' for the underlying conversion failure","Fix the value to match the param's declared type and choices","For choice params, use one of the values listed in the param spec"],"exampleFix":"// before: Error validating param value (param: parallel, value: yeses, error message: ...\n// after\n- name: parallel\n  type: boolean\n  value: \"true\"","handlingStrategy":"validation","validationCode":"// validate each value against the spec type before submission\nObject converted = paramSpec.convertToObject(value); // throws with details if invalid","typeGuard":null,"tryCatchPattern":"try { ParamUtils.validateParamMap(specs, params); } catch (ValidationException e) { /* message contains param, value and root cause; log and surface */ }","preventionTips":["Match value format to the declared param type (boolean/number/choice)","For choice params use exactly the listed choices","Validate the buildspec after editing params, before committing"],"tags":["validation","params","buildspec"],"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"}