500 errors displayed while navigating in Jira server

Still need help?

The Atlassian Community is here for you.

Ask the community

Problem

This problem has several different symptoms. Browsing JIRA shows 500 errors while accessing the following pages:

  • JIRA issues;
  • the JIRA Issue Navigator page, or;
  • clicking on a label on issues (which also redirects you to the issue navigator).

Also, when viewing the Workflow page in the JIRA Administration, no workflows are displayed. See below for a list of symptoms on the screen and on the logs:

500 Error Page on Issues:

Click here to expand...

When accessing JIRA issues, the 500 error page will appear stating that a NullPointerException error had occurred.

And the following exception can be observed from the atlassian-jira.log log file:

2013-06-20 15:28:56,335 http-bio-8082-exec-5 ERROR      [500ErrorPage.jsp] Exception caught in 500 page null
java.lang.NullPointerException
	at com.atlassian.jira.permission.PermissionContextImpl.getRelevantStepDescriptor(PermissionContextImpl.java:90)
	at com.atlassian.jira.permission.WorkflowPermissionFactory.getWorkflowPermissions(WorkflowPermissionFactory.java:30)
	at com.atlassian.jira.security.WorkflowBasedPermissionManager.hasPermission(WorkflowBasedPermissionManager.java:75)
	at com.atlassian.jira.security.AbstractPermissionManager.hasPermission(AbstractPermissionManager.java:113)
	at com.atlassian.jira.security.AbstractPermissionManager.hasPermission(AbstractPermissionManager.java:142)  <+3> (NativeMethodAccessorImpl.java:39) (DelegatingMethodAccessorImpl.java:25)
[.....]


500 Error Page for JIRA Issue Navigator

Click here to expand...

Similarly, when accessing the Issue Navigator the problem also occurs:

And we can observe the following exceptions in the atlassian-jira.log log file:

2013-06-20 15:35:06,557 http-bio-8082-exec-3 ERROR badmin 935x186x1 1o8ycet 0:0:0:0:0:0:0:1 /issues/ [com.atlassian.velocity.DefaultVelocityManager] MethodInvocationException occurred getting message body from Velocity: java.lang.NullPointerException
java.lang.NullPointerException
	at com.atlassian.jira.permission.PermissionContextImpl.getRelevantStepDescriptor(PermissionContextImpl.java:90)
	at com.atlassian.jira.permission.WorkflowPermissionFactory.getWorkflowPermissions(WorkflowPermissionFactory.java:30)
	at com.atlassian.jira.security.WorkflowBasedPermissionManager.hasPermission(WorkflowBasedPermissionManager.java:75)
[.....]
2013-06-20 15:35:06,828 http-bio-8082-exec-3 ERROR      [500ErrorPage.jsp] Exception caught in 500 page null
java.lang.NullPointerException
	at com.atlassian.jira.workflow.DefaultWorkflowSchemeManager$ActiveWorkflowCache.load(DefaultWorkflowSchemeManager.java:814)
	at com.atlassian.jira.workflow.DefaultWorkflowSchemeManager$ActiveWorkflowCache.get(DefaultWorkflowSchemeManager.java:744)
	at com.atlassian.jira.workflow.DefaultWorkflowSchemeManager.getActiveWorkflowNames(DefaultWorkflowSchemeManager.java:452)


Clicking on labels (which redirects you to the issue navigator)

Click here to expand...

This problem can also surface when clicking on labels. The following stack trace is shown along with the 500-error page:

java.lang.NullPointerException
Hide stack trace
    java.lang.NullPointerException
    	at com.atlassian.jira.issue.search.searchers.renderer.StatusSearchRenderer.getSelectListOptions(StatusSearchRenderer.java:61)
    	at com.atlassian.jira.issue.search.searchers.renderer.IssueConstantsSearchRenderer.getEditHtml(IssueConstantsSearchRenderer.java:54)
    	at com.atlassian.jira.plugin.issuenav.service.DefaultSearcherService.getEditHtml(DefaultSearcherService.java:483)
    	at com.atlassian.jira.plugin.issuenav.service.DefaultSearcherService.getValueResults(DefaultSearcherService.java:255)
    	at com.atlassian.jira.plugin.issuenav.service.DefaultSearcherService.getSearchResults(DefaultSearcherService.java:176)
    	at com.atlassian.jira.plugin.issuenav.service.DefaultSearcherService.searchWithJql(DefaultSearcherService.java:170)
    	at com.atlassian.jira.plugin.issuenav.IssueNavAction.performSearch(IssueNavAction.java:1169)
    	at com.atlassian.jira.plugin.issuenav.IssueNavAction.doNav(IssueNavAction.java:360)


Viewing the Workflow page in the Administration:

Click here to expand...

No workflows are displayed:

and in the atlassian-jira.log:

2015-03-24 16:55:13,270 http-bio-8080-exec-3 ERROR matheus 1015x115x1 nwms6n 0:0:0:0:0:0:0:1 /secure/admin/workflows/ListWorkflows.jspa [webwork.util.ValueStack] query="activeWorkflows" {[id="activeWorkflows" type="8" values=""]}
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
...
Caused by: com.atlassian.cache.CacheException: java.lang.NullPointerException
    at com.atlassian.cache.memory.DelegatingCachedReference.get(DelegatingCachedReference.java:60)
...
Caused by: java.lang.NullPointerException
    at com.atlassian.jira.workflow.DefaultWorkflowSchemeManager$WorkflowSupplier.get(DefaultWorkflowSchemeManager.java:1306)
...

Diagnosis

To verify if you are being affected by this problem, please perform the following SQL query in JIRA's database accordingly:

PostgreSQL and Oracle

SELECT id, workflow FROM workflowschemeentity WHERE workflow NOT IN (SELECT workflowname FROM jiraworkflows);

 

 MS-SQL database

SELECT id, workflow FROM workflowschemeentity WHERE workflow collate SQL_Latin1_General_CP437_CS_AS NOT IN (SELECT workflowname FROM jiraworkflows);

 

MySQL database

SELECT id, workflow FROM workflowschemeentity WHERE BINARY workflow NOT IN (SELECT workflowname FROM jiraworkflows);


Check if workflow is deleted or renamed

If a workflow is deleted then we can check following queries. We might get no records in JIRAWORKFLOWS table for that workflow. In such scenario we can also run UPDATE query as in Resolution section with any of the available workflow in JIRAWORKFLOWS table. For example we can try to update workflowschemeentity with workflow available in JIRAWORKFLOWS, testworkflow in this example.

This would help to resolve java.lang.NullPointerException exception. Later once dashboard is visible again, these changes should be validated from "Workflows" and "Workflow schemes" pages in Jira UI (Administration → Issues).

SELECT * from workflowschemeentity WHERE WORKFLOW NOT in (select workflowname from jiraworkflows) AND WORKFLOW != 'jira';

ID   |SCHEME|WORKFLOW |ISSUETYPE|
-----+------+---------+---------+
25339| 22454|Workflow4|    10201|
25364| 22462|Workflow4|    10201|


SELECT count(1) FROM JIRAWORKFLOWS j WHERE WORKFLOWNAME = 'Workflow4' ;
COUNT(1)|
--------+
       0|

# check for any other workflow which is available in JIRAWORKFLOWS table.
SELECT count(1) FROM JIRAWORKFLOWS j WHERE WORKFLOWNAME = 'testworkflow' ;
COUNT(1)|
--------+
       1|

UPDATE workflowschemeentity SET workflow = 'testworkflow' where id=25339;
UPDATE workflowschemeentity SET workflow = 'testworkflow' where id=25364;

Cause

This issue can happen if one or more workflow names stored in the workflowschemeentity table do not match any workflow names stored in the jiraworkflows table. One reason for this could be a Workflow Scheme that is associated with a deleted Workflow in the database, or there is an inconsistency in the characters' cases of the workflow name (e.g. "JIRA workflow" vs "JIRA Workflow").

The 'jira' workflow is a Read-only System Workflow so it is not in the 'jiraworkflows' table. If running the Diagnosis queries returns that workflow, then it is normal.

Resolution

Always back up your data before performing any modification to the database. If possible, try your modifications on a test server.

  1. Shutdown JIRA.

  2. After identifying the inconsistent workflow in the workflowschemeentity table, please update the entry/entries with the valid workflow name by running the following SQL update statement: This valid workflow name can be any workflow name that exists in the jiraworkflows table. 

    UPDATE workflowschemeentity SET workflow = '<Correct Workflow Name>' where id=<ID of incorrectly named workflow>;

    (info) Remember to change the Workflow Name and ID to the correct value accordingly.

  3. (Oracle Only): Commit the transaction with the following:

    COMMIT;
  4. After updating the related record(s) in the database, restart JIRA for the changes to take effect.

Last modified on Jun 26, 2023

Was this helpful?

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