Project Import fails due to missing projectroleid

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

Project fails to import successfully into the application 

The following appears in the atlassian-jira.log:

2013-01-01 10:00:00,000 JiraTaskExectionThread-2 WARN admin 1020x292x1 1himo28 127.0.0.1 /secure/admin/ProjectImportSelectProject.jspa [imports.project.handler.ChainedSaxHandler] Encountered a parsing exception.
com.atlassian.jira.exception.ParseException: No 'projectroleid' field for ProjectRoleActor 10104.
	at com.atlassian.jira.imports.project.parser.ProjectRoleActorParserImpl.parse(ProjectRoleActorParserImpl.java:43)
	at com.atlassian.jira.imports.project.handler.UserMapperHandler.handleProjectRoleActor(UserMapperHandler.java:96)
	at com.atlassian.jira.imports.project.handler.UserMapperHandler.handleEntity(UserMapperHandler.java:90)
	at com.atlassian.jira.imports.project.handler.ChainedSaxHandler.endTopLevelElement(ChainedSaxHandler.java:250)
	at com.atlassian.jira.imports.project.handler.ChainedSaxHandler.endElement(ChainedSaxHandler.java:195)
	at com.atlassian.jira.imports.project.handler.ChainedSaxHandler.endElement(ChainedSaxHandler.java:150)
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
	at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at com.atlassian.jira.imports.xml.DefaultBackupXmlParser.parseBackupXml(DefaultBackupXmlParser.java:53)
	at com.atlassian.jira.imports.project.DefaultProjectImportManager.getProjectImportData(DefaultProjectImportManager.java:292)
	at com.atlassian.jira.bc.imports.project.DefaultProjectImportService.getProjectImportData(DefaultProjectImportService.java:610)
	at com.atlassian.jira.web.action.admin.importer.project.ProjectImportSelectProject$MappingResultCallable.call(ProjectImportSelectProject.java:244)
	at com.atlassian.jira.web.action.admin.importer.project.ProjectImportSelectProject$MappingResultCallable.call(ProjectImportSelectProject.java:222)
	at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:365)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at com.atlassian.jira.task.ForkedThreadExecutor$ForkedRunnableDecorator.run(ForkedThreadExecutor.java:249)
	at java.lang.Thread.run(Thread.java:662)

Diagnosis

Run the following SQL query on the Source Instance and see if it throws any result:

SELECT * FROM projectroleactor WHERE projectroleid IS null;

Cause

One of the rows on ProjectRoleActor table has a null value on the projectroleid column

Resolution 1

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

  1. Check if the above query throwing any result, if it does continue on the next step.
  2. Delete the row with the null value with the following SQL command.

    DELETE FROM projectroleactor WHERE projectroleid IS null;
    
  3. Create another XML Backup.
  4. On the Target Instance, do the Project Import again

Resolution 2

If it is not possible to do the First Resolution, it is still possible by updating the XML Backup directly.

  1. Create a Copy of the Backup that will be edited.
  2. Unzip the XML Backup.
  3. Open the entities.xml.
  4. Search for ProjectRoleActor id that does not have projectroleid associated. For example ProjectRoleActor id="24015" below:

    <ProjectRoleActor id="24005" pid="12010" projectroleid="10050" roletype="atlassian-user-role-actor" roletypeparameter="pfkrt"/>
    <ProjectRoleActor id="24014" pid="12010" projectroleid="10014" roletype="atlassian-user-role-actor" roletypeparameter="imbo"/>
    <ProjectRoleActor id="24015" pid="12010" roletype="atlassian-user-role-actor" roletypeparameter="pfkrt"/>
    <ProjectRoleActor id="24017" pid="12010" projectroleid="10050" roletype="atlassian-user-role-actor" roletypeparameter="imbo"/>
    <ProjectRoleActor id="24016" pid="12010" projectroleid="10015" roletype="atlassian-user-role-actor" roletypeparameter="pfkrt"/>
    
  5. Delete the whole lines.
  6. Search for more line which have no projectroleid specified and delete it.
  7. Save the File, compress and try to import again.
Last modified on Mar 30, 2016

Was this helpful?

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