dspace

Why is it not possible to delete an EPerson in DSpace?


I have looked through previous questions. They mention the way to get around this is to use cascade in sql to delete any relations this user may have on the database. I do not want to use cascade as I want to retain the items a user has uploaded to the repository. How can I go around doing this?

I would like to mention that, looking through the codebase, a class exists called EPersonDeletionException.java, which seems to suggest that EPersons are not allowed if they have their IDs present in certain tables, to be deleted. Why is this be the case?

So far, when trying to delete an EPerson as an admin, it comes up with the following error:

ERROR: update or delete on table "eperson" violates foreign key constraint "item_submitter_id_fkey" on table "item" Detail: Key (uuid)=(c8733cae-ec0d-469d-bf64-81e6b7f3e589) is still referenced from table "item".

I understand it is referencing something in another table, but my original question relates to the above mentioned class, and also, how I can delete an EPerson without the use of cascade.


Solution

  • it sounds like you are using an older version of DSpace (likely v6 or earlier). This deletion bug was fixed in DSpace 7.0 (and later): https://github.com/DSpace/DSpace/pull/2928

    Essentially, the issue was that EPerson objects which had previously submitted Items were not possible to delete (because of the database constraint as shown in the error message you shared). But, this has been fixed in DSpace 7.