Question

After updating to 2.3.3. I get the following error for the Temando_Shipping module. I disabled the module but that gives errors when editing products. When I try to enable and run 'magento setup:upgrade' again get this error.

Upgrading data.. SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'origin.address.countryCode' for key 'PRIMARY', query was: INSERT  INTO `temando_product_attribute_mapping` (`node_path_id`,`label`,`description`,`mapping_attribute_id`,`is_default`) VALUES (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?)
Was it helpful?

Solution

This looks like a bug in temando/module-shipping-m2 which is required by magento/product-community-edition. The data is added in vendor/temando/module-shipping-m2/Setup/UpgradeData.php:73

I first checked if there are any differences between the content in my db and the data the module upgrade step tries to insert:

select * from temando_product_attribute_mapping;

In my case, the data was identical, so I deleted it with

delete from temando_product_attribute_mapping;

and ran bin/magento setup:upgrade again. This time, it worked without issues.

Still, this is more a workaround than a solution. I've sent the author of the package a mail to inform him of the problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top