{"record":{"id":"4f6fd98bf5e7bdb5","repo":"theonedev/onedev","slug":"param-not-found-4f6fd9","errorCode":null,"errorMessage":"Param not found: ","messagePattern":"Param not found: ","errorType":"validation","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/buildspec/job/retrycondition/RetryCondition.java","lineNumber":155,"sourceCode":"\t\t\t\t@Override\n\t\t\t\tpublic Criteria<RetryContext> visitNotCriteria(NotCriteriaContext ctx) {\n\t\t\t\t\treturn new NotCriteria<RetryContext>(visit(ctx.criteria()));\n\t\t\t\t}\n\t\n\t\t\t}.visit(conditionContext.criteria());\n\t\t}\n\t\treturn new RetryCondition(criteria);\n\t}\n\t\n\tpublic static void checkField(Job job, String fieldName, int operator) {\n\t\tif (fieldName.equals(NAME_LOG)) {\n\t\t\tif (operator != Contains)\n\t\t\t\tthrow newOperatorException(fieldName, operator);\n\t\t} else if (job.getParamSpecMap().containsKey(fieldName)) {\n\t\t\tif (operator != IsEmpty && operator != Is && operator != IsNotEmpty && operator != IsNot)\n\t\t\t\tthrow newOperatorException(fieldName, operator);\n\t\t} else {\n\t\t\tthrow new ExplicitException(\"Param not found: \" + fieldName);\n\t\t}\t\t\t\t\n\t}\n\t\n\tpublic static String getRuleName(int rule) {\n\t\treturn AntlrUtils.getLexerRuleName(RetryConditionLexer.ruleNames, rule);\n\t}\n\t\n\tprivate static ExplicitException newOperatorException(String fieldName, int operator) {\n\t\treturn new ExplicitException(\"Field '\" + fieldName + \"' is not applicable for operator '\" \n\t\t\t\t+ AntlrUtils.getLexerRuleName(RetryConditionLexer.ruleNames, operator) + \"'\");\n\t}\n\n\t@Override\n\tpublic String toStringWithoutParens() {\n\t\treturn criteria.toStringWithoutParens();\n\t}\n\t\t\n}","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/buildspec/job/retrycondition/RetryCondition.java#L137-L173","documentation":"Thrown by RetryCondition.checkField when a field in the retry condition matches neither a built-in retry field (e.g. error message, failure reason, attempt) nor a job parameter spec. Same pattern as the action-condition checkField but for retry conditions.","triggerScenarios":"A retry condition references a field/param name not present in job.getParamSpecMap() and not a recognized retry field — e.g. a renamed input or a typo in the condition text.","commonSituations":"Renaming job inputs without updating retry conditions; typo in param name; assuming arbitrary build fields are usable in retry conditions.","solutions":["Add the missing input to the job's param spec.","Correct the field name spelling in the retry condition.","Use only built-in retry fields or defined job params; check allowed operators for params (Is, IsNot, IsEmpty, IsNotEmpty)."],"exampleFix":"// before\nretry condition: enviroment is production\n\n// after (param actually defined)\nretry condition: environment is production","handlingStrategy":"validation","validationCode":"Set<String> allowed = new HashSet<>(List.of(\"error message\",\"failure reason\",\"attempt\"));\njob.getParamSpecMap().keySet().forEach(allowed::add);\nif (!allowed.contains(fieldName))\n    throw new IllegalArgumentException(\"Retry field '\" + fieldName + \"' is not a known field or job param\");","typeGuard":null,"tryCatchPattern":"try {\n    RetryCondition.parse(text);\n} catch (ExplicitException e) {\n    if (e.getMessage().startsWith(\"Param not found:\")) {\n        // fix field name or add the input spec\n    } else throw e;\n}","preventionTips":["Use only documented retry-condition fields plus defined job params.","Grep retry conditions whenever inputs are renamed.","Keep param naming consistent across jobs to reduce copy-paste typos."],"tags":["onedev","retry-condition","job-params","buildspec"],"backgroundTag":"invalid-query-parameter","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"}