theonedev/onedev · error · ExplicitException

Unable to find project:

Error message

Unable to find project: 

What it means

In the Jira Cloud import's importProjects(), after fetching the visible project list via getProjectNodes(), the code looks up the Jira project by key in the projectNodes map and throws this ExplicitException when the key is absent. It means the import mapping references a Jira project that the Jira Cloud REST API did not return for the configured credentials.

Source

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

			for (var jiraProject: projects.getImportProjects()) {
				OneDev.getInstance(TransactionService.class).run(() -> {
					String oneDevProjectPath = jiraProject;
					if (projects.getParentOneDevProject() != null)
						oneDevProjectPath = projects.getParentOneDevProject() + "/" + oneDevProjectPath;

					logger.log("Importing from '" + jiraProject + "' to '" + oneDevProjectPath + "'...");

					ProjectService projectService = OneDev.getInstance(ProjectService.class);
					Project project = projectService.setup(SecurityUtils.getSubject(), oneDevProjectPath);

					if (!project.isNew() && !SecurityUtils.canManageProject(project)) {
						throw new UnauthorizedException("Import target already exists. " +
								"You need to have project management privilege over it");
					}

					JsonNode projectNode = projectNodes.get(jiraProject);
					if (projectNode == null)
						throw new ExplicitException("Unable to find project: " + jiraProject);

					String apiEndpoint = getApiEndpoint("/project/" + projectNode.get("id").asText());

					// Get more detail project information
					projectNode = JerseyUtils.get(client, apiEndpoint, logger);

					project.setDescription(projectNode.get("description").asText(null));

					if (!dryRun && project.isNew()) {
						projectService.create(SecurityUtils.getUser(), project);
						OneDev.getInstance(AuditService.class).audit(project, "created project", null, VersionedXmlDoc.fromBean(project).toXML());
					}

					logger.log("Importing issues...");
					ImportResult currentResult = importIssues(projectNode, project, option, userIds, dryRun, logger);
					result.nonExistentLogins.addAll(currentResult.nonExistentLogins);
					result.errorAttachments.addAll(currentResult.errorAttachments);
					result.tooLargeAttachments.addAll(currentResult.tooLargeAttachments);

View on GitHub (pinned to d44925c47c)

Solutions

  1. Verify the Jira project key in the import mapping matches exactly (uppercase, case-sensitive) the key shown in Jira project settings.
  2. Check the Jira API token/user has Browse Projects permission on the missing project, and that the project is not archived.
  3. Confirm the import is pointed at the correct Jira site/base URL that actually contains the project.
  4. Check the import log listing which Jira projects are visible and pick one of those keys.

Example fix

// before
jiraProject = "MyProject"        // actual Jira key is MYPROJ
// after
jiraProject = "MYPROJ"           // exact key from Jira project settings
Defensive patterns

Strategy: validation

Validate before calling

boolean visible = importServer.getProjectNodes(logger).containsKey(jiraProjectKey);
if (!visible) throw new IllegalArgumentException("Jira project not visible: " + jiraProjectKey);

Try / catch

try { importServer.doImport(...) } catch (ExplicitException e) { if (e.getMessage().startsWith("Unable to find project")) { /* correct project key in option */ } }

Prevention

When it happens

Trigger: importProjects() runs, projectNodes.get(jiraProject) returns null for one of the configured project mappings — i.e. the Jira project key in the import option does not match any project returned by the Jira project-search endpoint for this token.

Common situations: Typo in the Jira project key (case-sensitive, e.g. PROJ vs Proj); Jira account/token lacking browse permission on that project; the project was archived or deleted in Jira after the mapping was saved; importing from a different Jira site than the one containing the project.

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


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