Project import fails with Validation errors were found in Jira


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

    

Summary

When importing a project through Project Configurator, the import fails with validation errors.


Environment

Jira Core and Software 7.x and 8.x.


Diagnosis

The project import fails with the log message below on atlassian-jira.log:

2020-10-20 16:47:41,266-0600 JiraTaskExecutionThread-3 INFO username 986x382583x1 1wxyjx6 10.10.10.10 /secure/complete-project-import!resumeImportFromSimulation.jspa [c.a.j.imports.project.DefaultProjectImportService] Project Import: Validation errors were found. The import cannot continue.

There may be previous or following ERROR messages hinting to what contributed to the failure — and there may be no ERROR messages at all.


Cause

Many factors can lead to a validation error when importing a Project Configuration exported file.

Adaptavist lists and suggest fixes to the most common reasons on it's KB on Project Import Errors.

Some other noticeable reasons are:

1) Required users

The import will fail with the message below right after it:

2020-10-20 16:47:41,266-0600 JiraTaskExecutionThread-3 ERROR username 986x382583x1 1wxyjx6 10.10.10.10 /secure/complete-project-import!resumeImportFromSimulation.jspa [c.a.j.imports.project.DefaultProjectImportService] There are '3' required user(s) that JIRA can not automatically create.

This means the import contains issues reported/created/assigned to usernames that are either empty or aren't present in the users section of the importing XML.

2) No ERROR at all

The import fails but no ERROR message is present in the log.


Solution

1) Required users

1.1) Blank users

There may be blank users in the XML, to which you may follow the instructions on Project Import Failed due to Blank Missing Mandatory User.

1.2) Missing users

There may be users missing in the Jira instance from which the project was exported from. You may execute the following queries on it's database:

select p.pkey, i.issuenum, i.assignee
from jiraissue i
left join app_user a on a.user_key = i.assignee
join project p on i.project = p.id
where i.assignee is not null and a.id is null;

select p.pkey, i.issuenum, i.reporter
from jiraissue i
left join app_user a on a.user_key = i.reporter
join project p on i.project = p.id
where i.reporter is not null and a.id is null;

select p.pkey, i.issuenum, i.creator
from jiraissue i
left join app_user a on a.user_key = i.creator
join project p on i.project = p.id
where i.creator is not null and a.id is null;

Then proceed to update the entities.xml file inside the exported zip replacing the users found above with a valid one:

Finding a valid user_key
select user_key from app_user where lower_user_name = 'SOME-VALID-USERNAME';
Replacing users in the XML
$ sed -i 's/assignee="user1"/assignee="SOME-VALID-USER-KEY"/g' entities.xml
$ sed -i 's/assignee="user2"/assignee="SOME-VALID-USER-KEY"/g' entities.xml
$ sed -i 's/assignee="user3"/assignee="SOME-VALID-USER-KEY"/g' entities.xml


2) No ERROR at all

Make sure that the source and destination Jira instances have the same properties like Timezome, Locale (specially date and number formats) and textfield size limit as advised on the Matching properties of both instances section of Preparing for migrating projects.

You may temporarily set jira.text.field.character.limit to 0 on the destination Jira's advanced settings to perform the import and then revert back to the previous value.



Last modified on Jul 16, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.