CSVImport error when trying to import mappings


#1

Hello

I’d wanted to use the modules CSVImport and Mappings for geolocalize some registers, but I’m unable to make them work.

In Import Settings > Map to Omeka S data , I set the two properties for Latitude and Longitude (Map button) and when I click the Import button, I always get an error like this:

Doctrine\DBAL\Exception\InvalidFieldNameException
An exception occurred while executing ‘SELECT c0_.id AS id_0, c0_.added_count AS added_count_1, c0_.comment AS comment_2, c0_.resource_type AS resource_type_3, c0_.has_err AS has_err_4, c0_.job_id AS job_id_5, c0_.undo_job_id AS undo_job_id_6 FROM csvimport_import c0_ GROUP BY c0_.id ORDER BY c0_.id DESC LIMIT 25 OFFSET 0’: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘c0_.added_count’ in ‘field list’

Detalles:

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘c0_.added_count’ in ‘field list’ in /var/www/omeka/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:104
Stack trace:
#0 /var/www/omeka/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(104): PDO->query(‘SELECT c0_.id A…’)
#1 /var/www/omeka/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(852): Doctrine\DBAL\Driver\PDOConnection->query(‘SELECT c0_.id A…’)
#2 /var/www/omeka/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php(50): Doctrine\DBAL\Connection->executeQuery(‘SELECT c0_.id A…’, Array, Array, NULL)
#3 /var/www/omeka/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php(321): Doctrine\ORM\Query\Exec\SingleSelectExecutor->execute(Object(Doctrine\DBAL\Connection), Array, Array)
#4 /var/www/omeka/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(962): Doctrine\ORM\Query->_doExecute()
#5 /var/www/omeka/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(917): Doctrine\ORM\AbstractQuery->executeIgnoreQueryCache(NULL, 1)
#6 /var/www/omeka/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(720): Doctrine\ORM\AbstractQuery->execute(NULL, 1)
#7 /var/www/omeka/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/Paginator.php(171): Doctrine\ORM\AbstractQuery->getResult(1)
#8 /var/www/omeka/application/src/Api/Adapter/AbstractEntityAdapter.php(245): Doctrine\ORM\Tools\Pagination\Paginator->getIterator()
#9 /var/www/omeka/application/src/Api/Manager.php(221): Omeka\Api\Adapter\AbstractEntityAdapter->search(Object(Omeka\Api\Request))
#10 /var/www/omeka/application/src/Api/Manager.php(59): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))
#11 /var/www/omeka/application/src/Mvc/Controller/Plugin/Api.php(63): Omeka\Api\Manager->search(‘csvimport_impor…’, Array, Array)
#12 /var/www/omeka/modules/CSVImport/src/Controller/IndexController.php(117): Omeka\Mvc\Controller\Plugin\Api->search(‘csvimport_impor…’, Array)
#13 /var/www/omeka/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(78): CSVImport\Controller\IndexController->pastImportsAction()
#14 /var/www/omeka/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#15 /var/www/omeka/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#16 /var/www/omeka/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(106): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#17 /var/www/omeka/vendor/zendframework/zend-mvc/src/DispatchListener.php(138): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#18 /var/www/omeka/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#19 /var/www/omeka/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#20 /var/www/omeka/vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#21 /var/www/omeka/index.php(22): Zend\Mvc\Application->run()
#22 {main}

Next Doctrine\DBAL\Driver\PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘c0_.added_count’ in ‘field list’ in /var/www/omeka/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:106
Stack trace:
#0 /var/www/omeka/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(852): Doctrine\DBAL\Driver\PDOConnection->query(‘SELECT c0_.id A…’)
#1 /var/www/omeka/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php(50): Doctrine\DBAL\Connection->executeQuery(‘SELECT c0_.id A…’, Array, Array, NULL)
#2 /var/www/omeka/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php(321): Doctrine\ORM\Query\Exec\SingleSelectExecutor->execute(Object(Doctrine\DBAL\Connection), Array, Array)
#3 /var/www/omeka/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(962): Doctrine\ORM\Query->_doExecute()
#4 /var/www/omeka/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(917): Doctrine\ORM\AbstractQuery->executeIgnoreQueryCache(NULL, 1)
#5 /var/www/omeka/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(720): Doctrine\ORM\AbstractQuery->execute(NULL, 1)
#6 /var/www/omeka/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/Paginator.php(171): Doctrine\ORM\AbstractQuery->getResult(1)
#7 /var/www/omeka/application/src/Api/Adapter/AbstractEntityAdapter.php(245): Doctrine\ORM\Tools\Pagination\Paginator->getIterator()
#8 /var/www/omeka/application/src/Api/Manager.php(221): Omeka\Api\Adapter\AbstractEntityAdapter->search(Object(Omeka\Api\Request))
#9 /var/www/omeka/application/src/Api/Manager.php(59): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))
#10 /var/www/omeka/application/src/Mvc/Controller/Plugin/Api.php(63): Omeka\Api\Manager->search(‘csvimport_impor…’, Array, Array)
#11 /var/www/omeka/modules/CSVImport/src/Controller/IndexController.php(117): Omeka\Mvc\Controller\Plugin\Api->search(‘csvimport_impor…’, Array)
#12 /var/www/omeka/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(78): CSVImport\Controller\IndexController->pastImportsAction()
#13 /var/www/omeka/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#14 /var/www/omeka/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#15 /var/www/omeka/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(106): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#16 /var/www/omeka/vendor/zendframework/zend-mvc/src/DispatchListener.php(138): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#17 /var/www/omeka/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#18 /var/www/omeka/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#19 /var/www/omeka/vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#20 /var/www/omeka/index.php(22): Zend\Mvc\Application->run()
#21 {main}

Next Doctrine\DBAL\Exception\InvalidFieldNameException: An exception occurred while executing ‘SELECT c0_.id AS id_0, c0_.added_count AS added_count_1, c0_.comment AS comment_2, c0_.resource_type AS resource_type_3, c0_.has_err AS has_err_4, c0_.job_id AS job_id_5, c0_.undo_job_id AS undo_job_id_6 FROM csvimport_import c0_ GROUP BY c0_.id ORDER BY c0_.id DESC LIMIT 25 OFFSET 0’:

SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘c0_.added_count’ in ‘field list’ in /var/www/omeka/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:71
Stack trace:
#0 /var/www/omeka/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(128): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException(‘An exception oc…’, Object(Doctrine\DBAL\Driver\PDOException))
#1 /var/www/omeka/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(855): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), ‘SELECT c0_.id A…’, Array)
#2 /var/www/omeka/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php(50): Doctrine\DBAL\Connection->executeQuery(‘SELECT c0_.id A…’, Array, Array, NULL)
#3 /var/www/omeka/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php(321): Doctrine\ORM\Query\Exec\SingleSelectExecutor->execute(Object(Doctrine\DBAL\Connection), Array, Array)
#4 /var/www/omeka/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(962): Doctrine\ORM\Query->_doExecute()
#5 /var/www/omeka/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(917): Doctrine\ORM\AbstractQuery->executeIgnoreQueryCache(NULL, 1)
#6 /var/www/omeka/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(720): Doctrine\ORM\AbstractQuery->execute(NULL, 1)
#7 /var/www/omeka/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/Paginator.php(171): Doctrine\ORM\AbstractQuery->getResult(1)
#8 /var/www/omeka/application/src/Api/Adapter/AbstractEntityAdapter.php(245): Doctrine\ORM\Tools\Pagination\Paginator->getIterator()
#9 /var/www/omeka/application/src/Api/Manager.php(221): Omeka\Api\Adapter\AbstractEntityAdapter->search(Object(Omeka\Api\Request))
#10 /var/www/omeka/application/src/Api/Manager.php(59): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))
#11 /var/www/omeka/application/src/Mvc/Controller/Plugin/Api.php(63): Omeka\Api\Manager->search(‘csvimport_impor…’, Array, Array)
#12 /var/www/omeka/modules/CSVImport/src/Controller/IndexController.php(117): Omeka\Mvc\Controller\Plugin\Api->search(‘csvimport_impor…’, Array)
#13 /var/www/omeka/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(78): CSVImport\Controller\IndexController->pastImportsAction()
#14 /var/www/omeka/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#15 /var/www/omeka/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#16 /var/www/omeka/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(106): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#17 /var/www/omeka/vendor/zendframework/zend-mvc/src/DispatchListener.php(138): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#18 /var/www/omeka/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#19 /var/www/omeka/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#20 /var/www/omeka/vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#21 /var/www/omeka/index.php(22): Zend\Mvc\Application->run()
#22 {main}

I’m using Omeka S version 1.2.0, CSV Import version 1.1.0 and Mapping version 1.0.2

Could anyone give me help?


#2

What version of the CSV Import are you using? And, did you potentially try more than one version?

That error looks like it’s on the importer side only, the kind of thing that would come up when you did any import at all, not just ones using Mapping. The issue is that the database is out of sync with the module… this kind of thing could happen if you switched to a newer or different or unreleased version of the importer and then switched back to a lower version.

Uninstalling and reinstalling your current version is usually a quick fix to this kind of problem, if that’s what’s happening. You’d lose the importer’s records of past imports but nothing else.


#3

Thank you so much for your help, jflatnes.

I solved the problem after posting the forum message. You were right in your assumptions.

First of all, the versions I’m using. I said (at the end of the message) “I’m using Omeka S version 1.2.0, CSV Import version 1.1.0 and Mapping version 1.0.2”.

I was using alternatively the CSVImport modules by “Roy Rosenzweig Center for History & New Media” (the “oficial” and standard with support for mapping module) and by “Daniel-KM” (more powerful than standard one, but without support for mapping module).

When I changed between modules, I didn’t do it in the right way (uninstalling first the old module and installing then the newer one). I just moved the files of the modules in /var/www/omeka/modules and stored there the files for CSVImport “standard”. Then I activated the module CSVImport from omeka’s web interface and it dind’t show any error, but the database hadn’t been created properly (the older table for CSVImport module persisted and it didn’t contain the column that is shown in the message error).

So, the solution is, as you said, uninstall the module in the right way, and install it again. Thus the database is changed deleting the table “csvimport_import”, and creating it later.

I hope my experience with this module will be useful to others and I have learned the lesson: uninstall and install modules in the right way if you want all be fine.