Opening of JIRA Issue Navigator Fails with Exception 500
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:
500 Error Page for JIRA Issue Navigator
Clicking on labels (which redirects you to the issue navigator)
Viewing the Workflow page in the Administration:
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.
Shutdown JIRA.
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:UPDATE workflowschemeentity SET workflow = '<Correct Workflow Name>' where id=<ID of incorrectly named workflow>;
Remember to change the
Workflow Name
and ID to the correct value accordingly.(Oracle Only): Commit the transaction with the following:
COMMIT;
- After updating the related record(s) in the database, restart JIRA for the changes to take effect.