Too many PermissionScheme schemes found for Project

Still need help?

The Atlassian Community is here for you.

Ask the community

 

Symptoms

JIRA fails to start and the following appears in the atlassian-jira.log:

2015-04-09 20:50:23,001 localhost-startStop-1 ERROR [atlassian.jira.startup.LauncherContextListener] Unable to start JIRA.
java.lang.IllegalStateException: Too many PermissionScheme schemes found for Project TEST 
at com.atlassian.jira.scheme.AbstractSchemeManager.getSchemeIdFor(AbstractSchemeManager.java:275)
at com.atlassian.jira.permission.DefaultPermissionSchemeManager.getSchemeIdFor(DefaultPermissionSchemeManager.java:628)
at com.atlassian.jira.permission.DefaultPermissionSchemeManager.hasSchemePermission(DefaultPermissionSchemeManager.java:543)
at com.atlassian.jira.security.DefaultPermissionManager.doProjectPermissionCheck(DefaultPermissionManager.java:350)
at com.atlassian.jira.security.DefaultPermissionManager.hasPermission(DefaultPermissionManager.java:208)

    ...

Cause

There are multiple permission schemes associated to the JIRA project. This is illegal and will prevent JIRA to start with the error Too many PermissionScheme schemes found for Project

Resolution

  • Start by identifying all the permission schemes associated to the project. Run the following SQL query:

    SELECT na.source_node_id, na.sink_node_id, ps.name 
    FROM nodeassociation na 
    JOIN permissionscheme  ps ON na.sink_node_id = ps.id 
    WHERE sink_node_entity = 'PermissionScheme'
    AND SOURCE_NODE_ID = (SELECT ID FROM project WHERE pkey = 'XXXXX');
  • The SQL query above will pull all Workflow Schemes associated to project with key XXXXX. (replace with whatever project key the error message returned)
  • Other schemes can be discovered as well by changing the SINK_NODE_ENTITY to other values, such as 'PermissionScheme', 'WorkflowScheme' and 'NotificationScheme'.
  • If the SQL returns two rows, like in below, then one of it needs to be deleted as its causing the error.

     source_node_id | sink_node_id |            name             
    ----------------+--------------+-----------------------------
              13801 |            0 | Standardtestschema
              13801 |        10100 | PS | testschema
    (2 rows)
  • Choose the record you want to delete and run the DELETE statement like the one below:

    DELETE FROM nodeassociation WHERE SINK_NODE_ENTITY = 'PermissionScheme' AND SOURCE_NODE_ID = 13801 AND SINK_NODE_ID = 0 AND ASSOCIATION_TYPE = 'ProjectScheme';

     This is an example query following the results of the previous SQL in STEP 4.

  • Once the query is executed, restart JIRA.

    WARNING

    Always ensure you have a database backup before performing a delete query like in the above.

Last modified on Mar 30, 2016

Was this helpful?

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