Unable to delete records

120 views
Skip to first unread message

Beda Szukics

unread,
Jan 22, 2017, 11:00:49 AM1/22/17
to AtoM Users
Hi all

I'm trying to delete an authority record. But I get a "500 Internal Server Error".

The error log has

[Sun Jan 22 16:56:41.203463 2017] [:error] [pid 20331] [client xxx.xxx.xxx.xxx:55999] arElasticSearchInformationObjectPdo: Couldn't find ancestors, please make sure lft and rgt values are correct, referer: http://archiv.abtei-muri.ch/index.php/altmann-und-bittner/actor/delete

What is wrong?

Beda

Dan Gillean

unread,
Jan 23, 2017, 1:48:59 PM1/23/17
to ICA-AtoM Users
Hi Beda,

Usually we see that error when there is a problem with the nested set. AtoM uses a MySQL relational database, so we employ a Nested set model to manage hierarchical data such as an archival unit (as represented in the treeview, for example). Sometimes, if a long-running action (such as an import, edit, or move operation) that affects a hierarchy times out mid-process, it can leave the nested set in a corrupted state. My guess is that this is what's happening here, and you are seeing this error because the authority record in question is linked to an archival description affected by this issue.

We have a command-line task that will allow you to rebuild the nested set. I would also recommend that you try clearing the application cache, restarting services, and repopulating the search index after, to see if these maintenance tasks resolve the issue and allow you to delete the authority record. From the root directory in AtoM, try the following command to rebuild the nested set:

You can then try restarting your services - namely, PHP-FPM and Ngninx. This assumes you have followed our default installation instructions for Ubuntu 14.04:

  • sudo service php5-fpm restart
  • sudo service nginx restart

Clear the application cache:

Repopulate the search index:

Try deleting your authority record again, and let us know if that has resolved the issue. If not, please let us know a bit more about your instance - what version of AtoM? What version of PHP? Did you follow our recommended installation instructions, or have you done anything differently? Etc.

Cheers,


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-users+unsubscribe@googlegroups.com.
To post to this group, send email to ica-atom-users@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/0b8496eb-7c18-43cd-8ea9-bc773f5f48dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Beda Szukics

unread,
Jan 24, 2017, 1:42:20 PM1/24/17
to AtoM Users
Hi Dan

Am Montag, 23. Januar 2017 19:48:59 UTC+1 schrieb Dan Gillean:

I did

php symfony propel:build-nested-set

sudo service php5-fpm restart

sudo apache2ctl restart
                - because I use the apache web server

php symfony cc

php symfony search:populate

didn't work. I had to do a

sudo php symfony search:populate

to get it done. Is this a mistake?

The record still can't be written (if it has been changed) or deleted.


I get:

[Tue Jan 24 19:37:07.656564 2017] [:error] [pid 24202] [client 85.3.114.196:60092] arElasticSearchInformationObjectPdo: Couldn't find ancestors, please make sure lft and rgt values are correct, referer: http://archiv.abtei-muri.ch/index.php/winzeler-und-burkhard-architekten/edit

or

[Tue Jan 24 19:38:46.701696 2017] [:error] [pid 24229] [client 85.3.114.196:60100] arElasticSearchInformationObjectPdo: Couldn't find ancestors, please make sure lft and rgt values are correct, referer: http://archiv.abtei-muri.ch/index.php/winzeler-und-burkhard-architekten/actor/delete

I guess it has to do how the records habe been added. They were imported and my collegue told me he didn't succeed the first time and had to repeat the process twice.


My server runs debian 8.7 (jessie), AtoM is 2.3.0 138, PHP is PHP 5.6.29-0+deb8u1

I followed the instruction with the exeption of the web server, it's apache.

Greetings

Beda

Dan Gillean

unread,
Jan 24, 2017, 3:35:12 PM1/24/17
to ICA-AtoM Users
Hi Beda,

Following the link to your site, I can see that the stub authority record is linked to a number of untitled archival descriptions that generate a 500 error when you try to access them - so it seems likely to me that the failed import has left some corrupted data in your installation, and this is likely causing the issues.

You can always take a look in the webserver error logs to see if there is relevant information there. If you get an error, follow these instructions to check the logs and share the relevant entry with us, so we can see what the messages associated with the 500 errors indicate:

Note that we have some command-line tutorial videos that might be of use for some of the above tasks. Video 4 covers using Debug mode and checking the Nginx error logs; video 5 covers some of the troubleshooting CLI tasks I've shared in previous messages:

In terms of dealing with data corruption, there can be a number of factors, and it can be difficult to troubleshoot. If you have a database backup from prior to the failed import, loading it may be the easiest solution. If not, you will have to do some digging.

One easy thing to check is whether or not all descriptions have slugs - there is a task that will regenerate the permalinks (i.e. slugs) for all of your descriptions:

  • php symfony propel:generate-slugs

Docs: https://www.accesstomemory.org/docs/2.3/admin-manual/maintenance/cli-tools/#generate-slugs

If there are still issues, then it gets more complicated to troubleshoot. You can check first to see if all descriptions have a publication status. Here are a couple user forum posts with some instructions to try if you are still running into issues or errors that you suspect are related to database corruption:

I don't know if it will work if there is database corruption, but there is a command-line task to delete descriptions - it's possible you can use this on the untitled descriptions:

  • php symfony tools:delete-description <slug>

Docs: https://www.accesstomemory.org/docs/2.3/admin-manual/maintenance/cli-tools/#delete-a-description

As I said, this may not work if there is corruption in the database, but it's worth a try.

Note that in AtoM 2.3, we have introduced the use of transactions, to try to prevent data corruption - essentially, if a request times out mid-process, AtoM will automatically roll back to the last database state, instead of leaving corrupted data in the system. Hoipefully this might prevent such issues from arising in the future. We are hoping to release version 2.3.1 later this week.

Finally, the fact that you had to use sudo with the search:populate command suggests that your filesystem permissions may not be configured correctly, and/or you are not currently acting as the www-data user. You can try resetting the permissions in your site by running the following from AtoM's root directory:

  • sudo chown -R www-data:www-data /usr/share/nginx/atom
  • Except, replace /usr/share/nginx/atom with the path to your AtoM instance.

Hope this helps! Let us know how it goes.

Regards,


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-users+unsubscribe@googlegroups.com.
To post to this group, send email to ica-atom-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.
Reply all
Reply to author
Forward
0 new messages