Unable to create issues or perform a full reindex in Jira - no project with this id can be found

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

While performing Full Re-indexing in Jira, you may not be able to complete this operation if there is a NULL value for the Project ID on the jiraissue table in the database.

Environment

Data Center

Diagnosis

On the Full Re-indexing process, Jira throws an error stating that a Project with the ID of "XXX" does not exist; you may see hundreds of issues being affected with the same error, and due to this, the re-index operation fails, and is not able to complete. 

You can check if there are any NULL values in this SQL query from your database:

1 SELECT * FROM jiraissue where project = null;

From Jira application logs, you may see several errors stating that a Project with ID of XXX does not exist, in the scenario below, a Project ID of 21310 does not exist in the database:

  • Issue (id=605799) has field 'project' of value 21310, but no project with this id can be found. Returning null for 'key'.

1 2 3 2024-04-30 11:40:53,708-0400 JiraTaskExecutionThread-1 INFO xxxxx [c.a.j.w.a.admin.index.IndexAdminImpl] Re-indexing is 0% complete. Current index: Issue ... 2024-04-30 11:41:08,153-0400 IssueIndexer:thread-4 WARN [c.a.jira.ofbiz.IssueGenericValue] Issue (id=605799) has field 'project' of value 21310, but no project with this id can be found. Returning null for 'key'.

Cause

  • Usually this is a result of a consolidation of Jira projects or something similar importing that have been done into the Jira instance, and something pulled in the data of one of the projects left behind.

  • There is a custom field in these issues which is associated with a Project ID that does not exist in the Jira instance.

  • Keep in mind when you import a project, the Jira issue IDs and project IDs varies in the destination instance.

Solution

The most succeeded way to fix this problem is to update all issues on the database associated with this project, with another dummyproject key.

You can use the following below to link all these issues to a dummy project.

  1. Create a new 'dummy project' that will be linked to the issues;

  2. Take the <new project ID> from the 'dummy project'. Note it down.

  3. Stop Jira.

  4. Backup your database. (Always back up your data before performing any modification to the database. If possible, try your modifications on a test server.)

  5. Request DBA to run the following query, and replace the <new project id> below, with the one from step 2: ( The old project id in this scenario is 21310, as shown by the error )

    1 UPDATE jiraissue SET project = <new project id> WHERE project = 21310;
  6. Start Jira

  7. Run the Full Re-index again.

  8. The re-indexing should finish successfully, and you should be able to create Jira tickets afterwards.

Updated on February 24, 2025

Still need help?

The Atlassian Community is here for you.