theonedev/onedev · error · ExplicitException
No field spec found:
Error message
No field spec found:
What it means
GitHub issue import maps GitHub labels to OneDev issue fields. For each mapping the configured OneDev field name is looked up in the project's issue setting; if no FieldSpec with that name exists, importIssues aborts with this ExplicitException naming the missing field.
Source
Thrown at server-plugin/server-plugin-import-github/src/main/java/io/onedev/server/plugin/imports/github/ImportServer.java:253
ImportResult importIssues(String gitHubRepo, Project oneDevProject, IssueImportOption importOption,
Map<String, Optional<Long>> userIds, boolean dryRun, TaskLogger logger) {
Client client = newClient();
IssueService issueService = OneDev.getInstance(IssueService.class);
try {
Set<String> nonExistentIterations = new HashSet<>();
Set<String> nonExistentLogins = new HashSet<>();
Set<String> unmappedIssueLabels = new HashSet<>();
Map<String, Pair<FieldSpec, String>> labelMappings = new HashMap<>();
Map<String, Iteration> iterationMappings = new HashMap<>();
for (IssueLabelMapping mapping: importOption.getIssueLabelMappings()) {
String oneDevFieldName = StringUtils.substringBefore(mapping.getOneDevIssueField(), "::");
String oneDevFieldValue = StringUtils.substringAfter(mapping.getOneDevIssueField(), "::");
FieldSpec fieldSpec = getIssueSetting().getFieldSpec(oneDevFieldName);
if (fieldSpec == null)
throw new ExplicitException("No field spec found: " + oneDevFieldName);
labelMappings.put(mapping.getGitHubIssueLabel(), new Pair<>(fieldSpec, oneDevFieldValue));
}
for (Iteration iteration: oneDevProject.getIterations())
iterationMappings.put(iteration.getName(), iteration);
String initialIssueState = getIssueSetting().getInitialStateSpec().getName();
List<Issue> issues = new ArrayList<>();
Map<Long, Long> issueNumberMappings = new HashMap<>();
AtomicInteger numOfImportedIssues = new AtomicInteger(0);
PageDataConsumer pageDataConsumer = new PageDataConsumer() {
private String joinAsMultilineHtml(List<String> values) {
List<String> escapedValues = new ArrayList<>();
for (String value: values)View on GitHub (pinned to d44925c47c)
Solutions
- Open the project's Issue Settings and verify the exact field name exists
- Fix the oneDevIssueField value in the import option to match the field spec name (including the '::value' suffix)
- Create the missing custom field in Issue Settings if it is genuinely needed
- Re-run the import after correcting the mapping
Example fix
// before
new IssueLabelMapping("bug", "Bug Type::Defect") // no field 'Bug Type'
// after (field is named 'Type')
new IssueLabelMapping("bug", "Type::Defect") Defensive patterns
Strategy: validation
Validate before calling
var fieldSpecs = getIssueSetting().getFieldSpecs();
for (IssueLabelMapping m : importOption.getIssueLabelMappings()) {
String name = StringUtils.substringBefore(m.getOneDevIssueField(), "::");
if (fieldSpecs.stream().noneMatch(f -> f.getName().equals(name)))
throw new IllegalArgumentException("Unknown OneDev field in mapping: " + name);
} Try / catch
try { importServer.importIssues(...); } catch (ExplicitException e) { if (e.getMessage().startsWith("No field spec found")) { /* create/fix field then retry */ } else throw e; } Prevention
- Verify field names in Issue Settings match mapping strings exactly
- Re-validate saved import options after renaming/removing custom fields
- Copy import options only between projects with identical field sets
When it happens
Trigger: Running importIssues with an IssueLabelMapping whose oneDevIssueField (part before '::') does not match any field spec defined in the target project's issue settings.
Common situations: Typo in the field name in the import option; field was deleted or renamed in OneDev after the mapping was saved; copying import options between projects with different custom fields.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Duplicate issue field mapping (issue: %s, field: %s)
- No field spec found:
- Duplicate issue field mapping (issue: %s, field: %s)
- Http request failed (url: %s, status code: %d, error message
- Http request failed (status: %s)
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/a345272ab8b73d9a.
Report an issue: GitHub.