theonedev/onedev · error · ValidationException
Error validating issue fields:
Error message
Error validating issue fields:
What it means
CreateIssueAction.validateWith validates the action's issueFields against the fields defined in the global issue setting (FieldUtils.validateFields). On ValidationException it rethrows with the prefix 'Error validating issue fields:' plus the underlying message, so the build spec author knows their issue field values/inputs do not match the issue field specifications.
Source
Thrown at server-core/src/main/java/io/onedev/server/buildspec/job/action/CreateIssueAction.java:130
OneDev.getInstance(IssueService.class).open(issue);
});
}
@Override
public String getDescription() {
return "Create issue";
}
@Override
public void validateWith(BuildSpec buildSpec, Job job) {
super.validateWith(buildSpec, job);
GlobalIssueSetting issueSetting = OneDev.getInstance(SettingService.class).getIssueSetting();
try {
FieldUtils.validateFields(issueSetting.getFieldSpecMap(getFieldNames()), issueFields);
} catch (ValidationException e) {
throw new ValidationException("Error validating issue fields: " + e.getMessage());
}
}
}
View on GitHub (pinned to d44925c47c)
Solutions
- Fix the field named in the appended validation message to match the field spec (correct name, type, and allowed values).
- Check Administration > Issue Settings > Custom Fields for the current field names and choice values.
- Update the action after any change to issue custom fields so it references still-existing fields.
Example fix
// before: unknown field / bad choice issueFields: Priority: Highest // after (matches setting choices) issueFields: Priority: Critical
Defensive patterns
Strategy: validation
Validate before calling
// Compare action fields against current issue settings
var specMap = OneDev.getInstance(SettingService.class).getIssueSetting().getFieldSpecMap();
issueFields.keySet().forEach(name -> {
if (!specMap.containsKey(name)) throw new IllegalArgumentException("Unknown issue field: " + name);
}); Try / catch
try { action.validateWith(buildSpec, job); } catch (ValidationException e) { fixIssueFields(e.getMessage()); } Prevention
- Review CreateIssueAction configs whenever issue custom fields are renamed or removed.
- Use exact choice values as configured in issue settings.
- Validate the build spec in the editor before pushing.
When it happens
Trigger: validateWith(buildSpec, job) is invoked during build spec validation and FieldUtils.validateFields rejects issueFields — e.g. a required issue field is missing, a value violates the field type/choice list, or an unknown field name is supplied.
Common situations: Issue settings changed (field removed/renamed or choice value deleted) after the action was written; typo in a field name; supplying a string where a date/user/enum field is expected; field made mandatory later.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- Error validating job parameters (job: %s, error message: %s)
- No permission to update issue fields
- State is required
- Issue ${issueReference} is not in current project
- Pull request submitter cannot be reviewer
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/ccd157d86d9a80e8.
Report an issue: GitHub.