{"record":{"id":"e71d1553914ea492","repo":"theonedev/onedev","slug":"error-validating-param-values-param-s-error-me","errorCode":null,"errorMessage":"Error validating param values (param: %s, error message: %s)","messagePattern":"Error validating param values \\(param: (.+?), error message: (.+?)\\)","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/buildspec/param/ParamUtils.java","lineNumber":54,"sourceCode":"\t\tfor (List<String> value: values) {\n\t\t\tif (encountered.contains(value)) \n\t\t\t\tthrow new ValidationException(\"Duplicate values not allowed\");\n\t\t\telse \n\t\t\t\tencountered.add(value);\n\t\t}\n\t}\n\t\n\tprivate static void validateParamMatrix(List<ParamSpec> paramSpecs, Map<String, List<List<String>>> paramMatrix) {\n\t\tMap<String, ParamSpec> paramSpecMap = ParamUtils.getParamSpecMap(paramSpecs);\n\t\tvalidateParamNames(paramSpecMap.keySet(), paramMatrix.keySet());\n\t\tfor (Map.Entry<String, List<List<String>>> entry: paramMatrix.entrySet()) {\n\t\t\tif (entry.getValue() != null) {\n\t\t\t\ttry {\n\t\t\t\t\tvalidateParamValues(entry.getValue());\n\t\t\t\t} catch (ValidationException e) {\n\t\t\t\t\tString errorMessage = String.format(\"Error validating param values (param: %s, error message: %s)\", \n\t\t\t\t\t\t\tentry.getKey(), e.getMessage());\n\t\t\t\t\tthrow new ValidationException(errorMessage);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tParamSpec paramSpec = Preconditions.checkNotNull(paramSpecMap.get(entry.getKey()));\n\t\t\t\tfor (List<String> value: entry.getValue()) \n\t\t\t\t\tvalidateParamValue(paramSpec, entry.getKey(), value);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tprivate static void validateParamValue(ParamSpec paramSpec, String paramName, List<String> paramValue) {\n\t\ttry {\n\t\t\tObject object = paramSpec.convertToObject(paramValue);\n\t\t\tif (paramSpec instanceof SecretParam && object != null \n\t\t\t\t\t&& !((String)object).startsWith(SecretInput.LITERAL_VALUE_PREFIX)) {\n\t\t\t\tif (!Project.get().getHierarchyJobSecrets().stream()\n\t\t\t\t\t\t.anyMatch(it->it.getName().equals(object))) {\n\t\t\t\t\tthrow new ValidationException(\"Secret not found\");\n\t\t\t\t}","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/buildspec/param/ParamUtils.java#L36-L72","documentation":"This is a wrapping error: when validateParamValues fails for a specific parameter, validateParamMatrix catches the ValidationException and rethrows it with the parameter name and the original message embedded. It tells you which param in the matrix failed and why (empty values or duplicates).","triggerScenarios":"Calling ParamUtils.validateParamMatrix where one entry of the paramMatrix map has a null/empty values list or duplicate combinations; the inner ValidationException message is formatted into this one.","commonSituations":"BuildSpec validation during job run or save; a single misconfigured parameter among many; nested error originally from errors 170/171.","solutions":["Read the embedded 'param' name and 'error message' to find the offending parameter","Fix the underlying values list (non-empty, no duplicates) for that param","Re-run buildspec validation"],"exampleFix":"// reported: Error validating param values (param: version, error message: At least one value needs to be specified)\n// after\nparams:\n  - name: version\n    values: [\"1.0\"]","handlingStrategy":"try-catch","validationCode":"paramMatrix.forEach((name, vals) -> { if (vals == null || vals.isEmpty()) throw new IllegalArgumentException(\"param \" + name + \" has no values\"); });","typeGuard":null,"tryCatchPattern":"try { ParamUtils.validateParamMatrix(paramSpecs, params); } catch (ValidationException e) { /* parse embedded param name from message and surface to user */ }","preventionTips":["Validate each param's values individually before matrix validation","Keep error messages of nested ValidationException in logs for diagnosis","Test buildspec changes with job validation endpoint"],"tags":["validation","buildspec","params"],"backgroundTag":"invalid-config-value","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}