Unable to create new project, can't assign default permission scheme
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 creating a new project, a java.lang.NullPointerException will be thrown
- Seems like JIRA cant assign the new project to the Default Permission Scheme
The following appears in the atlassian-jira.log
java.lang.NullPointerException
at com.atlassian.jira.projectconfig.contextproviders.ProjectPermissionContextProvider.getContextMap(ProjectPermissionContextProvider.java:85)
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:144)
at com.atlassian.jira.projectconfig.tab.WebPanelTab.getTab(WebPanelTab.java:75)
at com.atlassian.jira.projectconfig.servlet.PanelServlet.outputTab(PanelServlet.java:163)
at com.atlassian.jira.projectconfig.servlet.PanelServlet.doGet(PanelServlet.java:136)
Diagnosis
Environment
- A modification of the permission scheme table was done
- The original default permission scheme is missing/deleted. Is this is missing, JIRA will encounter the nullpointerException error as it cant find the default permission scheme.
Diagnostic Steps
select * from permissionscheme;
select * from project where id not in (SELECT source_node_id FROM nodeassociation where sink_node_entity = 'PermissionScheme');
- 1st query - Verify if the default permission scheme with id = 0 exist
- 2nd query - To filter out which project has lost the permission scheme
Cause
Missing default permission scheme.
Resolution
Backup up your JIRA prior to below action
- Go to JIRA Administration ,
Issues > Permission Scheme
- Create a new permission scheme called JIRA Default Permission Scheme, with default permission setup
- Do not assign any project to this permission
- Stop JIRA
- Go to database
select * from permissionscheme; to find the newly created JIRA Default Permission Scheme
Note the ID, will be shown as xxx in below query. Replace accordingly.
update permissionscheme set ID=0 where ID=xxxx
Start JIRA