Too many WorkflowScheme schemes found for Project

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

Attempting to access a project's Workflow Scheme configuration throws a 500 Error page.

The following appears in the atlassian-jira.log:

1 2 3 4 5 6 7 8 2014-04-01 09:31:45,531 http-bio-8081-exec-2 ERROR [500ErrorPage.jsp] Exception caught in 500 page Too many WorkflowScheme schemes found for Project XXXXX java.lang.IllegalStateException: Too many WorkflowScheme schemes found for Project XXXXX at com.atlassian.jira.scheme.AbstractSchemeManager.getSchemeFor(AbstractSchemeManager.java:232) at com.atlassian.jira.bc.project.DefaultProjectService.deleteProject(DefaultProjectService.java:715) at com.atlassian.jira.web.action.project.DeleteProject.doExecute(DeleteProject.java:64) at webwork.action.ActionSupport.execute(ActionSupport.java:165) ...

Cause

There are multiple workflow schemes associated to the JIRA project. (This is illegal) This can be seen rather clearly by delving into the source code:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 public Scheme getSchemeFor(Project project) { try { final List<GenericValue> schemes = getSchemes(project.getGenericValue()); if (schemes.isEmpty()) { return null; } if (schemes.size() > 1) { throw new IllegalStateException("Too many " + getSchemeEntityName() + " schemes found for Project " + project.getKey()); } return schemeFactory.getScheme(schemes.iterator().next()); } catch (GenericEntityException ex) { throw new DataAccessException(ex); } }

It can be seen that JIRA will throw the "Too many WorkflowScheme schemes" error when it returns more than 1 scheme.

Resolution

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

    1 SELECT * FROM nodeassociation WHERE SINK_NODE_ENTITY = 'WorkflowScheme' 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 you need)

  • 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.

    1 2 3 SOURCE_NODE_ID SOURCE_NODE_ENTITY SINK_NODE_ID SINK_NODE_ENTITY ASSOCIATION_TYPE SEQUENCE 10600 Project 10200 WorkflowScheme ProjectScheme NULL 10600 Project 10201 WorkflowScheme ProjectScheme NULL
  • Before deleting one of the rows above, bulk-move all the issues in the affected project to another temporary project, and then execute the delete query:

    1 DELETE FROM nodeassociation WHERE SINK_NODE_ENTITY = 'WorkflowScheme' AND SOURCE_NODE_ID = 10600 AND SINK_NODE_ID = 10200 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.

Updated on April 15, 2025

Still need help?

The Atlassian Community is here for you.