NullPointerException when trying to access System Dashboard

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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

Symptoms

When trying to access the main dashboard, a System Error is thrown and one of the following errors appears in atlassian-jira.log:

Jira 8 and newer
2024-04-19 04:41:36,376+0000 http-nio-8080-exec-7 ERROR      [o.a.c.c.C.[.[localhost].[/jira].[action]] Servlet.service() for servlet [action] in context with path [/jira] threw exception [java.lang.NullPointerException] with root cause
java.lang.NullPointerException
        at com.atlassian.jira.web.action.Dashboard.initialiseCurrentDashboardId(Dashboard.java:562)
        at com.atlassian.jira.web.action.Dashboard.getCurrentDashboardId(Dashboard.java:267)
        at com.atlassian.jira.web.action.Dashboard.getCurrentDashboardState(Dashboard.java:280)
        at com.atlassian.jira.web.action.Dashboard.doValidation(Dashboard.java:165)
        at webwork.action.ActionSupport.validate(ActionSupport.java:391)
        ... 1 filtered
        at com.atlassian.jira.web.action.JiraWebActionSupport.execute(JiraWebActionSupport.java:1364)
        ... 7 filtered
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:623)
        ... 48 filtered
        at com.atlassian.greenhopper.jira.filters.ClassicBoardRouter.doFilter(ClassicBoardRouter.java:56)
        ... 7 filtered
Jira 7 and earlier
ERROR EIL018 948x15658x1 admin 172.30.248.33 /secure/Dashboard.jspa [atlassian.plugin.web.DefaultWebInterfaceManager] Could not evaluate condition 'com.atlassian.plugin.web.conditions.AndCompositeCondition@47d94f' for descriptor: jira.top.navigation.bar:gadgets.dashboard.menu.share (null)
java.lang.NullPointerException
    at com.atlassian.jira.plugin.webfragment.conditions.ShowDashboardToolsMenuCondition.shouldDisplay(ShowDashboardToolsMenuCondition.java:41)
    at com.atlassian.plugin.web.conditions.AndCompositeCondition.shouldDisplay(AndCompositeCondition.java:14)
    at com.atlassian.plugin.web.DefaultWebInterfaceManager.filterFragmentsByCondition(DefaultWebInterfaceManager.java:172)
    at com.atlassian.plugin.web.DefaultWebInterfaceManager.getDisplayableItems(DefaultWebInterfaceManager.java:103)
    at sun.reflect.GeneratedMethodAccessor372.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

Diagnosis

Run the following SQL query:

SELECT * FROM portalpage WHERE username IS NULL;

If no results are returned, your Jira instance is affected by this problem.

Cause

The default System Dashboard has been associated with a user account, when it should be associated to nobody (null).

This causes Jira to be unable to find the default dashboard when other users (including users who haven't yet logged in) try to access it, resulting in a NullPointerException error.

Solution

  1. Run the following SQL query:

    SELECT id FROM portalpage WHERE username IS NOT NULL AND pagename = 'System Dashboard';

    The above query should return only one row, containing an ID number. If it returns no rows, or more than one row, please do not proceed any further and instead contact Atlassian Support.

  2. Perform a database backup, for roll-back purposes, if necessary.
  3. Shut down Jira.
  4. Run the SQL query below, replacing <portalpageid> with the ID number returned in step 1:

    UPDATE portalpage SET username = NULL WHERE id = '<portalpageid>'
    

    (info)The query above will set the owner of the default dashboard to nobody, so users who have logged in can see it.

  5. Start Jira.

Last modified on Apr 19, 2024

Was this helpful?

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