# Integrity constraint violation: 1062 Duplicate entry '658-1' for key 'element\_id\_shop\_id'

**URL:** <https://forum.shopware.com/t/integrity-constraint-violation-1062-duplicate-entry-658-1-for-key-element-id-shop-id/58758>\
**Category:** Administration\
**Created:** [25. März 2019 um 17:05 UTC](https://forum.shopware.com/t/integrity-constraint-violation-1062-duplicate-entry-658-1-for-key-element-id-shop-id/58758 "2019-03-25T17:05:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Klaus](https://avatars.discourse-cdn.com/v4/letter/k/e99b99/32.png) [@Klaus](https://forum.shopware.com/u/Klaus)\
**Post date:** [25. März 2019 um 17:05 UTC](https://forum.shopware.com/t/integrity-constraint-violation-1062-duplicate-entry-658-1-for-key-element-id-shop-id/58758/1 "2019-03-25T17:05:18Z")

</div>

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&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 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&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 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&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 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}&nbsp; 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&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 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&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 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&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 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“}

&nbsp;

Vielen Dank schon mal für Eure Tipps.  
Klaus

---

<div class="post-metadata">

**Author:** ![Klaus](https://avatars.discourse-cdn.com/v4/letter/k/e99b99/32.png) [@Klaus](https://forum.shopware.com/u/Klaus)\
**Post date:** [26. März 2019 um 07:18 UTC](https://forum.shopware.com/t/integrity-constraint-violation-1062-duplicate-entry-658-1-for-key-element-id-shop-id/58758/2 "2019-03-26T07:18:20Z")

</div>

Nachtrag:

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

---

<div class="post-metadata">

**Author:** ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)\
**Post date:** [26. März 2019 um 11:43 UTC](https://forum.shopware.com/t/integrity-constraint-violation-1062-duplicate-entry-658-1-for-key-element-id-shop-id/58758/3 "2019-03-26T11:43:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Klaus](https://avatars.discourse-cdn.com/v4/letter/k/e99b99/32.png) [@Klaus](https://forum.shopware.com/u/Klaus)\
**Post date:** [26. März 2019 um 16:34 UTC](https://forum.shopware.com/t/integrity-constraint-violation-1062-duplicate-entry-658-1-for-key-element-id-shop-id/58758/4 "2019-03-26T16:34:48Z")

</div>

@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.
