Error on refreshing workflow ('update or delete on table "workflowversion" violates foreign key constraint')

I get the error below when attempting to refresh one of my workflows. (i.e. I pushed the “Refresh” button that has the tooltip “Sync the workflow with the source control repository”). Has anyone experienced something similar and perhaps found a fix?

The webservice encountered an error.

[HTTP 500] OK: org.hibernate.exception.ConstraintViolationException: could not execute statement could not execute statement ERROR: update or delete on table “workflowversion” violates foreign key constraint “fk_workflow_default_workflowversion” on table “workflow” Detail: Key is still referenced from table “workflow”.

Hey Martin,

Welcome to the forum.

I haven’t seen that error before personally, but what I think might be happening is you had a workflow version that was set as the default version on Dockstore, and that version was deleted on GitHub/Bitbucket/Gitlab. So Dockstore is trying to delete that version, but because it is the default version it is throwing an unhandled error.

Do you have a default version on Dockstore that no longer exists on the original source control?

You can check which version is default by going to My Workflows, selecting the workflow you refreshed, and clicking on the versions tab. The version that is default should have a blue label.

Then check to see if that version still exists on your source control.

If this is the case, then I think just changing the default version to an existing version on the source control would fix this.


1 Like

Yes - This is exactly what happened. Thanks for identifying the problem!

I’m happy to help. Were you able to resolve the issue?