theonedev/onedev · error · ExplicitException

Duplicate issue field mapping (issue: %s, field: %s)

Error message

Duplicate issue field mapping (issue: %s, field: %s)

What it means

Thrown while consuming a YouTrack issue: the importer collects each issue field as name::value and requires uniqueness; if the same field name and value appears twice on one YouTrack issue, the generated OneDev field mapping would be ambiguous, so it aborts with this ExplicitException naming the issue and duplicated field::value.

Source

Thrown at server-plugin/server-plugin-import-youtrack/src/main/java/io/onedev/server/plugin/imports/youtrack/ImportServer.java:966

										nonExistentLogins.add(login);
									}
								} else {
									issue.setSubmitter(SecurityUtils.getAuthUser());
								}
								issue.getComments().add(comment);
							}
						}

						issue.setCommentCount(issue.getComments().size());

						Set<String> fieldAndValues = new HashSet<>();
						for (IssueField field : issue.getFields()) {
							String fieldAndValue = field.getName() + "::" + field.getValue();
							if (!fieldAndValues.add(fieldAndValue)) {
								String errorMessage = String.format(
										"Duplicate issue field mapping (issue: %s, field: %s)",
										readableId, fieldAndValue);
								throw new ExplicitException(errorMessage);
							}
						}

						if (!extraIssueInfo.isEmpty()) {
							StringBuilder builder = new StringBuilder("|");
							for (String key : extraIssueInfo.keySet())
								builder.append(key).append("|");
							builder.append("\n|");
							extraIssueInfo.keySet().stream().forEach(it -> builder.append("---|"));
							builder.append("\n|");
							for (String value : extraIssueInfo.values())
								builder.append(value).append("|");

							if (issue.getDescription() != null)
								issue.setDescription(builder.toString() + "\n\n" + issue.getDescription());
							else
								issue.setDescription(builder.toString());
						}

View on GitHub (pinned to d44925c47c)

Solutions

  1. Fix the source YouTrack issue by removing the duplicated custom field on the project or issue.
  2. Check the YouTrack project's custom field configuration for duplicated field attachments and remove one.
  3. Delete/merge the affected YouTrack issue duplicates before importing.
  4. Re-run the import after cleaning the YouTrack data.
Defensive patterns

Strategy: validation

Validate before calling

// detect duplicate field name::value on the YouTrack issue before import
Set<String> seen = new HashSet<>();
for (IssueField f : issue.getFields()) {
    if (!seen.add(f.getName() + "::" + f.getValue()))
        logger.warn("Issue {} has duplicate field {}::{}", issue.getIdReadable(), f.getName(), f.getValue());
}

Try / catch

try { importServer.importIssues(...); } catch (ExplicitException e) { logger.error("Duplicate YouTrack field on issue: {}", e.getMessage()); }

Prevention

When it happens

Trigger: A YouTrack issue carries two fields with identical name and value (possible after YouTrack project merges, duplicate custom fields attached to the same project, or a field appearing both project-level and issue-level), and the consumer thread processes that issue.

Common situations: YouTrack custom field added to a project twice (e.g. 'Priority' as both project and regular field); issues moved between projects retaining stale field duplicates; YouTrack data corruption after migration.

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


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