Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate entry for key 'content_elementId_siteId_unq_idx' #410

Closed
cc000001 opened this issue Dec 22, 2022 · 6 comments
Closed

Duplicate entry for key 'content_elementId_siteId_unq_idx' #410

cc000001 opened this issue Dec 22, 2022 · 6 comments
Assignees

Comments

@cc000001
Copy link

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_unq_idx' 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 shnsumit self-assigned this Jan 3, 2023
@shnsumit
Copy link
Collaborator

shnsumit commented Jan 3, 2023

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

  • Creating order on v2.1.4 downloaded and uploaded the translations, then after upgrade to v2.3.3 we merged drafts.
  • Creating order on v2.1.4 downloaded it , then after upgrade uploaded the translations & merged draft.
  • Creating new local order after upgrade to v2.3.3.

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

  • The order was created before the upgrade or was it a fresh order created after upgrade?

In case the order was created before upgrade then:

  • Were the translated files uploaded before the upgrade.
  • Does any of the files were merged or applied before upgrade.

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
Copy link
Author

cc000001 commented Jan 5, 2023

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
Copy link
Author

Hi @shnsumit

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

@shnsumit
Copy link
Collaborator

@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
Copy link
Author

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?

This was referenced Feb 3, 2023
@MerrittBoydston
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants