Dashboard fails to load with error 500 in Jira
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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
Trying to load a dashboard page presents an error 500 page.
Expanding the details of the error page or scanning the logs, an IndexOutOfBoundsException error is present.
throws one of the following exceptions:
java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
at java.util.ArrayList.rangeCheck(ArrayList.java:657) [?:1.8.0_202]
at java.util.ArrayList.get(ArrayList.java:433) [?:1.8.0_202]
at com.atlassian.jira.portal.DefaultPortalPageManager.getPortletConfigurations(DefaultPortalPageManager.java:288) [classes/:?]
at com.atlassian.jira.dashboard.JiraDashboardStateStoreManager.getDashboardState(JiraDashboardStateStoreManager.java:166) [classes/:?]
at com.atlassian.jira.dashboard.JiraDashboardStateStoreManager.retrieve(JiraDashboardStateStoreManager.java:143) [classes/:?]
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.RangeCheck(ArrayList.java:546)
at java.util.ArrayList.get(ArrayList.java:321)
at com.atlassian.jira.portal.AbstractPortalPageImpl$ConfigInfo.putInColumn(AbstractPortalPageImpl.java:365)
at com.atlassian.jira.portal.AbstractPortalPageImpl$ConfigInfo.setPortletConfigurations(AbstractPortalPageImpl.java:291)
at com.atlassian.jira.portal.AbstractPortalPageImpl.setPortletConfigurations(AbstractPortalPageImpl.java:162)
at com.atlassian.jira.dashboard.JiraDashboardStateStoreManager$2.get(JiraDashboardStateStoreManager.java:89)
Environment
All versions of Jira Core 7.x and later
Diagnosis
Apart from the error 500, either of the following errors can show up in the atlassian-jira.log
located under <jira home>/log/
folder:
Evidence from the logs
[c.a.j.web.servlet.InternalServerErrorServlet] {errorId=da24ad8b-809a-4457-9015-6b13070603a1, interpretedMsg=, cause=java.lang.IndexOutOfBoundsException: Index: 2, Size: 2, stacktrace=java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
[c.a.j.web.servlet.InternalServerErrorServlet] {errorId=da24ad8b-809a-4457-9015-6b13070603a1, interpretedMsg=, cause=java.lang.IndexOutOfBoundsException: Index: 1, Size: 1, stacktrace=java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
Evidence from the database
You may also find the affected Dashboards and others by executing queries similar to these examples below:
select PC.ID as gadget_id,
PP.ID as dashboard_id
from portletconfiguration PC,
portalpage PP
where PC.PORTALPAGE = PP.ID AND
column_number > length(layout) -1;
select PC.ID as gadget_id,
PP.ID as dashboard_id
from portletconfiguration PC,
portalpage PP
where PC.PORTALPAGE = PP.ID AND
column_number > len(layout) -1;
Cause
Somehow, the Dashboard was configured to have only 2 columns and there's a Gadget configured to be in the 3rd column — or the Dashboard's 1 column and the Gadget's in column 2 or 3.
Resolution
Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
Update the database directly to set the Dashboard layout to 3 columns:
update portalpage set layout='AAA' where id=<dashboard_id>;
You can replace the <dashboad_id>
by each result from the diagnostic query or by the "selectPageId" present in the URL: Dashboard.jspa?selectPageId=...
You should be able to access the Dashboards then and rearrange the gadgets and the layout as you see fit.