JIRA Project Import warns that there are more than twenty attachment entries that do not exist
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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
Problem
When attempting to run a project import, the pre-import validation shows the following error message:
There are more than twenty attachment entries that do not exist in the attachment directory. See your logs for full details.
The following appears in the atlassian-jira.log
:
2016-05-25 07:53:07,478 JiraTaskExectionThread-70 WARN xxxxxxx 473x1692930x2 mi449q xxxx,xxxx /secure/admin/ProjectImportSelectProject.jspa [imports.project.handler.AttachmentFileValidatorHandler]
The attachment 'ATTACHMENT_FILE_NAME.extension' does not exist at '/jira/atlassian/application-data/jira/import/attachments/PROJECT_KEY/PROJECT_KEY-xxx/xxxxx'. It will not be imported.
Diagnosis
Diagnostic Steps
Based on the error message in the atlassian-jira.log:
The attachment 'ATTACHMENT_FILE_NAME.extension' does not exist at '/jira/atlassian/application-data/jira/import/attachments/PROJECT_KEY/PROJECT_KEY-xxx/xxxxx'. It will not be imported.
The
PROJECT_KEY
value in the log entry does not actually match the import's target project key.
For example, the target project to import into has key JSP, while the error message in the log shows some other project key, such as GHS.
Cause
- In the target instance, the target project's key has been renamed to match the key of the source project.
See Editing A Project Key for information on changing a project's key. To identify if the target project's key has been renamed, the following SQL can be used:
SELECT pkey, ORIGINALKEY FROM project;
The
pkey
column is the project's current key, whileORIGINALKEY
is the project's previous key.- The importer tool is not able to import the attachments properly due to the target project key being renamed.
Resolution
Delete the target project and re-create it with the correct project key, instead of renaming it.
- As the target project has to be empty for project import to be valid, deleting and re-creating should be fast.
- Note that all schemes will have to be re-associated to the newly created project.
See Restoring Project from Backup for full details.