500 Error Page when Copying a Permission Scheme

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

Copying a permission scheme results in a 500 Error page with this error:

Referer URL: <JIRA_URL>/secure/admin/ViewPermissionSchemes.jspa
java.lang.NullPointerException
java.lang.NullPointerException
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:187)
	at com.atlassian.jira.security.plugin.ProjectPermissionKey.<init>(ProjectPermissionKey.java:28)
	at com.atlassian.jira.permission.DefaultPermissionSchemeManager.makeSchemeEntity(DefaultPermissionSchemeManager.java:407)
	at com.atlassian.jira.scheme.AbstractSchemeManager.copyScheme(AbstractSchemeManager.java:669)
	at com.atlassian.jira.scheme.AbstractSchemeManager.copyScheme(AbstractSchemeManager.java:708)
	at com.atlassian.jira.scheme.AbstractCopyScheme.doExecute(AbstractCopyScheme.java:18)	
	...

Diagnosis

A copy of the permission scheme is still created, but certain groups/roles/users are removed from certain permissions.

Cause

There are corrupted entries in the database for the permission scheme. Running this SQL query will list them down:

SELECT * FROM schemepermissions where permission_key is null and scheme is not null;

This is a sample result:

Project Roles 10002 and 10000 are assigned to permission -1 which has NULL permission key in scheme 0 (default permission scheme).

Resolution

  • (warning) Back up JIRA first
  • Run this SQL query to delete the corrupted entries

    DELETE FROM schemepermissions where permission_key is null and scheme is not null;
  • Restart JIRA

Last modified on Nov 5, 2018

Was this helpful?

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