Error when starting physical storage holdings report CSV export

75 views
Skip to first unread message

Steve Lapommeray

unread,
Jul 19, 2022, 5:25:40 PM7/19/22
to AtoM Users
Hello,

I'm seeing this error happen in the gearmand logs very frequently today, with AtoM 2.6.4. 

2022-07-19 17:20:02 > Starting physical storage holdings report CSV export.
PHP Fatal error:  Uncaught Error: Call to a member function getIdentifier() on null in <path>/lib/QubitPhysicalObjectCsvHoldingsReport.class.php:311
Stack trace:
#0 <path>/lib/QubitPhysicalObjectCsvHoldingsReport.class.php(232): QubitPhysicalObjectCsvHoldingsReport->writePhysicalObjectAndHoldings()
#1 <path>/lib/QubitPhysicalObjectCsvHoldingsReport.class.php(206): QubitPhysicalObjectCsvHoldingsReport->writeRowIfNecessary()
#2 <path>/lib/QubitPhysicalObjectCsvHoldingsReport.class.php(199): QubitPhysicalObjectCsvHoldingsReport->exportPhysicalObjectAndHoldings()
#3 <path>/lib/QubitPhysicalObjectCsvHoldingsReport.class.php(182): QubitPhysicalObjectCsvHoldingsReport->export()
#4 <path>/lib/job/arPhysicalObjectCsvHoldingsReportJob.class.php(56): QubitPhysicalObjectCsvHoldingsReport->write()
#5 <path>/lib/job/arBaseJob.class.php(119): arPhysicalObjectCsvHoldingsReportJob->runJob()
#6 <path>/vendor/net_gearman/Net/Ge in <path>/lib/QubitPhysicalObjectCsvHoldingsReport.class.php on line 311

Do you have any ideas as to what to look at to fix this?

Thanks,
Steve

Steve Lapommeray

unread,
Jul 20, 2022, 3:45:39 PM7/20/22
to AtoM Users
I can see this in the Manage - Physical storage section of the Admin. There are empty records at the top. How can I deal with them?

Thanks,
Steve
Screen Shot 2022-07-20 at 3.44.04 PM.png

Dan Gillean

unread,
Jul 26, 2022, 8:34:12 AM7/26/22
to ICA-AtoM Users
Hi Steve, 

What is the full version number listed in Admin > Settings, or returned when you run php symfony tools:version from the command-line? I first want to make sure that one of the upgrade steps wasn't accidentally skipped, leading to a database schema version incompatibility that could be the cause of these errors. 

Otherwise, you could perhaps try running the following task to see if it deletes the empty storage locations: 
If that doesn't work, perhaps you could try running the sample query we have in our Troubleshooting documentation, to see if it returns any data corruption: 
Let us know what you find, and hopefully we can offer further suggestions from there. 

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/4d13aad3-d995-4608-856d-6ad43fec70f1n%40googlegroups.com.

Steve Lapommeray

unread,
Jul 26, 2022, 12:03:59 PM7/26/22
to AtoM Users

Hi Dan,

I get an error message when I try that command.   Task "tools:version" is not defined. 

The version from the admin panel is 2.6.4 - 184.

I have tried deleting the unlinked physical object locations on our test instance where the same problem occurs, but that did not help.

Thanks,
Steve

Dan Gillean

unread,
Jul 27, 2022, 8:23:44 AM7/27/22
to ICA-AtoM Users
Hi Steve, 

On the CLI task, my apologies - that was my fault. The correct syntax is php symfony tools:get-version. Docs here. In any case, it looks like the database schema (v184) is correct for  2.6.4, so no need to look into that any further. 

Have you tried the data corruption SQL query yet? 

In the meantime, I will ask my colleagues if they have further suggestions. 

Cheers, 

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

Dan Gillean

unread,
Jul 27, 2022, 9:28:58 AM7/27/22
to ICA-AtoM Users
Hi again, 

One of our developers recommends that you try a couple maintenance tasks to see if it helps resolve the issue - it may also allow you to find and delete those stub empty storage records as well. 

First, let's try rebuilding the nested set: 
Let's also generate any missing slugs: 
After that, you can try clearing the cache, restarting PHP-FPM, reindexing, and seeing if that changes anything:
  • php symfony cc
  • sudo systemctl restart php7.2-fpm
  • php symfony search:populate
Let us know if that helps! And if not, let me know if anything turned up from the data corruption query. Additionally, tell us a bit more about your installation - any changes from the recommended installation instructions? Any customizations (code changes, custom theme, etc) we should know about? etc.

Cheers, 

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

Steve Lapommeray

unread,
Jul 27, 2022, 4:07:40 PM7/27/22
to AtoM Users
Hi Dan,

I found 5 records with missing publication statuses. I set them to Draft status and ran the tasks you suggested (rebuild nested set, generate slugs, clear cache, restart PHP-FPM, populate search) but there is no change. We are using a custom theme.

Steve

Dan Gillean

unread,
Jul 28, 2022, 4:11:30 PM7/28/22
to ICA-AtoM Users
Hi Steve, 

I have a couple more queries and ideas from one of our developers. First some context: 

The original error in question was returning a problem on line 311 of the relevant report class in AtoM. In that file, we fetch the physical object relations based on the object table (see lines 249-254), and then we try to get the related record (either description or accession) using ID - for descriptions, see for example line 300. 

In AtoM, most main entities have a row in the root object table, where they are given an object ID - and then the rest of their metadata is stored in other database tables, such as information_object and information_object_i18n for descriptions. 

If you have rows where the information object (i.e. description) table data has been deleted, but a partial object table row, then this error might arise. This shouldn't normally happen in AtoM - but could if someone tried using SQL to delete directly from the information object tables for example, or a few other edge cases. 

Either way, we can check if this is the case, and also delete any object rows that are linked to descriptions or accessions but have no ID, with the following queries. 

First, we always recommend making some backups before accessing the MySQL command-prompt. Instructions on how to access the MySQL command prompt can be found here: 
Now, let's check for any descriptions and accessions for records that have a null ID:

SELECT obj.id
FROM object obj
LEFT JOIN information_object io ON obj.id=io.id
WHERE obj.class_name='QubitInformationObject'
AND io.id IS NULL;


and

SELECT obj.id
FROM object obj
LEFT JOIN accession acc ON obj.id=acc.id
WHERE obj.class_name='QubitAccession'
AND acc.id IS NULL;


If these queries do return records, then you can use the following examples to delete these: 

DELETE obj
FROM object obj
LEFT JOIN information_object io ON obj.id=io.id
WHERE obj.class_name='QubitInformationObject'
AND io.id IS NULL;

and

DELETE obj
FROM object obj
LEFT JOIN accession acc ON obj.id=acc.id
WHERE obj.class_name='QubitAccession'
AND acc.id IS NULL;

If you do find anything, I'd recommend re-running the tasks I recommended previously (nested set, slugs, cache clear, repopulate search index) before re-testing. 

Let us know how it goes!

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

Steve Lapommeray

unread,
Aug 1, 2022, 2:55:46 PM8/1/22
to AtoM Users
Hi Dan,

The query to find the QubitInformationObject with null ids did come up with some records, which I deleted. The export ran successfully after that. Thank you very much!

Steve

Reply all
Reply to author
Forward
0 new messages