CSV Import: File URL and Error Logging

Continuing the discussion from CSV Import error messages:

With the enabling of the EXEC function, CSV Import now operates as expected without throwing errors. However, I have not been able to import files via public URL. I seek guidance and help.

Context
CSV Import does successfully import all records in my .csv file, demonstrated by many attempts where the URL field is not indicated as a “file” field. In these attempts, all records are imported properly, including the URL field which imports as a line of text.

However, when I checkbox “file” for the URL field, in every attempt job fails. The Status tab job list displays “Import Error” with zero items imported or skipped.

I have confirmed that the URL in the field does point to a permanent, publicly visible location, by first pasting into my browser address bar and next typing it into the address bar of a completely stand-alone computer.

But… here’s the twist my desired URL points to files in a subdomain created in my primary Reclaim server instance which hosts Omeka. As a test, I created a new .csv file with a URL field pointing to a similar subdomain in another Reclaim server instance, which I also manage. This test worked normally, uploading the file from this other subdomain. So the problem is not CSV Import, but likely with permissions or certificates. It is confounding that the URL can be shown to be permanent and public, but CSV Import fails anyway.

Here’s another twist: when I run CSV Import on my secondary Omeka instance, pointing to the primary Reclaim subdomain, it works fine. So: it is not CSV Import or file permissions, but something about how the subdomain is provisioned. Importing from a similar subdomain on the secondary instance works fine too. Why is the behavior different?

Request
I have verified that my CSV file and the URLs in the file comply with all requirements in the documentation. But, there is different function in one subdomain.

  • How can I get more detail about “Import Error” thrown by CSV Import?
  • What settings or other actions can I take to get CSV Import to operate normally to import from valid public URLs?
  • What do I need to change on my Reclaim sub-domain?

Additional Testing Results: PDF Import

Testing possible reasons for import errors, I attempted to attach one PDF file to an individual item. The PDF is one of the files that I attempted to import with CSV Import.

The result was unexpected, demonstrating a problem with importing PDFs. This problem is inside the Omeka code. Here is the error message:

Omeka Error - Attach File to Item - PDF - splives

Omeka_Record_Exception: There is no element “PDF Text”, “Text”! in /home/splivesn/public_html/application/models/Mixin/ElementText.php:292

Stack trace:

#0 /home/splivesn/public_html/application/libraries/Omeka/Record/AbstractRecord.php(255): Mixin_ElementText->getElement(‘PDF Text’, ‘Text’)

#1 /home/splivesn/public_html/application/libraries/Omeka/Record/AbstractRecord.php(212): Omeka_Record_AbstractRecord->delegateToMixins(‘getElement’, Array)

#2 /home/splivesn/public_html/plugins/PdfText/PdfTextPlugin.php(120): Omeka_Record_AbstractRecord->__call(‘getElement’, Array)

#3 /home/splivesn/public_html/application/libraries/Omeka/Plugin/Broker.php(154): PdfTextPlugin->hookBeforeSaveFile(Array)

#4 /home/splivesn/public_html/application/libraries/Omeka/Record/AbstractRecord.php(302): Omeka_Plugin_Broker->callHook(‘before_save_fil…’, Array)

#5 /home/splivesn/public_html/application/libraries/Omeka/Record/AbstractRecord.php(530): Omeka_Record_AbstractRecord->runCallbacks(‘beforeSave’, Array)

#6 /home/splivesn/public_html/application/models/Item.php(338): Omeka_Record_AbstractRecord->save()

#7 /home/splivesn/public_html/application/models/Builder/Item.php(205): Item->saveFiles()

#8 /home/splivesn/public_html/application/libraries/globals.php(567): Builder_Item->addFiles(‘Upload’, ‘file’, Array)

#9 /home/splivesn/public_html/application/models/Item.php(323): insert_files_for_item(Object(Item), ‘Upload’, ‘file’, Array)

#10 /home/splivesn/public_html/application/models/Item.php(233): Item->_uploadFiles()

#11 /home/splivesn/public_html/application/libraries/Omeka/Record/AbstractRecord.php(281): Item->beforeSave(Array)

#12 /home/splivesn/public_html/application/libraries/Omeka/Record/AbstractRecord.php(530): Omeka_Record_AbstractRecord->runCallbacks(‘beforeSave’, Array)

#13 /home/splivesn/public_html/application/libraries/Omeka/Controller/AbstractActionController.php(245): Omeka_Record_AbstractRecord->save(false)

#14 /home/splivesn/public_html/application/controllers/ItemsController.php(88): Omeka_Controller_AbstractActionController->editAction()

#15 /home/splivesn/public_html/application/libraries/Zend/Controller/Action.php(516): ItemsController->editAction()

#16 /home/splivesn/public_html/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch(‘editAction’)

#17 /home/splivesn/public_html/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))

#18 /home/splivesn/public_html/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(106): Zend_Controller_Front->dispatch()

#19 /home/splivesn/public_html/application/libraries/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()

#20 /home/splivesn/public_html/application/libraries/Omeka/Application.php(73): Zend_Application->run()

#21 /home/splivesn/public_html/admin/index.php(28): Omeka_Application->run()

#22 {main}

Additional Testing Results: PDF Import - PDF Plugin

Continued testing possible reasons for import errors, I attempted to attach one PDF file to an individual item on my secondary Omeka instance. The PDF is one of the files that I attempted to import with CSV Import.

The result was unexpected, demonstrating a problem with importing PDFs. This problem is inside the Omeka code. Here is this additional error message:

Fatal error: Uncaught Error: Call to undefined function shell_exec() in /home/hercules/public_html/plugins/PdfText/PdfTextPlugin.php:137 Stack trace: #0 /home/hercules/public_html/plugins/PdfText/PdfTextPlugin.php(121): PdfTextPlugin->pdfToText(‘’/tmp/c0beaf13d…') #1 /home/hercules/public_html/application/libraries/Omeka/Plugin/Broker.php(154): PdfTextPlugin->hookBeforeSaveFile(Array) #2 /home/hercules/public_html/application/libraries/Omeka/Record/AbstractRecord.php(302): Omeka_Plugin_Broker->callHook(‘before_save_fil…’, Array) #3 /home/hercules/public_html/application/libraries/Omeka/Record/AbstractRecord.php(530): Omeka_Record_AbstractRecord->runCallbacks(‘beforeSave’, Array) #4 /home/hercules/public_html/application/models/Item.php(338): Omeka_Record_AbstractRecord->save() #5 /home/hercules/public_html/application/models/Item.php(251): Item->saveFiles() #6 /home/hercules/public_html/application/libraries/Omeka/Record/AbstractRecord.php(281): Item->afterSave(Array) #7 /home/hercules/public_html/application/libraries/Omeka/Record/AbstractRecord.php(549): Omeka_Record_AbstractRecord->runCallbacks(‘afterSave’, Array) #8 /home/hercules/public_html/application/libraries/Omeka/Controller/AbstractActionController.php(204): Omeka_Record_AbstractRecord->save(false) #9 /home/hercules/public_html/application/controllers/ItemsController.php(148): Omeka_Controller_AbstractActionController->addAction() #10 /home/hercules/public_html/application/libraries/Zend/Controller/Action.php(516): ItemsController->addAction() #11 /home/hercules/public_html/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch(‘addAction’) #12 /home/hercules/public_html/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #13 /home/hercules/public_html/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(106): Zend_Controller_Front->dispatch() #14 /home/hercules/public_html/application/libraries/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run() #15 /home/hercules/public_html/application/libraries/Omeka/Application.php(73): Zend_Application->run() #16 /home/hercules/public_html/admin/index.php(28): Omeka_Application->run() #17 {main} thrown in /home/hercules/public_html/plugins/PdfText/PdfTextPlugin.php on line 137

That error would be caused by deleting the “PDF Text” element set, or some other similar action. If you’re having that issue, uninstalling and reinstalling the plugin should fix it.

Fatal error: Uncaught Error: Call to undefined function shell_exec()

This other one is similar to your problem from before with exec for running the background job, except this plugin uses the shell_exec function so you’d need that one enabled.

1 Like

Thank you very much: function is restored. Importing normally, hundreds of items per job, PDF and TIFF filetypes.

Fixed the problem by deactivating and un-uninstalling the PDF Text plug-in. I will re-download the plug-in code in the future.

I’ve also opened a ticket with Reclaim to enable the [shell_exec} command.

All good for now.