[500 Internal Server Error] Unable to execute DELETE statement

44 views
Skip to first unread message

Yoo Young Lee

unread,
May 7, 2019, 4:28:40 PM5/7/19
to AtoM Users
Hi,

There are fonds created with mistakes so we would like to delete them. However, when we tried to delete them, we got a 500 Internal Server Error message.


I checked the error log and there was integrity constraint violation - Cannot delete or update a parent row: a foreign key constraint fails.

"(‘atom’.’information_object’, CONSTRAINT ‘information_object_FK_5’ FOREIGN KEY (‘parent_id’) REFERENCES ‘information_object’ (‘id’))"



I checked the information_object table and the last two records have the first one (steven-gellman-fonds) as its parent_id and UI indicated that the second record has the first one as descendant. 

The first one can't be deleted because it's associated with the last two records, so in order to delete them, I have to remove the last two first, but when I accessed these pages directly, I got a 500 Internal Server Error message because the parent id doesn't exist according to the error log message.

Is there any way to delete these four records in all the related tables in the backend?

Thank you so much for your help,
Yoo Young 


Dan Gillean

unread,
May 8, 2019, 11:20:20 AM5/8/19
to ICA-AtoM Users
Hello Yoo, 

I would suggest starting by trying some of the queries in our Troubleshooting page for resolving data corruption. This is a new documentation page I've recently created in the 2.5 documentation, but everything in it will work in 2.4 as well. See: 
Let us know how it goes! 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory


--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To post to this group, send email to ica-ato...@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/f6fd6bc2-5514-4f6b-a854-4948c30e7bf0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yoo Young Lee

unread,
May 8, 2019, 3:54:53 PM5/8/19
to AtoM Users
Hi Dan,

Thank you for your reply! Just wanted to make sure that it will work in 2.3 as we're still running 2.3.

Best,
Yoo Young
To unsubscribe from this group and stop receiving emails from it, send an email to ica-ato...@googlegroups.com.

Dan Gillean

unread,
May 8, 2019, 5:01:18 PM5/8/19
to ICA-AtoM Users
Hi Yoo, 

Yes, I believe the queries should work there as well - not a lot has changed in the archival description tables in the last couple of releases :)

I always strongly recommend you make backups before messing with the database anyway, just in case! 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory

To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.

To post to this group, send email to ica-ato...@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.

Yoo Young Lee

unread,
May 9, 2019, 1:42:12 PM5/9/19
to AtoM Users
Hi Dan,

It worked. I had to rebuild the nested set.

Thank you so much again!
Yoo Young

Dan Gillean

unread,
May 9, 2019, 2:10:32 PM5/9/19
to ICA-AtoM Users
Great! Thanks for updating the thread and letting us know! 


Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory

To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.

To post to this group, send email to ica-ato...@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.
Reply all
Reply to author
Forward
0 new messages