# Datenbank Problem SQL " Product visibility unique Ids problem"

**URL:** <https://forum.shopware.com/t/datenbank-problem-sql-product-visibility-unique-ids-problem/96633>\
**Category:** Administration\
**Created:** [11. Oktober 2022 um 15:11 UTC](https://forum.shopware.com/t/datenbank-problem-sql-product-visibility-unique-ids-problem/96633 "2022-10-11T15:11:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![beetlecrisis](https://avatars.discourse-cdn.com/v4/letter/b/edb3f5/32.png) [@beetlecrisis](https://forum.shopware.com/u/beetlecrisis)\
**Post date:** [11. Oktober 2022 um 15:11 UTC](https://forum.shopware.com/t/datenbank-problem-sql-product-visibility-unique-ids-problem/96633/1 "2022-10-11T15:11:16Z")

</div>

Wir wollen aus unserem Plentymarkets system mittels Connector den Produktkatalog anlegen und pflegen.

Hierzu wirft das System den oben genannten Datenbankfehler.

Folgende Dehlermeldung erhalten wir:

> Uncaught PHP Exception Doctrine\DBAL\Exception\UniqueConstraintViolationException: „An exception occurred while executing ‚INSERT INTO `product_visibility` (`id`, `product_id`, `product_version_id`, `sales_channel_id`, `visibility`, `created_at`) VALUES (‘›d[-@óKI¥¥´GzÎ"Ç’,‚Þšv\rˆEë¾?xÀ¯‘,‚©ãéjKÂ¾KÙÎu,4%‘,‚¶B3ÿ)MÕ½ø7³guœ‘,‚30‘,‚2022-10-10 00:36:53.556‘);': SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‚\xDE\x9Av\x0D\x0B\x88E\xEB\x81\x8F\xBE?x\xC0\xAF\x7F-\x0F\xA9…‘ for key ‚uniq.product\_id\_\_sales\_channel\_id‘“ at /var/www/clients/client1/web2/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 74 {„exception“:„[object] (Doctrine\DBAL\Exception\UniqueConstraintViolationException(code: 0): An exception occurred while executing ‚INSERT INTO `product_visibility` (`id`, `product_id`, `product_version_id`, `sales_channel_id`, `visibility`, `created_at`) VALUES (‚ï¿½d[-@ï¿½KIï¿½ï¿½ï¿½GzÎ"ï¿½‘,‚Þšv\r\u000bï¿½Eëï¿½?xï¿½ï¿½‘,‘\u000fï¿½\u001cï¿½ï¿½jKÂ¾Kï¿½ï¿½u,4%‚,‚ï¿½B\b3ï¿½)MÕ½ï¿½7ï¿½guï¿½ï¿½‘,‚30‘,‚2022-10-10 00:36:53.556‘);‘:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‚\xDE\x9Av\x0D\x0B\x88E\xEB\x81\x8F\xBE?x\xC0\xAF\x7F-\x0F\xA9…‘ for key ‚uniq.product\_id\_\_sales\_channel\_id‘ at /var/www/clients/client1/web2/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:74)\n[previous exception] [object] (Doctrine\DBAL\Driver\PDO\Exception(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‚\xDE\x9Av\x0D\x0B\x88E\xEB\x81\x8F\xBE?x\xC0\xAF\x7F-\x0F\xA9…‘ for key ‚uniq.product\_id\_\_sales\_channel\_id‘ at /var/www/clients/client1/web2/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18)\n[previous exception] [object] (PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‚\xDE\x9Av\x0D\x0B\x88E\xEB\x81\x8F\xBE?x\xC0\xAF\x7F-\x0F\xA9…‘ for key ‚uniq.product\_id\_\_sales\_channel\_id‘ at /var/www/clients/client1/web2/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:55)“}

Connector-Seitig sowie Plentymarkets-Seitig ist alles korrekt. Wie können wir den Fahler Einkreisen und beheben ? ?

Beste Grüsse

---

<div class="post-metadata">

**Author:** ![Max\_Shop](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Max\_Shop](https://forum.shopware.com/u/Max_Shop)\
**Post date:** [11. Oktober 2022 um 16:51 UTC](https://forum.shopware.com/t/datenbank-problem-sql-product-visibility-unique-ids-problem/96633/2 "2022-10-11T16:51:30Z")

</div>

> [@beetlecrisis](#):
>
> Duplicate entry

Es besteht schon ein Eintrag für uniq.product\_id\_\_sales\_channel\_id in der Tabelle.

---

<div class="post-metadata">

**Author:** ![beetlecrisis](https://avatars.discourse-cdn.com/v4/letter/b/edb3f5/32.png) [@beetlecrisis](https://forum.shopware.com/u/beetlecrisis)\
**Post date:** [11. Oktober 2022 um 17:03 UTC](https://forum.shopware.com/t/datenbank-problem-sql-product-visibility-unique-ids-problem/96633/3 "2022-10-11T17:03:18Z")

</div>

Danke für den Hinweis, Ich selber hatte geschaut war aber anscheinend zu doof den zu finden. Hast Du nen Link??

---

<div class="post-metadata">

**Author:** ![Moorleiche](https://avatars.discourse-cdn.com/v4/letter/m/6f9a4e/32.png) [@Moorleiche](https://forum.shopware.com/u/Moorleiche)\
**Post date:** [11. Oktober 2022 um 17:34 UTC](https://forum.shopware.com/t/datenbank-problem-sql-product-visibility-unique-ids-problem/96633/4 "2022-10-11T17:34:34Z")

</div>

Wozu nen link?? Verstehe ich nicht ganz 🤔

Am besten das nochmal auf einer völlig neuen shopware Instanz testen. Kommt es erneut zu dem Fehler wird es wohl der hersteller des Plugins beheben müssen. Wir wissen auch garnicht ob shopware dal genutzt wird. Oder ob die inserts als raw sql ausgeführt werden. Bei zweiterem könnte man ein ‚insert ignore‘ machen. Aber wir wissen es halt nicht.

---

<div class="post-metadata">

**Author:** ![beetlecrisis](https://avatars.discourse-cdn.com/v4/letter/b/edb3f5/32.png) [@beetlecrisis](https://forum.shopware.com/u/beetlecrisis)\
**Post date:** [12. Oktober 2022 um 08:44 UTC](https://forum.shopware.com/t/datenbank-problem-sql-product-visibility-unique-ids-problem/96633/5 "2022-10-12T08:44:47Z")

</div>

Der Kollege @Max_Shop hatte darauf hingewiesen dass das Thema schonmal diskutiert wurde. Daher finde ich meine Frage nach dem Link zu dem Thread durchaus berechtigt.

---

<div class="post-metadata">

**Author:** ![Max\_Shop](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Max\_Shop](https://forum.shopware.com/u/Max_Shop)\
**Post date:** [12. Oktober 2022 um 08:47 UTC](https://forum.shopware.com/t/datenbank-problem-sql-product-visibility-unique-ids-problem/96633/6 "2022-10-12T08:47:57Z")

</div>

> [@Max\_Shop](#):
>
> Es besteht schon ein Eintrag

bedeutet, dass in DEINER Datenbank-Tabelle der Datenbank-Eintrag, der versucht wird einzutragen, schon existiert.

---

<div class="post-metadata">

**Author:** ![Hashtag\_Assist](https://avatars.discourse-cdn.com/v4/letter/h/e19b73/32.png) [@Hashtag\_Assist](https://forum.shopware.com/u/Hashtag_Assist)\
**Post date:** [3. Februar 2025 um 13:12 UTC](https://forum.shopware.com/t/datenbank-problem-sql-product-visibility-unique-ids-problem/96633/7 "2025-02-03T13:12:04Z")

</div>

Hatte das Problem grade auch. In der Option zur Sichtbarkeit auf der Produktseite im Admin war zwei mal der gleiche Verkaufskanal drin
