Jira application statuses page throws a 500 Error

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

The following page appears when trying access to the Statuses page:










Or you can't see any workflow listed when navigating to workflows page.

With the following Error when expanded:

Technical details
Log's referral number: 0b8255e1-5025-4373-bbbb-744ded4b9177

Cause
Referer URL: http://10.60.5.147:8624/jira624/secure/admin/ViewStatuses.jspa
com.google.template.soy.tofu.SoyTofuException: In template JIRA.Templates.Statuses.success: In 'foreach' command {foreach $status in $statuses}{call .statusRow}{param status: $status /}{/call}{/foreach}, the data reference does not resolve to a SoyListData.
com.google.template.soy.tofu.SoyTofuException: In template JIRA.Templates.Statuses.success: In 'foreach' command {foreach $status in $statuses}{call .statusRow}{param status: $status /}{/call}{/foreach}, the data reference does not resolve to a SoyListData.
	at com.google.template.soy.tofu.internal.BaseTofu.renderMainHelper(BaseTofu.java:341)
	at com.google.template.soy.tofu.internal.BaseTofu.renderMain(BaseTofu.java:300)
	at com.google.template.soy.tofu.internal.BaseTofu.access$100(BaseTofu.java:56)
	at com.google.template.soy.tofu.internal.BaseTofu$RendererImpl.render(BaseTofu.java:427)

(info) Referral number can be used to search for the relevant log.

errorId=0b8255e1-5025-4373-bbbb-744ded4b9177

For reference, a similar issue but with a different root cause is reported on JIRAAUTOSERVER-196 - Getting issue details... STATUS where the error 500 is noticed after installing JSM or after an upgrade.

A couple other related articles:

Automation Rules admin page is broken and displays a template error in Jira

Automation for Jira not working after upgrading Jira or updating Automation for Jira

Diagnosis

Check in the atlassian-jira.log whether the following error is written:

Caused by: com.atlassian.cache.CacheException: java.lang.IllegalStateException: There are more than one draft workflows associated with the workflow named '<workflow name>'
	at com.atlassian.cache.memory.DelegatingCache.get(DelegatingCache.java:67)
	at com.atlassian.jira.workflow.CachingDraftWorkflowStore.getDraftWorkflow(CachingDraftWorkflowStore.java:55)
	at com.atlassian.jira.workflow.OSWorkflowManager.getDraftWorkflow(OSWorkflowManager.java:249)

or 

Caused by: com.atlassian.cache.CacheException: java.lang.IllegalStateException: There are more than one workflows associated with '<workflow name>' in the database!
	at com.atlassian.cache.memory.DelegatingCache$DelegatingLoadingCache.get(DelegatingCache.java:270)
	at com.atlassian.jira.workflow.CachingWorkflowDescriptorStore.getWorkflow(CachingWorkflowDescriptorStore.java:68)
	at com.atlassian.jira.workflow.JiraWorkflowFactory.getWorkflow(JiraWorkflowFactory.java:37)
	at com.opensymphony.workflow.config.DefaultConfiguration.getWorkflow(DefaultConfiguration.java:89)

or 

2016-04-07 15:35:49,564 http-nio-8711-exec-20 ERROR <username> 935x813x1 r6dcz1 172.18.66.246 /secure/admin/workflows/ListWorkflows.jspa [webwork.util.ValueStack] query="inactiveWorkflows" {[id="inactiveWorkflows" type="8" values=""]}
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Cause

1) The JIRA application database has a duplicate record for a draft workflow. The problem is likely to occur when there are multiple Administrators who are creating workflow drafts of the same workflow at roughly the same time.

JRA-40009 - Getting issue details... STATUS

1.1) The Jira application has a corrupted draft workflow(only one). We cannot open the original workflow for editing.

2) The JIRA application database has a duplicate record for a workflow. 

3) There are orphaned scheme references (e.g. workflow, permission, notification) in the nodeassociation JIRA table referencing a deleted project. This produces a NullPointerException when the workflow list is populated. The following SQL query can be used to diagnose the problem:

Diagnosis: orphaned rows in the nodeassociation table
select * from nodeassociation where SOURCE_NODE_ENTITY='Project' AND SOURCE_NODE_ID not in (select ID from project);

4) Workflow contains duplicate actions


Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

Resolution 1 - Remove duplicate draft workflows

We will find draft workflows with identical names and then delete one.  Look at the jiradraftworkflows.descriptor column on the duplicate draft rows to determine which one to delete.  
Jira Draft workflow table definition from Jira 8.20 schema diagram

  1. Run the following SQL query on the database (to identify the drafts with more than one entry):

    SELECT count(*), parentname FROM jiradraftworkflows group by parentname having count(*) > 1;
  2. Delete one of the Id which have the same parentname.

    SELECT id, parentname from jiradraftworkflows;

    (i) This would list the 2 rows on *jiradraftworkflows* DB table having same *workflowname*. In the next step, please delete one of the rows from the above output so that duplication is resolved.

    DELETE from jiradraftworkflows where id = <chosen_id_with_duplicated_parentname>;
  3. Restart JIRA.
  4. Run a re-index of your instance.

Resolution 1.1 - Remove corrupted draft workflow

We will use the following steps to identify corrupted draft workflow records and delete them.  The administrator will decide what constitutes a bad record.

Run the following SQL query on the database (to identify all the draft workflows):

select id,parentname from jiradraftworkflows ;

Try to open each of the workflows for editing and notice if you face any issue while opening any.

If you face an error while opening a workflow for editing, you will need to follow these steps: 

  1. Shutdown JIRA (as the draft workflow XML could be cached in memory).
  2. Run the following SQL:

    -- Confirm the draft workflow ID being deleted (should return 1 and only 1 row)
    SELECT id, parentname from jiradraftworkflows where id = <workflow_id_with_error>;
    
    -- Run the delete
    DELETE from jiradraftworkflows where id = <workflow_id_with_error>;
    
    -- You should get 1 row affected
    
    -- Check that the workflow is now gone (should return 0 rows)
    SELECT id, parentname from jiradraftworkflows where id = <workflow_id_with_error>;
    
    -- You may need to run COMMIT if your SQL editor does not do auto-commit
    commit;
  3. Start JIRA and check that you can now click on JIRA Administration » Issues » Statuses without errors.

Resolution 2 - Remove workflows records with the same name

We will find workflow records with the same case-insensitive names, then remove one of them and verify we have the correct workflow mapped to the project's workflow scheme. 

  1. Run the following SQL query on the database to identify workflow records with duplicate names:

    SELECT count(*), workflowname FROM jiraworkflows group by workflowname having count(*) > 1;
  2. Remove one of the duplicate rows:

    SELECT id,workflowname FROM jiraworkflows;

    (i) This would list the 2 rows on *jiraworkflows* DB table having same *workflowname*. In the next step, please delete one of the rows from the above output so that duplication is resolved.

    DELETE from jiraworkflows where id = <chosen_id_with_duplicated_workflowname>;
  3. Restart JIRA.
  4. Run a re-index of your instance.

Resolution 3 - Remove orphaned schemes

We will find and remove schemes to projects that do not exist.

  1. Run the following SQL query on the JIRA database to identify orphaned schemes associated to a deleted JIRA project. If the following query returns a result, then you are likely affected by this:

    Diagnosis: orphaned rows in the nodeassociation table
    select * from nodeassociation where SOURCE_NODE_ENTITY='Project' AND SOURCE_NODE_ID not in (select ID from project);
  2. Run the following query to delete these orphaned schemes for non-existent projects: 

    Remove orphaned rows in the nodeassociation table
    delete from nodeassociation where SOURCE_NODE_ENTITY='Project' AND SOURCE_NODE_ID not in (select ID from project);
  3. Restart JIRA.
  4. Run a re-index of your instance.

Resolution 4 - Remove duplicate workflow actions

Remove duplicated action in the workflow. Refer to Fixing Workflows with Duplicate occurrence of action.

Resolution 5 - Resolve problem using ScriptRunner

(warning)This is a third party solution, not supported by Atlassian.

In case you are using ScriptRunner plugin, then issue can be resolved by executing below code in ScriptRunner console:

import com.atlassian.jira.component.ComponentAccessor 
def workflowManager = ComponentAccessor.workflowManager
workflowManager.getConfiguration().removeWorkflow('NAME OF WORKFLOW')


Last modified on Dec 15, 2023

Was this helpful?

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