CSV Import status displaying Import Error for all files

CSV Import was working fine until today. I am sure I did not change anything since last working with it. Now, when I tried to upload my working Folkstreams data file, it gives an Import Error. It says In Progress, but when I refresh the status, it shows Import Error.

I tried running an import on the CSV test file that comes with the plugin: test_automap_columns_to_elements.csv with the same result. I also tried the other test.csv file. I have imported these successfully before.

I deleted the CSV Import files and refreshed them from the archived copy I have. I uninstalled and reinstalled CSV Import. I tried importing the test files again. With the same result Import Error.

Any help appreciated,

Steve

Screenshots of the problem:

http://folks.pairserver.com/omeka/csv-import-mapping.jpg

http://folks.pairserver.com/omeka/csv-import-status.jpg

I'm having the same issue. It was working fine on one CSV file on 8/16, then the next file (formatted in exactly the same way) did not work. I've tested and it works as long as I'm not trying to import files (which kind of defeats the purpose of using the plugin). Have you (@folks) had any luck in the meantime?

Sorry, no.

The only thing I have left to try is a complete uninstall and reinstall of Omeka. I may try installing alongside the current Omeka and using another database.

I did have problems earlier with CSV Import where import processes were not being started. It was solved by a complete clean reinstall. I refreshed all the files, checked the code. I suspect it may be the database but that doesn't make sense since uinstalling and reinstalling the plugin should clear the data it uses. Apparently not.

I had forgot to enable full error logging on reinstall. That explains why I wasn't seeing anything in the log from CSV Import. I am getting an error. You may want to check your log.

2013-08-19T17:31:00-04:00 DEBUG (7): [CsvImport][time:Aug 19, 2013 5:31:00 PM][id:4] Queued import.
2013-08-19T17:31:01-04:00 DEBUG (7): [CsvImport][time:Aug 19, 2013 5:31:01 PM][id:4] Started import.
2013-08-19T17:31:01-04:00 DEBUG (7): [CsvImport][time:Aug 19, 2013 5:31:01 PM][id:4] Running item import loop. Memory usage: 12814184
2013-08-19T17:31:01-04:00 ERR (3): [CsvImport][time:Aug 19, 2013 5:31:01 PM][id:4] exception 'Zend_Exception' with message 'No entry is registered for key 'view'' in /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/application/libraries/Zend/Registry.php:147
Stack trace:
#0 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/application/libraries/globals.php(1586): Zend_Registry::get('view')
#1 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/application/libraries/globals.php(1966): get_view()
#2 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/plugins/PBCoreElementSet/PBCoreElementSetPlugin.php(122): metadata(Object(Item), Array, Array)
#3 [internal function]: PBCoreElementSetPlugin->hookAfterSaveItem(Array)
#4 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/application/libraries/Omeka/Plugin/Broker.php(157): call_user_func(Array, Array)
#5 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/application/libraries/Omeka/Record/AbstractRecord.php(298): Omeka_Plugin_Broker->callHook('after_save_item', Array)
#6 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/application/libraries/Omeka/Record/AbstractRecord.php(550): Omeka_Record_AbstractRecord->runCallbacks('afterSave', Array)
#7 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/application/libraries/Omeka/Record/Builder/AbstractBuilder.php(67): Omeka_Record_AbstractRecord->save()
#8 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/application/libraries/globals.php(531): Omeka_Record_Builder_AbstractBuilder->build()
#9 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/plugins/CsvImport/models/CsvImport/Import.php(692): insert_item(Array, Array)
#10 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/plugins/CsvImport/models/CsvImport/Import.php(574): CsvImport_Import->_addItemFromRow(Array)
#11 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/plugins/CsvImport/models/CsvImport/Import.php(322): CsvImport_Import->_importLoop(0)
#12 [internal function]: CsvImport_Import->start()
#13 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/plugins/CsvImport/models/CsvImport/ImportTask.php(39): call_user_func(Array)
#14 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/application/libraries/Omeka/Job/Process/Wrapper.php(29): CsvImport_ImportTask->perform()
#15 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/application/scripts/background.php(60): Omeka_Job_Process_Wrapper->run(Array)
#16 {main}
2013-08-19T17:31:01-04:00 ERR (3): exception 'Zend_Exception' with message 'No entry is registered for key 'view'' in /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/application/libraries/Zend/Registry.php:147
Stack trace:
#0 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/application/libraries/globals.php(1586): Zend_Registry::get('view')
#1 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/application/libraries/globals.php(1966): get_view()
#2 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/plugins/PBCoreElementSet/PBCoreElementSetPlugin.php(122): metadata(Object(Item), Array, Array)
#3 [internal function]: PBCoreElementSetPlugin->hookAfterSaveItem(Array)
#4 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/application/libraries/Omeka/Plugin/Broker.php(157): call_user_func(Array, Array)
#5 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/application/libraries/Omeka/Record/AbstractRecord.php(298): Omeka_Plugin_Broker->callHook('after_save_item', Array)
#6 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/application/libraries/Omeka/Record/AbstractRecord.php(550): Omeka_Record_AbstractRecord->runCallbacks('afterSave', Array)
#7 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/application/libraries/Omeka/Record/Builder/AbstractBuilder.php(67): Omeka_Record_AbstractRecord->save()
#8 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/application/libraries/globals.php(531): Omeka_Record_Builder_AbstractBuilder->build()
#9 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/plugins/CsvImport/models/CsvImport/Import.php(692): insert_item(Array, Array)
#10 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/plugins/CsvImport/models/CsvImport/Import.php(574): CsvImport_Import->_addItemFromRow(Array)
#11 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/plugins/CsvImport/models/CsvImport/Import.php(322): CsvImport_Import->_importLoop(0)
#12 [internal function]: CsvImport_Import->start()
#13 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/plugins/CsvImport/models/CsvImport/ImportTask.php(39): call_user_func(Array)
#14 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/application/libraries/Omeka/Job/Process/Wrapper.php(29): CsvImport_ImportTask->perform()
#15 /usr/home/folks/public_html/folks.pairserver.com/omeka/omeka-2.0.2/application/scripts/background.php(60): Omeka_Job_Process_Wrapper->run(Array)
#16 {main}

This morning I dropped all omeka tables from the database, brought Omeka up on the web and went through the automatic install process. I left my files alone. I went into Plugins and activated CSV Import. I tried an import of the test file and it Completed.

I suppose something in the database gets messed up and causes the trouble with imports. I don't know what it could be, because I've uninstalled and reinstalled CSV Import and confirmed it drops its own tables and deletes its options (at least calls delete all options).

Steve

It looks from your log like the problem was an incompatibility between CsvImport and the PBCoreElementSet plugin.

The PBCore plugin tries to use the metadata() helper after every item is saved, but the view system that metadata() depends on isn't set up when CsvImport runs in the background.

Your reinstall probably worked because you didn't install this other plugin.

You're right. I just installed the PBCoreElementSet plugin and the Import Error is back again. I uninstalled it and the import of the test file completes.

I just deleted the PBCoreElementSet plugin files and refreshed them from the archive file. I have added a couple of missing PBCore elements, so I wanted to an import using a clean copy of the plugin. When I reinstalled the plugin, I chose NOT to check the box enabling DC:Identifier to be filled in automatically with the url.

I tried the import of filmmakers again, mapping two fields to PBCore fields, and it succeeded. That tells me the problem is either with changes I made to the code or perhaps an incompatibility with the auto-fill. I went into config, checked the "Add url as identifier" box and saved changes.

I imported the Omeka-supplied test data again. It failed immediately with an Import Error.

I conclude it was not my code changes adding missing elements from the PBCode standard, but that it is enabling the identifier auto-fill that is the problem.

(The checkbox is in the plugin's config: Add url as identifier. "This option adds automatically the url of the item ("http://myomeka.com/items/show/#") to the metadata "PBCore > Identifier".")

I restored my code for elements.php adding the missing elements we need and the import was successful. There is some problem with the Add url as identifier feature.

Just to summarize. The problem of seeing Import Error messages for any and all imports was due to an incompatible interaction between the CSVImport and PBCoreElementSet plugins. The incompatibility was resolved by unchecking "Add URL as identifier" in the PBC plugin's configuration form. I don't really need that feature, so I just turned it off.