PHP Fatal Error when importing CSV file.

170 views
Skip to first unread message

lud...@possiefamily.com

unread,
Aug 4, 2017, 6:01:56 PM8/4/17
to AtoM Users
I'm running AtoM 2.4.0-155.  I'm attempting to import a CSV file to a specific item.  When I attempt to import using the web interface, I get an error 500.  I didn't find anything on the nginx logs (/var/log/nginx/error.log), or on the AtoM logs (/usr/share/nginx/atom/log).  

I then attempted to import the CSV manually via command line.  I'm getting the following error, I'm assuming this is what is causing the error 500, but I'm not sure how to proceed.

systems@AtoMTEST:/usr/share/nginx/atom$ sudo -u www-data php /usr/share/nginx/atom/symfony csv:import /home/systems/metadata.csv
WARNING: If you're importing multiple CSV files as part of the same import it's advisable to use the source-name CLI option to specify a source name (otherwise the filename will be used as a source name).
PHP Fatal error:  Call to undefined function getIdCorrespondingToSlug() in /usr/share/nginx/atom/lib/task/import/csvImportTask.class.php on line 197

During the installation I installed all the necessary extensions.  Is there something I missed?

systems@AtoMTEST:/usr/share/nginx/atom$ sudo apt-get install php5-cli php5-fpm php5-curl php5-mysql php5-xsl php5-json php5-ldap php5-readline php-apc
Reading package lists... Done
Building dependency tree
Reading state information... Done
php5-json is already the newest version.
php-apc is already the newest version.
php5-cli is already the newest version.
php5-curl is already the newest version.
php5-ldap is already the newest version.
php5-mysql is already the newest version.
php5-readline is already the newest version.
php5-xsl is already the newest version.
php5-fpm is already the newest version.

Dan Gillean

unread,
Aug 7, 2017, 3:34:30 PM8/7/17
to ICA-AtoM Users
Hi Ludwig, 

Did you install following our Ubuntu 14.04 or 16.04 instructions? Can you please describe further what you mean when you say you are importing a CSV to a specific item? As in, you are using the qubitParentSlug column to add new lower-level descriptions below an existing item? 

Are you willing to share the sample CSV, so I can try to reproduce the issue? 

I noticed that php-apcu was not in the list. If you've followed the 16.04 instructions, did you follow this part of the installation instructions?

We also need php-apcu-bc, which is not available yet in Ubuntu 16.04. Let’s install it manually for now:
sudo apt install php-dev
sudo pecl install apcu_bc-beta
echo "extension=apc.so" | sudo tee /etc/php/7.0/mods-available/apcu-bc.ini
sudo ln -sf /etc/php/7.0/mods-available/apcu-bc.ini /etc/php/7.0/fpm/conf.d/30-apcu-bc.ini
sudo ln -sf /etc/php/7.0/mods-available/apcu-bc.ini /etc/php/7.0/cli/conf.d/30-apcu-bc.ini
sudo systemctl restart php7.0-fpm
In the user interface, 2.4 relies on the AtoM job scheduler to perform the installation asynchronously in the background. You'll need to make sure that gearman is installed and properly configured. See: 
You can try restarting the atom-worker if it's not working. In Ubuntu 14.04: 
  • sudo start atom-worker # Starts the worker 
  • sudo stop atom-worker # Stops the worker 
  • sudo restart atom-worker # Restarts the workers 
  • sudo status atom-worker # Obtain current running status

In 16.04: 
  • sudo systemctl start atom-worker # Starts the worker 
  • sudo systemctl stop atom-worker # Stops the worker 
  • sudo systemctl restart atom-worker # Restarts the workers 
  • sudo systemctl status atom-worker # Obtains current status

Any further information you can provide will help us help you. 

Thanks! 

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/c2d9d4e5-1f2c-406d-884c-efc5506f8b30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

lud...@possiefamily.com

unread,
Aug 7, 2017, 5:31:31 PM8/7/17
to AtoM Users, lud...@possiefamily.com
Dan;
I appreciate your reply.  AtoM 2.4 is installed on Ubuntu 14.04.  The instructions I followed are found here

I apologize if I'm not articulating myself very well.  This is very new to me and I'm not very familiar with all the terminology, I'll try describe in more details what I'm doing to give a better idea what I'm trying to do!

  • Using an administrator account I logged into AtoM and created a 'Test' Archival Description.
  • I then successfully used Archivematica to upload DIP to AtoM, provided 'Test' as slug.
  • In AtoM, I navigate to the Archival description I created earlier ("Test") and select the image (identifier = 000600, slug=test) that I would like to add metadata to.
  • I select the Import CSV link.
  • Leave all options as default (Type = Archival Description, Update Behaviour = Ignore matches and create new records to import)
  • Select the metatdata.csv file and select the import button
  • I get an error 500 page.
Since I don't get specifics on the error.  I then attempted to import the same CSV file over the command line in hopes I find a more descriptive error to help me troubleshoot.
  • I'll navigate to the /usr/share/nginx/atom directory
  • Run the following command:  sudo -u www-data /usr/share/nginx/atom/symfony csv:import /home/systems/metadata.csv
  • Get the following error:  PHP Fatal error:  Call to undefined function getIdCorrespondingToSlug() in /usr/share/nginx/atom/lib/task/import/csvImportTask.class.php on line 643
  • Checked the status of atom-worker:
  • systems@AtoMTEST:/usr/share/nginx/atom$ sudo status atom-worker
    atom-worker start/running, process 608


metadata.csv
legacyId,parentId,qubitParentSlug,identifier,accessionNumber,title,levelOfDescription,extentAndMedium,repository,archivalHistory,acquisition,scopeAndContent,appraisal,accruals,arrangement,accessConditions,reproductionConditions,language,script,languageNote,physicalCharacteristics,findingAids,locationOfOriginals,locationOfCopies,relatedUnitsOfDescription,publicationNote,digitalObjectURI,generalNote,subjectAccessPoints,placeAccessPoints,nameAccessPoints,genreAccessPoints,descriptionIdentifier,institutionIdentifier,rules,descriptionStatus,levelOfDetail,revisionHistory,languageOfDescription,scriptOfDescription,sources,archivistNote,publicationStatus,physicalObjectName,physicalObjectLocation,physicalObjectType,alternativeIdentifiers,alternativeIdentifierLabels,eventDates,eventTypes,eventStartDates,eventEndDates,eventActors,eventActorHistories,culture
,,test,000600,,Students Creating Basketball Posters,item,1 Phograph,WSU Archives,,,Student create posters for a basketball game,,,,,,en,Latn,,"4"" Length, 5"" Width, Negative type: ACETATE",,"WA-P Box C4 Fd8 Classes, Misc.",,,,,,,,,,,,,Draft,Full,,en,Latn,Weber State University,,Draft,,,,,,,Creation,2012-04-16,,,,

I don't know what the legacyID or the parentID are so I'm hoping the qubitParentSlug and identifier in the CSV will be enough to narrow down to which image I want the metadata to get added.  I hope this makes more sense.   I appreciate your patience and assistance with this.

Cheers,
Ludwig

Dan Gillean

unread,
Aug 8, 2017, 11:23:24 AM8/8/17
to ICA-AtoM Users
Hi Ludwig, 

Thanks so much for the additional context. Nothing that you describe in your steps should prevent the CSV from importing, and I didn't see any formatting errors in the CSV data itself that would cause this error. I have managed to replicate this with your CSV, and with our sample CSV, in my own local 2.4 test environment, and I think you might have identified a bug. I've filed a bug report so our developers can take a look - we are in the process of testing 2.4 in advance of the final public release, so it's possible you've come across a regression! 

Here is the related issue ticket I've created: 
Once I've had the opportunity to discuss this with a developer, I'll get back to you with more information. If it is a bug in the application, I'm hoping we can address it prior to the final release. 

For a bit of context, the normal usage of the legacyId and parentId columns is to manage hierarchical relationships between new records in the CSV. The qubitParentSlug column is used to add new child records to existing parents already in AtoM. They are both explained in greater detail in the following sections of the documentation: 
To be clear as well, the way you were attempting to proceed will create new child records from the CSV import, below "test". It will not update the descriptions that were created by your DIP upload. You can do that in 2.4 however, if it is your goal, but the workflow would be a bit different. I would probably do the following: 
  • Add "test" to the clipboard
  • Export test with "include descendants", "include all levels", and "include drafts" settings checked
  • Open up the exported CSV and add the supplementary data you want to update the DIP descriptions with; save
  • Re-import that CSV using "match and update" and "skip unmatched" options

Cheers, 

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.

Dan Gillean

unread,
Aug 9, 2017, 3:36:18 PM8/9/17
to ICA-AtoM Users
Hi Ludwig 

Just a quick update to let you know that our developers have identified the issue, and have included a fix in the qa/2.4.x branch. I haven't yet tested it, but if you try rebasing, you should be able to pull in the change right away. Once tested, the fix will be included in the upcoming public 2.4 release. 

Here is the pull request for the related fix: 
Thanks again for reporting this! 

Cheers, 



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

To post to this group, send email to ica-ato...@googlegroups.com.

lud...@possiefamily.com

unread,
Aug 9, 2017, 3:38:45 PM8/9/17
to AtoM Users
Dan;

Thank you very much with your prompt replies and assistance with this matter.  I'll try to apply the changes and see how things go.

Cheers,
Ludwig
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.

To post to this group, send email to ica-ato...@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.

stephani...@gaiaresources.com.au

unread,
Nov 15, 2017, 11:21:07 PM11/15/17
to AtoM Users
Hi Dan,

We are seeing an issue when importing CSV to a parent description. We have AtoM 2.4 installed on Ubuntu 16.04. I also reproduced it on the AtoM demo site with the test file attached to the bug report: https://projects.artefactual.com/issues/11409.

The file can be uploaded via the header menu Import link and the command line, but not via the right side navigation Import CSV link.

The error message from the log is as follows:

PHP Fatal error:  Uncaught Error: Call to a member function __get() on string in /data/sites/atom/atom-2.4.0/lib/model/om/BaseObject.php:556
Stack trace:
#0 /data/sites/atom/atom-2.4.0/lib/model/QubitObject.php(93): BaseObject->__set('parent', '/qubit_dev.php/...')
#1 /data/sites/atom/atom-2.4.0/lib/model/om/BaseInformationObject.php(326): QubitObject->__set('parent', '/qubit_dev.php/...')
#2 /data/sites/atom/atom-2.4.0/lib/model/QubitInformationObject.php(197): BaseInformationObject->__set('parent', '/qubit_dev.php/...')
#3 /data/sites/atom/atom-2.4.0/lib/model/om/BaseObject.php(576): QubitInformationObject->__set('parent', '/qubit_dev.php/...')
#4 /data/sites/atom/atom-2.4.0/apps/qubit/modules/default/actions/editAction.class.php(179): BaseObject->offsetSet('parent', '/qubit_dev.php/...')
#5 /data/sites/atom/atom-2.4.0/apps/qubit/modules/object/actions/importSelectAction.class.php(118): DefaultEditAction->processField(Object(sfFormField))

Do you know what could cause this to occur?

Cheers,
Stephanie
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.

To post to this group, send email to ica-ato...@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.

Dan Gillean

unread,
Nov 16, 2017, 10:44:05 AM11/16/17
to ICA-AtoM Users
Hi Stephanie, 

Unfortunately you've come across a known issue in the 2.4 release. Fortunately, we've already identified and developed a fix for the issue. More details here: 
We have added this fix to our 2.5 branch, as well as to the stable/2.4.x branch as well. If you have installed from our GitHub code repository (instead of the tarball on our downloads page), you could simply do a git pull --rebase to pull in the latest changes. If you have installed from our tarball, you can either wait for us to release a 2.4.1 bug fix release and then upgrade, or if you have someone willing to dig into the code, you can look at the changes we've made here, and apply them in your own AtoM instance: 
In the meantime, if you need to import a CSV of descriptions as children of an existing description, you should be able to use the qubitParentSlug column to do so via the normal import method. See: 

Regards, 

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

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.
Reply all
Reply to author
Forward
0 new messages