Hi Dan!
Thanks for your help. I have not yet tried the queries that you sent me, I will try them later, but here's a summary of what happens and of what I did so far:
The 500 error appears when I click on certain descriptions, no matter if the base page was the fullwidth treeview on top of a description, or the full hierarchy page, or search result.
If I click on a bad description in the full-width hierarchy it won't do nothing visually. Neither URL nor content changes, but you see the 500 in the nginx error.
Let's say I was in the detail-view of the description Item C11.2 and I have the following hierarchy (example) on top of the page.
Fonds A
-- Fonds B
-- Fonds C
---- Sub-Fonds C1
------ Sub-Fonds C11
-------- Item C11.1-------- Item C11.2 (active)-------- Item C11.3Clicking on some of the Items C11.1-3 and on Fonds B and Fonds C it would work
Clicking on Sub-Fonds C11, Sub-Fonds C1, Fonds A it would give 500 in nginx error log, but nothing happens in the browser.
By the way: We're talking about the test environment, which has 40'903 archival descriptions.
If I enter the URL to the bad description directly, i get the 500 error screen. This is also the case when I click on the description in the search result list.
Displays:
Oops! An Error Occurred
Sorry, something went wrong.
The server returned a 500 Internal Server Error.
Try again a little later or ask in the discussion group.
Back to previous page.the nginx error.log shows:
2023/08/30 16:17:02 [error] 13882#13882: *1765 FastCGI sent in stderr: "PHP message: [wrapped: SQLSTATE[HY000]: General error: 3636 Recursive query aborted after 1000001 iterations. Try increasing @@cte_max_recursion_depth to a larger value.]" while reading response header from upstream, client: 10.15.24.134, server: xyz.CENSORED.org, request: "GET /archive-a HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.atom.sock:", host: "xyz.CENSORED.org", referrer: "https://xyz.CENSORED.org/browse/hierarchy"Then I rebuild the nested set, it workded fine, but did not have any effect. I also updated the elasticserach index.
root@A15:/usr/share/nginx/atom# sudo -u www-data php symfony propel:build-nested-set
>> propel Build nested set for information_object...
>> propel Build nested set for term...
>> propel Build nested set for menu...
>> propel Done!
Then I tried to export from the CLI:
Variant 1:
root@A15:/usr/share/nginx/atom# php symfony csv:export full-export.csv
Exporting as ISAD.
[wrapped: SQLSTATE[HY000]: General error: 3636 Recursive query aborted after 1000001 iterations. Try increasing @@cte_max_recursion_depth to a larger value.]
Variant 2:
root@A15:/usr/share/nginx/atom# php symfony csv:export --single-slug="archive-a" archive-a.csv
Exporting as ISAD.
...............[many more dots clipped]..............................
[wrapped: SQLSTATE[HY000]: General error: 3636 Recursive query aborted after 1000001 iterations. Try increasing @@cte_max_recursion_depth to a larger value.]
Just to make sure it works with another slug... it does.
root@A15:/usr/share/nginx/atom# php symfony csv:export --single-slug="archive-b" archive-b.csv
Exporting as ISAD.
...............[many more dots clipped]..............................
Export complete (2445 descriptions exported).
Investigating further, I realized that about 350 archival descriptions don't have a parent_id (value is NULL) which as far as I know should not be.
So I set the parent_id to 1 for those, leaving lft and rgt untouched. I thought I could move them back to the correct place later. Strangely, although the parent_id was NULL, they appeared on the correct place within the hierarchy in AtoM (why?).
Then I built the nested set once again, but after a while (like 10 minutes or so) it crashed, displaying killed in the shell. I ran the build-nested-set command with nohup in the background and saw the process in htop consuming lots of memory until it crashed.
I also ran sudo php symfony search:populate. It is currently running, but I doubt it will work out fine. Indexing runs much slower than in the normal case, before I set the parent_id to 1 and built the nested set.
Of course, in between all the steps I restartet memcache, php, mysql etc., cleared the cache, just to be on the safe side.
So you see the data is a huge mess and I don't have any clue what to do next. Also, I would like to understand what could lead to the mess - my guess is that it's due to imports of malformed CSV and/or unfinished import jobs.
A solution would be to drop the database and import the one from the production system, but the problem is that it has even 600+ archival descriptions with parent_id = NULL! The customer said that there are also some descriptions that yield a 500 error when clicked on.
I would like to know how to cleanse the data.
And we're working on upgrading to 2.7.3 so that the CSV validator can be used!
Looking forward to your thoughts on this.
Roger