theonedev/onedev · error · ExplicitException
Field not found: ${fieldName}
Error message
Field not found: ${fieldName} What it means
checkField (called during parsing of field-operator-value criteria) validates the field name against Project.QUERY_FIELDS and then against per-operator constraints; an unknown field name throws ExplicitException('Field not found: X') (operator mismatches get a separate message).
Source
Thrown at server-core/src/main/java/io/onedev/server/search/entity/project/ProjectQuery.java:268
} else {
projectSort.setDirection(sortField.getDefaultDirection());
}
projectSorts.add(projectSort);
}
return new ProjectQuery(projectCriteria, projectSorts);
} else {
return new ProjectQuery();
}
}
private static ExplicitException newOperatorException(String fieldName, int operator) {
return new ExplicitException("Field '" + fieldName + "' is not applicable for operator '" + getRuleName(operator) + "'");
}
public static void checkField(String fieldName, int operator) {
if (!Project.QUERY_FIELDS.contains(fieldName))
throw new ExplicitException("Field not found: " + fieldName);
switch (operator) {
case Contains:
if (!fieldName.equals(Project.NAME_DESCRIPTION))
throw newOperatorException(fieldName, operator);
break;
case Is:
case IsNot:
if (!fieldName.equals(Project.NAME_NAME)
&& !fieldName.equals(Project.NAME_ID)
&& !fieldName.equals(Project.NAME_KEY)
&& !fieldName.equals(Project.NAME_LABEL)
&& !fieldName.equals(Project.NAME_SERVICE_DESK_EMAIL_ADDRESS)
&& !fieldName.equals(Project.NAME_PATH)) {
throw newOperatorException(fieldName, operator);
}
break;
case IsGreaterThan:
case IsLessThan:View on GitHub (pinned to d44925c47c)
Solutions
- Use a field in Project.QUERY_FIELDS (e.g. "name", "name description", "last activity").
- Fix spelling/quotes; field names in queries must match the lexer keywords exactly.
- Catch ExplicitException and list valid fields in the error surfaced to the user.
- Call ProjectQuery.checkField(fieldName, operator) in your own code to validate before building queries.
Example fix
// before "titel == \"foo\"" // typo // after "name == \"foo\""
Defensive patterns
Strategy: validation
Validate before calling
try { ProjectQuery.checkField(fieldName, operator); } catch (ExplicitException e) { /* invalid field */ } Type guard
null
Try / catch
try { q = ProjectQuery.parse(text); } catch (ExplicitException e) { showFieldHints(Project.QUERY_FIELDS); } Prevention
- Use exact field names from Project.QUERY_FIELDS
- Validate fields at query save time
- Do not reuse field names from other entity queries
- Catch ExplicitException and suggest valid fields
When it happens
Trigger: A project query criterion like "nonexistent == \"x\"" where the field name is not in Project.QUERY_FIELDS; also hit indirectly whenever visitFieldOperatorValueCriteria processes each parsed criterion.
Common situations: Typos in field names; using fields from issue/pull-request queries in project queries; renamed fields across OneDev upgrades.
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
- Unexpected operator: ${operator}
- Unexpected operator ${operator}
- Invalid number: ${value}
- Invalid decimal: ${value}
- Invalid reference number: <numberString>
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/615038f3e9a4e3f6.
Report an issue: GitHub.