AcclaroInc / craft-translations

Easily manage your Craft CMS website translations and drive global growth with simplified translation workflows.
https://plugins.craftcms.com/translations
Other
9 stars 11 forks source link

Duplicate entry for key 'content_elementId_siteId_unq_idx' #410

Closed cc000001 closed 1 year ago

cc000001 commented 1 year ago

We've recently upgraded the translations plugin on a craft 3 site from 2.1.4 to 2.2.3, and now when trying to apply a translation to a channel section we see the following error and the draft doesn't get created:

_12/22/2022 – Could not update draft Error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '9892-5' for key 'content_elementId_siteId_unqidx' The SQL being executed was: UPDATE content SET elementId=9892, siteId=5, title='Ventilation', dateUpdated='2022-12-22 09:20:32' WHERE id=8728

We are using the Local Export/Import translator with XML files.

Craft: 3.7.62 Translations: 2.2.3 PHP: 7.4

shnsumit commented 1 year ago

@cc000001 Thanks for sharing the issue here.

We would need some more details to debug that issue, we have tried at our end to reproduce the issue but was not able to reproduce. We have test couple of scenarios:

It would be great if you can provide few more details about the this order like:

In case the order was created before upgrade then:

It would be easy to debug this issue if we could know what were the order/files statuses while the plugin was updated. And are you getting the same issue with any new order?

cc000001 commented 1 year ago

Hi @shnsumit

Thanks for the reply!

The order we were testing was created after the upgrade to 2.2.3

We’ve also just tested an order that was created before the upgrade (which had previously applied drafts correctly) and received the same error.

Could not update draft Error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry...

Here’s the full activity log from our original test order:

12/22/2022 – Order created
12/22/2022 – Order status changed to ‘In progress’
12/22/2022 – Order status changed to ‘Ready for review’
12/22/2022 – File {test.xml} imported successfully!
12/22/2022 – Could not update draft Error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘5800-5’ for key ‘content_elementId_siteId_unq_idx’ The SQL being executed was: UPDATE `content` SET `elementId`=5800, `siteId`=5, `title`=‘Dehumidifiers’, `dateUpdated`=‘2022-12-22 10:05:27’ WHERE `id`=5177
12/22/2022 – Drafts created
12/22/2022 – Order status changed to ‘Ready to apply’

The order status does seem to be getting updated and the changes in the order file are recognised, but no draft is created

cc000001 commented 1 year ago

Hi @shnsumit

Hope all is well. Just wondering if you had any update on this please?

shnsumit commented 1 year ago

@cc000001 Hi, The above log was not much help and moreover, we have tried more different options to reproduce the issue but were not been able to reproduce it.

Would like to know if it is possible to get admin access to any dev/stage environment to get more information?

cc000001 commented 1 year ago

Hi @shnsumit Ok, thank you. Do you have a ticket system or support email address where we can securely share the login details for the staging site?

MerrittBoydston commented 1 year ago

Hi @cc000001, I wanted to follow up on this ticket. We were unable to reproduce this issue and require access to the client's dev/staging environments.

@shnsumit, do you have a secure way that @cc000001 can share details for the staging site?