Hi Carolyn,
A clean integrity report is expected here, and it tells you less than it looks like it does. That task cannot see authority records at all.
Every check it runs is scoped to descriptions and terms. In 2.10 the "invalid descriptions" query in lib/task/tools/dataIntegrityRepairTask.class.php ends:
WHERE class_name="QubitInformationObject"
AND object_id NOT IN (SELECT id FROM information_object);
and the checks above it all select FROM information_object or information_object_i18n, with one UPDATE against term. There is not a single query touching the actor tables. So a clean report rules out a broken description tree and says nothing whatsoever about open-6 if open-6 is an authority record. Worth knowing before you spend more time on that task, and also worth knowing that --mode=fix is safely scoped by that class_name filter, so it was never going to touch your authority records either way.
That is probably also why the id lookup came back empty. If 380823 is the authority record itself, it lives in actor, not information_object, and zero rows there is normal rather than a sign of corruption. First thing I would
confirm:
SELECT s.slug, s.object_id, o.class_name
FROM slug s
LEFT JOIN object o ON
o.id = s.object_id
WHERE s.slug = 'open-6';
If class_name comes back QubitActor, call that id X and check the record is structurally whole:
SELECT (SELECT COUNT(*) FROM object WHERE id = X) AS object_row,
(SELECT COUNT(*) FROM actor WHERE id = X) AS actor_row,
(SELECT COUNT(*) FROM actor_i18n WHERE id = X) AS i18n_rows;
Then hunt the dangling reference, which is what I would expect to be behind a
500 on delete. Deleting an actor cascades through its events and relations, and if one of those points at an object that no longer exists, the cascade hits a null and dies:
-- events tying this actor to a description that is gone
SELECT
e.id AS event_id, e.object_id AS missing_object
FROM event e
LEFT JOIN object o ON
o.id = e.object_id
WHERE e.actor_id = X AND e.object_id IS NOT NULL AND
o.id IS NULL;
-- relations with a dangling end
SELECT
r.id AS relation_id, r.subject_id, r.object_id
FROM relation r
LEFT JOIN object s ON
s.id = r.subject_id
LEFT JOIN object t ON
t.id = r.object_id
WHERE (r.subject_id = X OR r.object_id = X)
AND (
s.id IS NULL OR
t.id IS NULL);
-- actor nested set and parentage
SELECT id, parent_id, lft, rgt FROM actor WHERE id = X OR parent_id = X;
If one of those returns rows, that is your culprit. Take a dump of the affected tables first, delete the dangling rows, and then delete the authority record through the user interface so the normal cascade runs. Rebuild with search:populate afterwards.
On your last question: please do not delete open-6 from the slug table on its own. It removes the URL and nothing else. The object, actor and actor_i18n rows and every relation stay exactly where they are, so you end up with a record that is unreachable, still broken, and now much harder to find again. The slug is the symptom rather than the problem. Cascading deletes in AtoM are driven from the object table via the Propel model, not from information_object, and for an authority record information_object is not involved at all.
The other thing still missing is the actual text of the error. Daniel and Alberto both asked for it and the screenshots do not let anyone read the stack trace, which is where the answer almost certainly is. Something like:
sudo tail -n 100 /var/log/nginx/error.log
pasted as text will show the exception class, file and line. An integrity constraint violation and a null dereference look identical from the browser and need completely different fixes, so that one paste probably saves another round of guessing.
One last thing worth raising upstream, since you hit it: at line 253 the task calls fputcsv() on the result of fopen() without checking it. When the path is not writable, fopen() returns false and you get the TypeError you saw instead of a readable "cannot open file for writing" message. Alberto diagnosed it correctly from the symptom, but the next person will lose the same twenty minutes. Might be worth an issue.
Best regards,
Dr Johan Pieterse
The Archive and Heritage Group