Dashboard error after Jira upgrade or XML restore
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs 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
Symptoms
After upgrading to a version of Jira that's 4.0 or higher, users trying to access the dashboard encounter an error message like the following (which also appears in the logs):
1
2
3
4
5
6
7
...
java.lang.RuntimeException: java.lang.NullPointerException
at com.atlassian.jira.dashboard.permission.JiraGadgetPermissionManager.hasProjectsPermission(JiraGadgetPermissionManager.java:164)
at com.atlassian.jira.dashboard.permission.JiraGadgetPermissionManager.voteOn(JiraGadgetPermissionManager.java:147)
at com.atlassian.jira.dashboard.permission.JiraGadgetPermissionManager.filterGadgets(JiraGadgetPermissionManager.java:70)
at com.atlassian.jira.web.action.Dashboard.getCurrentDashboardState(Dashboard.java:182)
...
Diagnosis
Another way to know if you may be affected by this problem is to run the following query:
1
select count(*) from schemepermissions where perm_type in ('reportercreate','assigneeassignable');
If that query returns a number greater than zero, then you'll need to follow the instructions in the "Resolution" section of the document to avoid permission errors when running Jira 4.0 or higher.
If you had used Jira Service Management earlier and restoring the XML Backup
Cause
Before the upgrade or restore, Jira was confiugured to allow either the Current Reporter Browse Project Permission or the similar permission that allows users to browse projects in which they're assigned issues. These two permission types are commented out by default since they can cause some fairly serious issues if used incorrectly.
The problem caused by a bug related to Service Management permission which fixed in Jira 6.2: JRASERVER-36940 - JIRA search broken after disabling Service Desk
Solution
Resolution for cause 1
Edit the
permission-types.xml
file which is located in <Jira_install>/atlassian-jira/WEB-INF/classes/ directory and uncomment the following section:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
<!-- Uncomment & use this permission to show only projects where the user has create permission and issues within that where they are the reporter. --> <!-- This permission type should only ever be assigned to the "Browse Projects" permission. --> <!-- Other permissions can use the "reporter" or "create" permission type as appropriate. --> <!-- <type id="reportercreate" enterprise="true"> <class>com.atlassian.jira.security.type.CurrentReporterHasCreatePermission</class> </type> --> <!-- Uncomment & use this permission to show only projects where the user has the assi\ gnable permission and issues within that where they are the assignee --> <!-- This permission type should only ever be assigned to the "Browse Projects" permis\ sion. --> <!-- Other permissions can use the "reporter" or "create" permission type as appropria\ te. --> <!-- <type id="assigneeassignable" enterprise="true"> <class>com.atlassian.jira.security.type.CurrentAssigneeHasAssignablePermission</cla\ ss> </type> -->
That portion of the file should look something like this after the modification:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<!-- This permission type should only ever be assigned to the "Browse Projects" permission. --> <!-- Other permissions can use the "reporter" or "create" permission type as appropriate. --> <type id="reportercreate" enterprise="true"> <class>com.atlassian.jira.security.type.CurrentReporterHasCreatePermission</class> </type> <!-- Uncomment & use this permission to show only projects where the user has the assi\ gnable permission and issues within that where they are the assignee --> <!-- This permission type should only ever be assigned to the "Browse Projects" permis\ sion. --> <!-- Other permissions can use the "reporter" or "create" permission type as appropria\ te. --> <type id="assigneeassignable" enterprise="true"> <class>com.atlassian.jira.security.type.CurrentAssigneeHasAssignablePermission</cla\ ss> </type>
Restart your Jira instance before the change will take effect.
Resolution for cause 2
Stop Jira.
Backup database
Execute the below SQL on the database:
1 2
DELETE FROM schemepermissions WHERE perm_type = 'sd.customer.portal.only';
Start Jira.
Was this helpful?