Error while creating a new archival institution

47 views
Skip to first unread message

Martin Longo

unread,
Jun 8, 2020, 2:19:05 PM6/8/20
to AtoM Users
Hello there again ...

Our Atom installation was successfully upgraded from 1.3.1 to version 2.5.4 after solving some problems (https://groups.google.com/forum/#!topic/ica-atom-users/9T7EJGNfVaw) and everything that was working with the old version is working now.

Nevertheless, I'm facing a problem when I want to add an archival institution. I keep getting an 500 error and the corresponding error in the logs:

2020/06/08 14:38:36 [error] 724#724: *509 FastCGI sent in stderr: "PHP message: Unable to execute INSERT statement. [wrapped: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`atom25`.`note`, CONSTRAINT `note_FK_2` FOREIGN KEY (`type_id`) REFERENCES `term` (`id`) ON DELETE SET NULL)]" while reading response header from upstream, client: 172.22.185.23, server: _, request: "POST /index.php/repository/add HTTP/1.1", upstream: "fastcgi://unix:/run/php7.2-fpm.atom.sock:", host: "172.22.185.15", referrer: "http://172.22.185.15/index.php/sfIsdiahPlugin/edit?sf_culture=en"

I searched for post related to this problem and tried what was suggested in this one (with no luck):


Not sure if it related to this problem, but if I want to "Browse" -> Repositories, I get no results while I think there should be at least one .... (checking the database I see that the "repository" table has one record)....

Thanks in advance for any tip or pointer about this problem!


Dan Gillean

unread,
Jun 8, 2020, 4:50:08 PM6/8/20
to ICA-AtoM Users
Hi Martin, 

I'm going to ask one of our developers to respond on thread with further ideas. In the meantime, I suggest that you take a look at the section in our Troubleshooting documentation on Data corruption. Running some of the recommended tasks (such as regenerating slugs and rebuilding the nested set) and some of the queries (to determine if some of the issues you are experiencing are related to more pernicious corruption in the database should at least help us rule out some possible causes and gather more information. See: 
In the meantime, we're working on improving the foreign key declarations in the upcoming 2.6 release, which should hopefully help us avoid some of these issues in the future. See: 
More soon, hopefully! In the meantime, please share any relevant info you find from your investigations. 

Cheers, 

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


--
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 view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/9a30eeb5-5c53-4263-adf4-1776963ee8b4o%40googlegroups.com.

José Raddaoui

unread,
Jun 9, 2020, 9:48:40 AM6/9/20
to AtoM Users
Hi Martin,

Reading the error and the related thread, it looks like the issue could be a missing term in the database. However, when I create a repository with only the identifier, AtoM automatically adds a maintenance note related to that repository and that note type term seems to be in AtoM since 1.x. Could you check that this is really the issue in your case?

SELECT * FROM object o, term t, term_i18n i18n WHERE o.id=127 AND o.id=t.id AND t.id=i18n.id AND i18n.culture='en';

After connecting to the AtoM database, that statement should show you if the "Maintenance note" term exists. Please, let us know the result so we can follow-up.

Best regards.

Martin Longo

unread,
Jun 9, 2020, 1:10:38 PM6/9/20
to ica-ato...@googlegroups.com
Hi there José...
Thanks for the pointer on my problem...

I have executed the query you suggested and it returned no results... so the missing "Maintenance note" term might be the problem... or at least a part of it. Since this is an upgraded installation from 1.3 I don't know why it doesn't exist.

Is this a term I should add via the Atom interface or should be inserted directly into the database?

--
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.

José Raddaoui

unread,
Jun 10, 2020, 8:38:09 AM6/10/20
to AtoM Users
Thanks Martin,

I may be wrong about this, but my initial impression is that the issue already existed in 1.3 and that it was probably introduced in a previous upgrade from 1.x to 1..x. It has appeared now for one of two reasons, either it's just the first archival institution being created (the one in the repository table is the root repository, used for permissions) or it's related to the MySQL 5.7 upgrade and the inclusion of STRICT_TRANS_TABLES in the sql_mode (see http://projects.artefactual.com/issues/13313 for more information about this issue).

You could use some SQL queries and existing tasks to add the term but I have created the following script to do it in one go:


Place that script in the AtoM folder and (also located in the AtoM folder) run:

php symfony tools:run add_maintenance_note_term.php

It will fail if there is something using the id already. Otherwise, it will create the term as in a new install (with all translations). Please, let us know how it goes.

Best regards,
Radda.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-ato...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages