Partially deleted Information Objects

34 views
Skip to first unread message

r.ruti...@docuteam.ch

unread,
Jun 13, 2022, 9:17:37 AMJun 13
to AtoM Users
Hi,

I have the following situation:

I want to change a description's slug and then it says the slug is already in use. 
If I enter the slug in the browser, the page does not exist.

I did some research in the database:

SELECT
  slug.id AS SLUG_ID,
  slug.slug AS SLUG,
  slug.object_id AS SLUG_OBJECTID,
  object.id AS O_ID,
  information_object.id AS IO_ID,
  information_object.identifier AS IO_IDENTI,
  information_object_i18n.title AS IOI_TITLE
FROM slug
LEFT JOIN object
  ON object.id = slug.object_id
LEFT JOIN information_object
  ON information_object.id = object.id
LEFT JOIN information_object_i18n
  ON information_object_i18n.id = object.id
WHERE object.class_name like 'QubitInformationObject'
  AND slug.slug like 'bib-avlp-204-1848'


Result:
+---------+-------------------+---------------+------+-------+-----------+-----------+
| SLUG_ID | SLUG              | SLUG_OBJECTID | O_ID | IO_ID | IO_IDENTI | IOI_TITLE |
+---------+-------------------+---------------+------+-------+-----------+-----------+
|    3191 | bib-avlp-204-1848 |          3331 | 3331 |  NULL | NULL      | NULL      |
+---------+-------------------+---------------+------+-------+-----------+-----------+


So we have the connections between slug, object, and information_object(_i18n).

My questions are:
- how can it be that there is an object but no corresponding entry in information_object?
- What exactly happens in the background if you delete a description in the GUI - does it delete the entry in the object table and also in the slug table? Because it seems here that an information object was not deleted completely, just from the information_object table.
- in order to cleanup : should I create a query that deletes all entries in the objects table that have 
  a) a slug in the slug table
  b) no corresponding entry in the information_objects table?

Cheers, Roger

Dan Gillean

unread,
Jun 14, 2022, 8:31:43 AMJun 14
to ICA-AtoM Users
Hi Roger, 

- how can it be that there is an object but no corresponding entry in information_object?

First, remember that all core entities in AtoM have slugs, not just information objects. There are also root objects to which other records are attached that are never shown in the user interface (for example, all top-level information objects are technically children of a hidden root information object). So, this slug could be associated with a valid record or object in AtoM even if it has no information object association. 

I think a good first step would be to try a query that joins the object and slug tables, and includes the object.class_name column, so we know more about what the record in question actually is. 

Otherwise, I think it is possible that a large delete operation that exhaust resources or times out before it completes could leave some orphan rows in the database
 
- What exactly happens in the background if you delete a description in the GUI - does it delete the entry in the object table and also in the slug table?

Yes, I believe that deletions begin in the object table and cascade to other related tables. In 2.6, I think this should be wrapped in a SQL transation.
 
Because it seems here that an information object was not deleted completely, just from the information_object table.
- in order to cleanup : should I create a query that deletes all entries in the objects table that have
  a) a slug in the slug table
  b) no corresponding entry in the information_objects table?

If you run another query to determine what record is currently using the target slug and discover there's no entity relationship at all and it does appear to be corrupted, the first thing I'd try would be running the slug generation task - if you run it using the --delete option so it regenerates all slugs and not just those missing, I think there's a chance it will remove the partial. HOWEVER, be cautious doing this: depending on how you've been creating slugs for your descriptions, this suggestion may not be what you want to do. If you use the --delete option, then all slugs will be created from scratch again, and for descriptions, this is based on the settings you have currently in place for the slugs (permissive or not; and the Generate permalinks from setting). This means any manually edited slugs would be lost, and replaced with a slug generated from the title/identifier/etc/whatever settings you've used. 

Alternatively, you could try manually deleting the slug using SQL, and then try using the slug generation task without the delete option. 

If the slug is associated with a record and is not an orphaned leftover of a failed deletion operation, then yet another option would to try using SQL to manually update the slug, to free up that value for use on your archival description. 

If the target record turns out to be an information object based on your first query, but it's missing key information that would allow it to display, be edited, etc - then check out the recommendations we have for dealing with data corruption in information objects here: 
If none of that helps, let me know and I will ask our developers for suggestions on the best way to cascade a SQL deletion of a partial record. 

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/78a2bc02-35c2-427c-8b7a-611366634f50n%40googlegroups.com.

r.ruti...@docuteam.ch

unread,
Jun 15, 2022, 4:42:11 AMJun 15
to AtoM Users
Hi Dan,

Thanks for your response. 

I am aware that an "object" cannot be just an "information object". object.classname is in this case here "QubitInformationObject".

The query from https://www.accesstomemory.org/de/docs/2.6/admin-manual/maintenance/troubleshooting/#dealing-with-data-corruption gives me only one entry for the slug bib-avlp-204-1848-1, which is fine. There is no entry for the slug bib-avlp-204-1848.
It is therefore somewhat difficult to estimate whether I may delete the slug bib-avlp-204-1848. Since only the slug and the object is present (as "QubitInformationObject") but without an entry in the table "information_object", I can assume that I can delete it. So I can then regenerate slugs (without the "--delete" option). Would you agree?

Indeed, the easiest thing would be to just regenerate the slugs with the "--delete" option - but I need to clarify first if there are manually customized slugs.

Cheers, Roger

Dan Gillean

unread,
Jun 16, 2022, 11:54:11 AM (13 days ago) Jun 16
to ICA-AtoM Users
Hi Roger, 

If you're certain that it's a partial record you don't need, I would suggest first trying to run the slug task as is, to see if it deletes the record. If not, you could try manually deleting the slug value first, then running the task again to see if it helps. As always, making a backup first is advised, just in case!

If, after your investigations, it turns out that none of the above options worked and using the --delete option is not viable, let me know and I will see if I can get suggestions on the best way to clean this up via SQL. 

Cheers, 

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

r.ruti...@docuteam.ch

unread,
Jun 16, 2022, 5:12:21 PM (13 days ago) Jun 16
to AtoM Users
Hi Dan,

I did the following:

(1) sudo php symfony propel:generate-slugs && sudo php symfony search:populate
The slug bib-avlp-204-1848 was still there afterwards, and also the corresponding object ID 3331 in the object table.

(2) deleted the slug bib-avlp-204-1848 in the slug table, and then hit again the two commands from (1)
The object ID 3331 is still there in the object table, but no slug was automatically created in the slug table.

So that's funny... Do you possibly have further suggestions?

Cheers, Roger

José Raddaoui

unread,
Jun 22, 2022, 1:44:57 AM (7 days ago) Jun 22
to AtoM Users
Hi Roger,

(1) Without the --delete option the slug won't be deleted.

(2) Probably because the information_object entry doesn't exists.

You should be able to use the slug now and you could run the following query to remove the object entry:

DELETE FROM object WHERE id=3331;

Lets us know if you need further suggestions for something else.

Best,
Radda.

r.ruti...@docuteam.ch

unread,
Jun 22, 2022, 3:43:36 AM (7 days ago) Jun 22
to AtoM Users
Hi Radda,

Thanks - I just had the confirmation from the customer so that I can use the --delete option. It worked well, all good now.
We would just like to understand what caused the effect of having a slug, a corresponding object, but no information-object attached. 
But I guess we'll have to wait to see if it happens again. Maybe it was due to a cancelled, unfinished csv import task or something...

Thanks Dan and Radda, have a nice day
Roger
Reply all
Reply to author
Forward
0 new messages