Daniel-KM / Omeka-S-module-SearchSolr

Search Omeka resources instantly and deeply with Apache Lucene / Solr
Other
3 stars 1 forks source link

General error: 1364 Field 'data_types' doesn't have a default value #3

Closed mariusst closed 4 years ago

mariusst commented 4 years ago

Hi there,

My setup:

I tried to install it and received this error:

Doctrine\DBAL\Exception\NotNullConstraintViolationException An exception occurred while executing 'INSERT INTO solr_map (solr_core_id, resource_name, field_name, source, settings) VALUES (1, ?, ?, ?, ?);' with params ["items", "dcterms_title_t", "dcterms:title", "{\"formatter\":\"\",\"label\":\"Title\"}"]: SQLSTATE[HY000]: General error: 1364 Field 'data_types' doesn't have a default value

Details:

PDOException: SQLSTATE[HY000]: General error: 1364 Field 'data_types' doesn't have a default value in /var/www/omeka-s/lod/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117 Stack trace:

0 /var/www/omeka-s/lod/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(117): PDOStatement->execute(Array)

1 /var/www/omeka-s/lod/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(907): Doctrine\DBAL\Driver\PDOStatement->execute(Array)

2 /var/www/omeka-s/lod/modules/SearchSolr/Module.php(150): Doctrine\DBAL\Connection->executeQuery('INSERT INTO `so...', Array)

3 /var/www/omeka-s/lod/modules/Generic/AbstractModule.php(91): SearchSolr\Module->postInstall()

4 /var/www/omeka-s/lod/application/src/Module/Manager.php(240): Generic\AbstractModule->install(Object(Laminas\ServiceManager\ServiceManager))

5 /var/www/omeka-s/lod/application/src/Controller/Admin/ModuleController.php(117): Omeka\Module\Manager->install(Object(Omeka\Module\Module))

6 /var/www/omeka-s/lod/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(77): Omeka\Controller\Admin\ModuleController->installAction()

7 /var/www/omeka-s/lod/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent))

8 /var/www/omeka-s/lod/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))

9 /var/www/omeka-s/lod/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(105): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))

10 /var/www/omeka-s/lod/vendor/laminas/laminas-mvc/src/DispatchListener.php(139): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))

11 /var/www/omeka-s/lod/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))

12 /var/www/omeka-s/lod/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))

13 /var/www/omeka-s/lod/vendor/laminas/laminas-mvc/src/Application.php(331): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))

14 /var/www/omeka-s/lod/index.php(21): Laminas\Mvc\Application->run()

15 {main}

Next Doctrine\DBAL\Driver\PDOException: SQLSTATE[HY000]: General error: 1364 Field 'data_types' doesn't have a default value in /var/www/omeka-s/lod/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:119 Stack trace:

0 /var/www/omeka-s/lod/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(907): Doctrine\DBAL\Driver\PDOStatement->execute(Array)

1 /var/www/omeka-s/lod/modules/SearchSolr/Module.php(150): Doctrine\DBAL\Connection->executeQuery('INSERT INTO `so...', Array)

2 /var/www/omeka-s/lod/modules/Generic/AbstractModule.php(91): SearchSolr\Module->postInstall()

3 /var/www/omeka-s/lod/application/src/Module/Manager.php(240): Generic\AbstractModule->install(Object(Laminas\ServiceManager\ServiceManager))

4 /var/www/omeka-s/lod/application/src/Controller/Admin/ModuleController.php(117): Omeka\Module\Manager->install(Object(Omeka\Module\Module))

5 /var/www/omeka-s/lod/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(77): Omeka\Controller\Admin\ModuleController->installAction()

6 /var/www/omeka-s/lod/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent))

7 /var/www/omeka-s/lod/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))

8 /var/www/omeka-s/lod/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(105): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))

9 /var/www/omeka-s/lod/vendor/laminas/laminas-mvc/src/DispatchListener.php(139): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))

10 /var/www/omeka-s/lod/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))

11 /var/www/omeka-s/lod/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))

12 /var/www/omeka-s/lod/vendor/laminas/laminas-mvc/src/Application.php(331): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))

13 /var/www/omeka-s/lod/index.php(21): Laminas\Mvc\Application->run()

14 {main}

Next Doctrine\DBAL\Exception\NotNullConstraintViolationException: An exception occurred while executing 'INSERT INTO solr_map (solr_core_id, resource_name, field_name, source, settings) VALUES (1, ?, ?, ?, ?);' with params ["items", "dcterms_title_t", "dcterms:title", "{\"formatter\":\"\",\"label\":\"Title\"}"]:

SQLSTATE[HY000]: General error: 1364 Field 'data_types' doesn't have a default value in /var/www/omeka-s/lod/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:103 Stack trace:

0 /var/www/omeka-s/lod/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(169): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))

1 /var/www/omeka-s/lod/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(145): Doctrine\DBAL\DBALException::wrapException(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'An exception oc...')

2 /var/www/omeka-s/lod/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(913): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'INSERT INTO `so...', Array)

3 /var/www/omeka-s/lod/modules/SearchSolr/Module.php(150): Doctrine\DBAL\Connection->executeQuery('INSERT INTO `so...', Array)

4 /var/www/omeka-s/lod/modules/Generic/AbstractModule.php(91): SearchSolr\Module->postInstall()

5 /var/www/omeka-s/lod/application/src/Module/Manager.php(240): Generic\AbstractModule->install(Object(Laminas\ServiceManager\ServiceManager))

6 /var/www/omeka-s/lod/application/src/Controller/Admin/ModuleController.php(117): Omeka\Module\Manager->install(Object(Omeka\Module\Module))

7 /var/www/omeka-s/lod/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(77): Omeka\Controller\Admin\ModuleController->installAction()

8 /var/www/omeka-s/lod/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent))

9 /var/www/omeka-s/lod/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))

10 /var/www/omeka-s/lod/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(105): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))

11 /var/www/omeka-s/lod/vendor/laminas/laminas-mvc/src/DispatchListener.php(139): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))

12 /var/www/omeka-s/lod/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))

13 /var/www/omeka-s/lod/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))

14 /var/www/omeka-s/lod/vendor/laminas/laminas-mvc/src/Application.php(331): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))

15 /var/www/omeka-s/lod/index.php(21): Laminas\Mvc\Application->run()

16 {main}

Daniel-KM commented 4 years ago

Hi, Thanks, it is fixed in the new version. I updated Search and Generic too.

Daniel-KM commented 4 years ago

You will have to remove the two tables that where created during the failed install, first. So you phpmyadmin/adminer and remove the tables solr_core and solr_map, or use this request:

DROP TABLE `solr_map`;
DROP TABLE `solr_core`;
mariusst commented 4 years ago

Thank you very much. It works now, but there are other 2 bugs I found. Please check the latest issues