JIRA Crashes and Throws 'Unknown workflow name' Error

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

  1. The message below is displayed in the log:

    2010-12-09 11:13:25,957 http-8080-21 ERROR xxxxx 673x21425x1 xxxxxxx 127.0.0.1 /sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml [atlassian.jira.workflow.OSWorkflowManager] Could not get workflow called: Sample One Workflow: com.opensymphony.workflow.FactoryException: Unknown workflow name
    com.opensymphony.workflow.FactoryException: Unknown workflow name
    
  2. Running the integrity checker does not help
  3. The reported workflow does exist in JIRA (in this case called 'Sample One Workflow'). To confirm, go to Administration > Global Settings > Workflows
  4. The workflow also exists in the database table jiraworkflows but it is using different letter case (either lower or upper case)
  5. All JIRA workflows went missing in JIRA User Interface but workflow scheme still showing the data.
    (info) If you get the fifth symptom, please jump to the resolution no.5.

Cause

This is due to a database integrity issue.

Resolution

Always back up your data before performing any modification to the database. If possible, try your modifications on a test server.

  1. Shutdown JIRA;
  2. Get the workflow ID by searching for the workflow:

    SELECT * FROM jiraworkflows;
    
  3. Update the workflowname for the related workflow to have the correct letter case:

    update jiraworkflows set workflowname='<Workflow_Name>' where ID=xxxxxx;

    If the above does not work, it could be the case the defined workflow to workflow scheme has conflicting case sensitive names. In this case, verify with:

    select * from workflowschemeentity where workflow like '<Workflow_Name>';

    You should find both your workflows above (uppercase, lowercase, etc). Then you should try:

    update workflowschemeentity set workflow = '<Final_Workflow_Name>' where workflow in (select workflow from workflowschemeentity where workflow like '<Workflow_Name>');                                  
    

    Be very cautious with the above. Try on a test system first and be sure to double-check your instance afterwards.

    MySQL Note

    If you are running on MySQL, it will not let you run an update query on a table referencing the same table in where clause. In that case, feel free to run both queries independently, getting the id's from the nested query and pasting them on the main query:

    select ID from workflowschemeentity where workflow like '<Workflow_Name>';
    

    and then

    update workflowschemeentity set workflow = '<Final_Workflow_Name>' where id in ('<IDs returned from the previous query>');
    
  4. This resolution only apply for Symptoms 5:

    --Search for the JIRA workflow name that is not match with the workflow scheme entity
    select * from workflowschemeentity where workflow not in (select workflowname from jiraworkflows);
    
    --Get the workflow ID by searching for the workflow
    SELECT * FROM jiraworkflows;
    
    --Update the JIRA workflow to the correct name
    update jiraworkflows set workflowname = '<Workflow_Name>' where id = xxxxx;
    
    --Search for the JIRA workflow name that is not match with the workflow scheme entity for the second time
    select * from workflowschemeentity where workflow not in (select workflowname from jiraworkflows);
    
    --Update the JIRA workflow scheme entity to the final workflow name that you had updated
    update workflowschemeentity set workflow = '<Final_Workflow_Name>' where workflow not in (select workflowname from jiraworkflows);
  5. Restart JIRA

After that:

  • Run the integrity checker under Administration. That might show you that some of your issues have been left incapacitated because of the above change. For example, issues might be left in status Open while <Final_Workflow_Name> has not such status.
  • In that case, you can add a status Open in your workflow so that you can access those issues.
  • Open those issues and Clone them. The new issues are fine, following the correct workflow consistently.
  • Delete the old issues.

 

Last modified on Mar 30, 2016

Was this helpful?

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