theonedev/onedev · error · ExplicitException
Unable to find YouTrack project:
Error message
Unable to find YouTrack project:
What it means
Thrown by the YouTrack importer when the YouTrack project name specified in the import settings cannot be found among the projects returned by the YouTrack API. buildImportOption iterates fetched project nodes; if none matches the requested name, it aborts with this ExplicitException.
Source
Thrown at server-plugin/server-plugin-import-youtrack/src/main/java/io/onedev/server/plugin/imports/youtrack/ImportServer.java:222
ImportOption buildImportOption(String project, boolean populateTagMappings) {
Client client = newClient();
try {
String apiEndpoint = getApiEndpoint("/admin/projects?fields=id,name,customFields(field(name),bundle(values(name)))");
for (JsonNode projectNode : list(client, apiEndpoint, new TaskLogger() {
@Override
public void log(String message, String sessionId) {
logger.info(message);
}
})) {
if (project.equals(projectNode.get("name").asText())) {
List<JsonNode> projectNodes = new ArrayList<>();
projectNodes.add(projectNode);
return buildImportOption(projectNodes, populateTagMappings);
}
}
throw new ExplicitException("Unable to find YouTrack project: " + project);
} finally {
client.close();
}
}
ImportOption buildImportOption(Collection<JsonNode> projectNodes, boolean populateTagMappings) {
ImportOption option = new ImportOption();
Client client = newClient();
try {
Set<String> youTrackIssueStates = new LinkedHashSet<>();
Set<String> youTrackIssueFields = new LinkedHashSet<>();
for (JsonNode projectNode : projectNodes) {
for (JsonNode customFieldNode : projectNode.get("customFields")) {
String fieldName = customFieldNode.get("field").get("name").asText();
JsonNode bundleNode = customFieldNode.get("bundle");
if (bundleNode != null) {
String bundleType = bundleNode.get("$type").asText();View on GitHub (pinned to d44925c47c)
Solutions
- Re-generate the import settings so the project list is refreshed from YouTrack and re-pick the project.
- Verify the exact project name in YouTrack (check case and trailing spaces).
- Ensure the YouTrack token's permissions include visibility of that project.
- Restore/unarchive the project in YouTrack if it was archived.
Example fix
// before youTrackProject: "Old App" // after: exact current YouTrack project name youTrackProject: "Old App (Archived)"
Defensive patterns
Strategy: validation
Validate before calling
// confirm the YouTrack project exists before importing
List<JsonNode> projects = listYouTrackProjects(client);
boolean found = projects.stream()
.anyMatch(p -> p.get("name").asText().equals(youTrackProjectName));
if (!found) throw new IllegalArgumentException("YouTrack project not found: " + youTrackProjectName); Try / catch
try { option = importServer.newSetting(...); } catch (ExplicitException e) { logger.warn("YouTrack project lookup failed: {}", e.getMessage()); } Prevention
- Pick the project from the generated list rather than typing the name.
- Re-generate settings after any YouTrack project rename.
- Ensure the token can see all intended projects.
When it happens
Trigger: Calling newSetting or buildImportOption with a project name that does not exactly match any YouTrack project name returned by the API — the project was renamed/deleted in YouTrack, the token cannot see it, or the name differs in case/whitespace.
Common situations: YouTrack project renamed after import settings were saved; using an archived project name; API token scoped to a subset of projects; typo when editing settings YAML.
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
- Unable to find project:
- No field spec found:
- No link spec found:
- No field spec found:
- Unexpected attachment url:
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/cbde8228e6893bab.
Report an issue: GitHub.