'java.lang.IndexOutOfBoundsException' during Upgrade Due to Invalid Field Association

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

When performing an upgrade using an XML backup, JIRA does not start up correctly and the following error is displayed:

Exception thrown during upgrade: Index: 0, Size: 0
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at com.atlassian.jira.issue.fields.screen.FieldScreenImpl.getTab(FieldScreenImpl.java:99)
at com.atlassian.jira.upgrade.tasks.UpgradeTask_Build551.doUpgrade(UpgradeTask_Build551.java:44)

Diagnosis

To confirm, run the following SQL query on the database:

SELECT * FROM fieldscreentab INNER JOIN fieldscreen ON (fieldscreentab.FIELDSCREEN = fieldscreen.ID) WHERE fieldscreen.NAME = 'Default Screen' ;

If no results are return, the issue is confirmed.

Cause

The default screen (table fieldscreen) did not have and associated screen tab record in the table fieldscreentab.

Workaround

  1. Run this query and record the result:

    SELECT max(id) FROM fieldscreentab f;
    
  2. Run this query and record the result:

    SELECT id FROM fieldscreen where name="Default Screen";
    
  3. Open the XML backup in a text editor
  4. Search for <FileAttachment id=
  5. Right above that entry, include this one:

    <FieldScreenTab id="<result from query 1>" name="Field Tab" sequence="0" fieldscreen="<result from query 2>" />
    
  6. Save the file and re-import the backup.

Resolution

Track the resolution at JRA-22362.

Last modified on Mar 30, 2016

Was this helpful?

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