theonedev/onedev · error · ExplicitException
Param not found:
Error message
Param not found:
What it means
Thrown by ActionCondition.checkField when a field name in a field-operator criteria matches neither a built-in build field nor a job parameter spec. The condition references a parameter that the job does not define.
Source
Thrown at server-core/src/main/java/io/onedev/server/buildspec/job/action/condition/ActionCondition.java:218
if (operator != Is && operator != IsNot)
throw newOperatorException(fieldName, operator);
} else if (fieldName.equals(NAME_BRANCH) || fieldName.equals(NAME_TAG)) {
if (operator != Is && operator != IsNot && operator != IsEmpty && operator != IsNotEmpty)
throw newOperatorException(fieldName, operator);
} else if (fieldName.equals(NAME_PULL_REQUEST)) {
if (operator != IsEmpty && operator != IsNotEmpty)
throw newOperatorException(fieldName, operator);
} else if (fieldName.equals(NAME_AI_PULL_REQUEST)) {
if (operator != IsEmpty && operator != IsNotEmpty)
throw newOperatorException(fieldName, operator);
} else if (fieldName.equals(NAME_LOG)) {
if (operator != Contains)
throw newOperatorException(fieldName, operator);
} else if (job.getParamSpecMap().containsKey(fieldName)) {
if (operator != Is && operator != IsNot && operator != IsEmpty && operator != IsNotEmpty)
throw newOperatorException(fieldName, operator);
} else {
throw new ExplicitException("Param not found: " + fieldName);
}
}
private static ExplicitException newOperatorException(String fieldName, int operator) {
return new ExplicitException("Field '" + fieldName + "' is not applicable for operator '"
+ AntlrUtils.getLexerRuleName(ActionConditionLexer.ruleNames, operator) + "'");
}
public static String getRuleName(int rule) {
return AntlrUtils.getLexerRuleName(ActionConditionLexer.ruleNames, rule);
}
@Override
public String toStringWithoutParens() {
return criteria.toStringWithoutParens();
}
@OverrideView on GitHub (pinned to d44925c47c)
Solutions
- Add the parameter to the job's input spec so it exists in job.getParamSpecMap().
- Correct the field name spelling in the condition to match a defined param or built-in field.
- Use only allowed operators if the field exists but the combination is rejected (the sibling 'not applicable for operator' error).
Example fix
// before (job has no input named 'env') condition: env is production // after: define the input in the job spec inputs: - name: env type: choice items: [production, staging] // then the condition works condition: env is production
Defensive patterns
Strategy: validation
Validate before calling
Set<String> allowed = new HashSet<>(List.of("project","number","version","branch","tag"));
job.getParamSpecMap().keySet().forEach(allowed::add);
if (!allowed.contains(fieldName))
throw new IllegalArgumentException("Condition field '" + fieldName + "' is not a job param"); Try / catch
try {
ActionCondition.parse(text, job, build);
} catch (ExplicitException e) {
if (e.getMessage().startsWith("Param not found:")) {
// correct field name or add the param spec
} else throw e;
} Prevention
- Keep param specs and conditions in sync; grep conditions on param renames.
- Reference params by exact declared name.
- Review job spec diff for renamed inputs before merging.
When it happens
Trigger: A condition like 'paramName is value' where paramName is not defined in the job's input/param specs (job.getParamSpecMap() has no such key) and is not a known build field.
Common situations: Renaming a job input without updating conditions that reference it; typo in the param name; referencing params from a different job's spec.
Understand the failure class
Background: "Invalid query parameter" / "Failed to parse value of ...": fixing bad query string parameters across APIs — this error's family across 36 libraries.
Related errors
- Malformed action condition
- Unexpected operator:
- Param not found:
- Malformed build spec (import project: {0}, import revision:
- Build spec not defined (import project: {0}, import revision
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/efb39b603c0748bb.
Report an issue: GitHub.