Unable to Delete Published Dataverse Collection

4 views
Skip to first unread message

Alfredo Cosco

unread,
9:03 AM (6 hours ago) 9:03 AM
to Dataverse Users Community

Hello everyone,
I'm having problems deleting a collection on a Dataverse 6.3 instance.

Background: the collection is published but empty.

When I try to delete it from the UI, I get an error message:
"This dataverse was not able to be deleted. If you...."

When I try to delete it via API, I get an empty json: {}

In all cases, I have this error in the log:
Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 4.0.1.payara-p2.v202310250827): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: org.postgresql.util.PSQLException: ERROR: update or delete on table "dataverse" violates foreign key constraint "fk_metric_dataverse_id" on table "metric" Detail: Key (id)=(3498) is still referenced from table "metric".

Could the problem be related to the fact that the collection was published? 

Indeed, in the manual (https://guides.dataverse.org/en/6.3/user/dataverse-management.html) it states that: 

"Delete Dataverse: you are able to delete your Dataverse collection as long as it is not published and does not have any draft datasets"

However, here: 

https://guides.dataverse.org/en/6.3/admin/dataverses-datasets.html#delete-a-dataverse-collection 

and here: 

https://guides.dataverse.org/en/6.3/api/native-api.html#delete-a-dataverse-collection 

the condition for being able to execute the DELETE seems only one: that the collection be empty.

Thanks,
Alfredo Cosco

James Myers

unread,
10:00 AM (6 hours ago) 10:00 AM
to dataverse...@googlegroups.com

Looks like a bug w.r.t. deleting metrics when the collection is deleted (should have a github issue) – probably some cascade and orphanRemoval=true annotations needed to delete metrics when the associated collection/dateset is deleted.

 

A work-around is to either delete the specific metrics  - either via the API or deleting the relevant entries from that table/just truncating the whole metrics table before doing the collection delete (the metrics table is just a cache, entries will be regenerated as people request the specific metrics).

 

-- Jim

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-commu...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dataverse-community/55bd72d4-2964-4d4d-a7fb-ea6d32966d60n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages