Thursday, 1 September 2011

Browse » Home » » » » JIRA Dashboard Fails after Upgrading or Importing

JIRA Dashboard Fails after Upgrading or Importing

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):
...
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:
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.

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.

Resolution

  1. Edit the permission-types.xml file which is located in <JIRA_install>/atlassian-jira/WEB-INF/classes/ directory and uncomment the following section:
    <!--  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:
    <!--  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>
  2. Restart your JIRA instance before the change will take effect.

Advertisement:

No comments:

Post a Comment

Note: only a member of this blog may post a comment.