NullPointerException when the name of the project workflow has trailing space(s) in the jiraworkflows table or workflowschemeentity table
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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
After upgrading, going to Administrator page > Project Summary > Workflow will give the following stack trace:
1
2
3
4
5
6
7
java.lang.NullPointerException
at com.atlassian.jira.projectconfig.contextproviders.WorkflowContextProvider.createWorkflow(WorkflowContextProvider.java:195)
at com.atlassian.jira.projectconfig.contextproviders.WorkflowContextProvider.addWorkflowData(WorkflowContextProvider.java:135)
at com.atlassian.jira.projectconfig.contextproviders.WorkflowContextProvider.getContextMap(WorkflowContextProvider.java:80)
at com.atlassian.jira.plugin.webfragment.CacheableContextProviderDecorator.initContextMap(CacheableContextProviderDecorator.java:70)
at com.atlassian.jira.plugin.webfragment.CacheableContextProviderDecorator.getContextMap(CacheableContextProviderDecorator.java:46)
at com.atlassian.plugin.web.descriptors.DefaultWebPanelModuleDescriptor$ContextAwareWebPanel.getHtml(DefaultWebPanelModuleDescriptor.java:143)
or
1
2
3
4
java.lang.NullPointerException
at com.atlassian.jira.projectconfig.rest.WorkflowSchemeRestHelper$SimpleWorkflow.<init>(WorkflowSchemeRestHelper.java:397)
at com.atlassian.jira.projectconfig.rest.WorkflowSchemeRestHelper$ResponseDataBuilder.addWorkflowData(WorkflowSchemeRestHelper.java:272)
at com.atlassian.jira.projectconfig.rest.WorkflowSchemeRestHelper$ResponseDataBuilder.build(WorkflowSchemeRestHelper.java:180)
Cause
The workflow name in either the jiraworkflows table or workflowschemeentity table does not match because the appearance of trailing space.
Resolution
Always back up your data before making any database modifications. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
Open the jiraworkflows table in the database and check the workflow name in workflowname column.
Open the workflowschemeentity table in the database and check the workflow name in WORKFLOW column.
Make sure the workflow name in both the jiraworkflows and workflowschemeentity table are the same and does not have any trailing space.
Was this helpful?