theonedev/onedev · error · ExplicitException

Param not found:

Error message

Param not found: 

What it means

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.

Source

Thrown at server-core/src/main/java/io/onedev/server/buildspec/job/retrycondition/RetryCondition.java:155

				@Override
				public Criteria<RetryContext> visitNotCriteria(NotCriteriaContext ctx) {
					return new NotCriteria<RetryContext>(visit(ctx.criteria()));
				}
	
			}.visit(conditionContext.criteria());
		}
		return new RetryCondition(criteria);
	}
	
	public static void checkField(Job job, String fieldName, int operator) {
		if (fieldName.equals(NAME_LOG)) {
			if (operator != Contains)
				throw newOperatorException(fieldName, operator);
		} else if (job.getParamSpecMap().containsKey(fieldName)) {
			if (operator != IsEmpty && operator != Is && operator != IsNotEmpty && operator != IsNot)
				throw newOperatorException(fieldName, operator);
		} else {
			throw new ExplicitException("Param not found: " + fieldName);
		}				
	}
	
	public static String getRuleName(int rule) {
		return AntlrUtils.getLexerRuleName(RetryConditionLexer.ruleNames, rule);
	}
	
	private static ExplicitException newOperatorException(String fieldName, int operator) {
		return new ExplicitException("Field '" + fieldName + "' is not applicable for operator '" 
				+ AntlrUtils.getLexerRuleName(RetryConditionLexer.ruleNames, operator) + "'");
	}

	@Override
	public String toStringWithoutParens() {
		return criteria.toStringWithoutParens();
	}
		
}

View on GitHub (pinned to d44925c47c)

Solutions

  1. Add the missing input to the job's param spec.
  2. Correct the field name spelling in the retry condition.
  3. Use only built-in retry fields or defined job params; check allowed operators for params (Is, IsNot, IsEmpty, IsNotEmpty).

Example fix

// before
retry condition: enviroment is production

// after (param actually defined)
retry condition: environment is production
Defensive patterns

Strategy: validation

Validate before calling

Set<String> allowed = new HashSet<>(List.of("error message","failure reason","attempt"));
job.getParamSpecMap().keySet().forEach(allowed::add);
if (!allowed.contains(fieldName))
    throw new IllegalArgumentException("Retry field '" + fieldName + "' is not a known field or job param");

Try / catch

try {
    RetryCondition.parse(text);
} catch (ExplicitException e) {
    if (e.getMessage().startsWith("Param not found:")) {
        // fix field name or add the input spec
    } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: Renaming job inputs without updating retry conditions; typo in param name; assuming arbitrary build fields are usable in retry conditions.

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


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