NullPointerException while viewing Workflow schemes page
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
Problem
When navigating to the Workflow Schemes page (Jira settings > Issues > Workflow schemes, you receive the following error 500 message:
The following appears in the Jira log when visiting the Workflows Schemes screen:
2020-04-23 21:06:06,553 https-jsse-nio-24443-exec-29 ERROR [c.a.j.web.servlet.InternalServerErrorServlet] {errorId=c369e92b-731d-4a96-bcea-98998a766c27, interpretedMsg=, cause=java.lang.NullPointerException, stacktrace=java.lang.NullPointerException
at java.lang.String$CaseInsensitiveComparator.compare(String.java:1192) [?:1.8.0_242]
at java.lang.String$CaseInsensitiveComparator.compare(String.java:1186) [?:1.8.0_242]
at com.google.common.collect.ComparatorOrdering.compare(ComparatorOrdering.java:38) [guava-18.0.jar:?]
at com.google.common.collect.ByFunctionOrdering.compare(ByFunctionOrdering.java:46) [guava-18.0.jar:?]
at java.util.TimSort.binarySort(TimSort.java:296) [?:1.8.0_242]
at java.util.TimSort.sort(TimSort.java:239) [?:1.8.0_242]
at java.util.Arrays.sort(Arrays.java:1438) [?:1.8.0_242]
at com.google.common.collect.Ordering.immutableSortedCopy(Ordering.java:846) [guava-18.0.jar:?]
at com.atlassian.jira.workflow.DefaultWorkflowSchemeManager.getAssignableSchemes(DefaultWorkflowSchemeManager.java:466) [classes/:?]
at com.atlassian.jira.web.action.admin.workflow.scheme.ViewSchemes.doExecute(ViewSchemes.java:32) [classes/:?]
at webwork.action.ActionSupport.execute(ActionSupport.java:165) [webwork-1.4-atlassian-30.jar:?]
at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:63) [jira-api-7.13.8.jar:?]
at webwork.interceptor.DefaultInterceptorChain.proceed(DefaultInterceptorChain.java:39) [webwork-1.4-atlassian-30.jar:?]
at webwork.interceptor.NestedInterceptorChain.proceed(NestedInterceptorChain.java:31) [webwork-1.4-atlassian-30.jar:?]
at webwork.interceptor.ChainedInterceptor.intercept(ChainedInterceptor.java:16) [webwork-1.4-atlassian-30.jar:?]
at webwork.interceptor.DefaultInterceptorChain.proceed(DefaultInterceptorChain.java:35) [webwork-1.4-atlassian-30.jar:?]
at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:225) [webwork-1.4-atlassian-30.jar:?]
at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:154) [webwork-1.4-atlassian-30.jar:?]
at com.atlassian.jira.web.dispatcher.JiraWebworkActionDispatcher.service(JiraWebworkActionDispatcher.java:138) [classes/:?]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) [servlet-api.jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [catalina.jar:8.5.35]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:8.5.35]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-websocket.jar:8.5.35]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:8.5.35]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:8.5.35]
at com.atlassian.jira.web.filters.JiraLastFilter.lambda$doFilter$0(JiraLastFilter.java:39) [classes/:?]
at com.atlassian.jira.web.filters.steps.ChainedFilterStepRunner.doFilter(ChainedFilterStepRunner.java:74) [classes/:?]
at com.atlassian.jira.web.filters.JiraLastFilter.doFilter(JiraLastFilter.java:36) [classes/:?]
...
Diagnostic Steps
In the database, you'll see a Workflow Scheme with no name:
jira853=# select * from workflowscheme where name is null;
id | name | description
-------+-------------------------------------------------------------------------+----------------------------------------------------------------------------------
10200 | | This Jira Service Management IT Support Workflow Scheme was generated for Project ITSM
Cause
The cause of the problem is due to the workflow scheme entry having NULL in name column. However, it is not yet known what has caused the null value in this table.
Resolution
Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
Update the row with missing name value by assigning some specific name (replace 10200 with the ID in your specific case):
update workflowscheme set name = 'updated_from_db' where ID = 10200;
Refresh the Workflow schemes page
Review the modified workflow and check whether it needs to be renamed or it can be deleted.