Attributes Import // Integrity constraint violation: 1062 Duplicate entry

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
kai_lf
Posts: 7
Joined: 26 Mar 2021, 21:47

Attributes Import // Integrity constraint violation: 1062 Duplicate entry

Post by kai_lf » 19 Jul 2023, 09:38

Hi there,
I have a strange behavior on importing attributes.xml. We have about 200 attributes in our shop. On a daily basis we do updates from our main database via XML / Scheduler. Everything is fine - except one Attribute. In our XML are no new attributes, as they do not change often. So why do we have one attribute throwing this "duplicate key Error" - and the other nearly 200 attributes don't throw any error?

aimeos: 2022.10.x
TYPO3: 11.5.25

Error:

Code: Select all

Die Ausführung von Task "Aimeos Shop Planer (aimeos)" ist fehlgeschlagen mit folgender Meldung: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'product-Farbe-Senfgelb-1.' for key 'mshop_attribute.unq_msatt_dom_type_code_sid': INSERT INTO "mshop_attribute" ( "key", "type", "domain", "code", "status", "pos", "label", "mtime", "editor", "siteid", "ctime" ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) ["product|Farbe|Senfgelb","Farbe","product","Senfgelb",1,0,"Senfgelb","2023-07-19 11:29:39","scheduler","1.","2023-07-19 11:29:39"]
XML:

Code: Select all

  <attributeitem ref="product|Farbe|Senfgelb">
    <attribute.domain><![CDATA[product]]></attribute.domain>
    <attribute.type><![CDATA[Farbe]]></attribute.type>
    <attribute.code><![CDATA[Senfgelb]]></attribute.code>
    <attribute.label><![CDATA[Senfgelb]]></attribute.label>
  </attributeitem>
Any help or hint would be appreciated :-)

Regards, Kai

User avatar
aimeos
Administrator
Posts: 7895
Joined: 01 Jan 1970, 00:00

Re: Attributes Import // Integrity constraint violation: 1062 Duplicate entry

Post by aimeos » 20 Jul 2023, 10:23

Check if there's a value of "Senfgelb" with different upper/lower case characters is already in the database.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply