Integrity constraint violation: 1062 Duplicate entry '658-1' for key 'element_id_shop_id'

Hallo,

wie finde ich denn die betroffene Tabelle bzw. die Einträge die dieser Fehler in core-production-XXXX-XX-XX.log hervorrufen?

[2019-03-25 01:45:03] core.CRITICAL: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‚658-1‘ for key ‚element_id_shop_id‘ {„uid“:„4badb32“}
[2019-03-25 01:45:03] core.CRITICAL: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‚658-1‘ for key ‚element_id_shop_id‘ {„uid“:„4badb32“}
[2019-03-25 01:45:03] core.ERROR: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‚658-1‘ for key ‚element_id_shop_id‘ in /var/www/vhosts/domain.de/domain.de/engine/Library/Zend/Db/Statement/Pdo.php:219 Stack trace: #0 /var/www/vhosts/domain.de/domain.de/engine/Library/Zend/Db/Statement/Pdo.php(219): PDOStatement->execute(Array) #1 /var/www/vhosts/domain.de/domain.de/engine/Library/Zend/Db/Statement.php(297): Zend_Db_Statement_Pdo->_execute(Array) #2 /var/www/vhosts/domain.de/domain.de/engine/Library/Zend/Db/Adapter/Abstract.php(470): Zend_Db_Statement->execute(Array) #3 /var/www/vhosts/domain.de/domain.de/engine/Library/Zend/Db/Adapter/Pdo/Abstract.php(232): Zend_Db_Adapter_Abstract->query(’\n            IN…’, Array) #4 /var/www/vhosts/domain.de/domain.de/engine/Library/Enlight/Components/Db/Adapter/Pdo/Mysql.php(85): Zend_Db_Adapter_Pdo_Abstract->query(’\n            IN…’, Array) #5 /var/www/vhosts/domain.de/domain.de/engine/Shopware/Plugins/Default/Core/RebuildIndex/Components/SeoIndex.php(113): Enlight_Components_Db_Adapter_Pdo_Mysql->query(’\n            IN…’, Array) #6 /var/www/vhosts/domain.de/domain.de/engine/Shopware/Plugins/Default/Core/RebuildIndex/Bootstrap.php(160): Shopware_Components_SeoIndex->setCachedTime(‚2019-03-25 01:0…‘, ‚658‘, 1) #7 /var/www/vhosts/domain.de/domain.de/engine/Library/Enlight/Event/Handler/Plugin.php(149): Shopware_Plugins_Core_RebuildIndex_Bootstrap->onRefreshSeoIndex(Object(Shopware_Components_Cron_CronJob)) #8 /var/www/vhosts/domain.de/domain.de/engine/Library/Enlight/Event/EventManager.php(258): Enlight_Event_Handler_Plugin->execute(Object(Shopware_Components_Cron_CronJob)) #9 /var/www/vhosts/domain.de/domain.de/engine/Library/Enlight/Components/Cron/Manager.php(282): Enlight_Event_EventManager->notifyUntil(‚Shopware_CronJo…‘, Object(Shopware_Components_Cron_CronJob)) #10 /var/www/vhosts/domain.de/domain.de/engine/Shopware/Plugins/Default/Core/Cron/Cron.php(52): Enlight_Components_Cron_Manager->runJob(Object(Enlight_Components_Cron_Job)) #11 /var/www/vhosts/domain.de/domain.de/engine/Library/Enlight/Controller/Action.php(193): Shopware_Controllers_Backend_Cron->indexAction() #12 /var/www/vhosts/domain.de/domain.de/engine/Library/Enlight/Controller/Dispatcher/Default.php(563): Enlight_Controller_Action->dispatch(‚indexAction‘) #13 /var/www/vhosts/domain.de/domain.de/engine/Library/Enlight/Controller/Front.php(222): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp)) #14 /var/www/vhosts/domain.de/domain.de/engine/Shopware/Kernel.php(202): Enlight_Controller_Front->dispatch() #15 /var/www/vhosts/domain.de/domain.de/vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php(102): Shopware\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #16 /var/www/vhosts/domain.de/domain.de/vendor/symfony/http-kernel/HttpCache/HttpCache.php(448): Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle(Object(Shopware\Kernel), Object(Symfony\Component\HttpFoundation\Request), 1, true) #17 /var/www/vhosts/domain.de/domain.de/engine/Shopware/Components/HttpCache/AppCache.php(268): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL) #18 /var/www/vhosts/domain.de/domain.de/vendor/symfony/http-kernel/HttpCache/HttpCache.php(238): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true) #19 /var/www/vhosts/domain.de/domain.de/engine/Shopware/Components/HttpCache/AppCache.php(105): Symfony\Component\HttpKernel\HttpCache\HttpCache->pass(Object(Symfony\Component\HttpFoundation\Request), true) #20 /var/www/vhosts/domain.de/domain.de/shopware.php(122): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request)) #21 {main}  Next Zend_Db_Statement_Exception: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‚658-1‘ for key ‚element_id_shop_id‘ in /var/www/vhosts/domain.de/domain.de/engine/Library/Zend/Db/Statement/Pdo.php:224 Stack trace: #0 /var/www/vhosts/domain.de/domain.de/engine/Library/Zend/Db/Statement.php(297): Zend_Db_Statement_Pdo->_execute(Array) #1 /var/www/vhosts/domain.de/domain.de/engine/Library/Zend/Db/Adapter/Abstract.php(470): Zend_Db_Statement->execute(Array) #2 /var/www/vhosts/domain.de/domain.de/engine/Library/Zend/Db/Adapter/Pdo/Abstract.php(232): Zend_Db_Adapter_Abstract->query(’\n            IN…’, Array) #3 /var/www/vhosts/domain.de/domain.de/engine/Library/Enlight/Components/Db/Adapter/Pdo/Mysql.php(85): Zend_Db_Adapter_Pdo_Abstract->query(’\n            IN…’, Array) #4 /var/www/vhosts/domain.de/domain.de/engine/Shopware/Plugins/Default/Core/RebuildIndex/Components/SeoIndex.php(113): Enlight_Components_Db_Adapter_Pdo_Mysql->query(’\n            IN…’, Array) #5 /var/www/vhosts/domain.de/domain.de/engine/Shopware/Plugins/Default/Core/RebuildIndex/Bootstrap.php(160): Shopware_Components_SeoIndex->setCachedTime(‚2019-03-25 01:0…‘, ‚658‘, 1) #6 /var/www/vhosts/domain.de/domain.de/engine/Library/Enlight/Event/Handler/Plugin.php(149): Shopware_Plugins_Core_RebuildIndex_Bootstrap->onRefreshSeoIndex(Object(Shopware_Components_Cron_CronJob)) #7 /var/www/vhosts/domain.de/domain.de/engine/Library/Enlight/Event/EventManager.php(258): Enlight_Event_Handler_Plugin->execute(Object(Shopware_Components_Cron_CronJob)) #8 /var/www/vhosts/domain.de/domain.de/engine/Library/Enlight/Components/Cron/Manager.php(282): Enlight_Event_EventManager->notifyUntil(‚Shopware_CronJo…‘, Object(Shopware_Components_Cron_CronJob)) #9 /var/www/vhosts/domain.de/domain.de/engine/Shopware/Plugins/Default/Core/Cron/Cron.php(52): Enlight_Components_Cron_Manager->runJob(Object(Enlight_Components_Cron_Job)) #10 /var/www/vhosts/domain.de/domain.de/engine/Library/Enlight/Controller/Action.php(193): Shopware_Controllers_Backend_Cron->indexAction() #11 /var/www/vhosts/domain.de/domain.de/engine/Library/Enlight/Controller/Dispatcher/Default.php(563): Enlight_Controller_Action->dispatch(‚indexAction‘) #12 /var/www/vhosts/domain.de/domain.de/engine/Library/Enlight/Controller/Front.php(222): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp)) #13 /var/www/vhosts/domain.de/domain.de/engine/Shopware/Kernel.php(202): Enlight_Controller_Front->dispatch() #14 /var/www/vhosts/domain.de/domain.de/vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php(102): Shopware\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #15 /var/www/vhosts/domain.de/domain.de/vendor/symfony/http-kernel/HttpCache/HttpCache.php(448): Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle(Object(Shopware\Kernel), Object(Symfony\Component\HttpFoundation\Request), 1, true) #16 /var/www/vhosts/domain.de/domain.de/engine/Shopware/Components/HttpCache/AppCache.php(268): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL) #17 /var/www/vhosts/domain.de/domain.de/vendor/symfony/http-kernel/HttpCache/HttpCache.php(238): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true) #18 /var/www/vhosts/domain.de/domain.de/engine/Shopware/Components/HttpCache/AppCache.php(105): Symfony\Component\HttpKernel\HttpCache\HttpCache->pass(Object(Symfony\Component\HttpFoundation\Request), true) #19 /var/www/vhosts/domain.de/domain.de/shopware.php(122): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request)) #20 {main} {„uid“:„4badb32“}

 

Vielen Dank schon mal für Eure Tipps.
Klaus

Nachtrag:

Der Fehler ist heute Nacht nicht in den Logs gewesen ohne das etwas geändert wurde.
 

Die betroffene Tabelle ist vermutlich die “s_core_config_values”. Da wird wohl versucht “element_id” und “shop_id” anzulegen obwohl die Einträge in dieser Kombination schon vorhanden sind. Was das auslöst kann ich zur Stunde auch nicht sagen.

@R4M‍ danke für den Tipp, werde mir die Tabelle mal genauer anschauen.

Das Problem trat beim Aufbau des Caches in der Nacht auf, daher vermute ich eher, dass hier doppelte Einträge in der Tabelle vorhanden sind.