VirtusLab-Open-Source / strapi-plugin-navigation

A plugin for Strapi Headless CMS that provides navigation / menu builder feature with their possibility to control the audience and different output structure renderers like (flat, tree and RFR - ready for handling by Redux First Router)
MIT License
318 stars 58 forks source link

Reopened ER_DUP_ENTRY issue #345

Closed TasosBak closed 1 year ago

TasosBak commented 1 year ago

Hello!

I don't know if the closed issues are being watched so I'm mentioning here that I commented an update on #334

If the right flow is to reopen that issue, this one can be deleted.

mattialorenzutti commented 1 year ago

I'm having the same exactly problem with i18n internationalisation on, every time the server restart the plugin is trying to write wrong queries giving me errors and everything is blocked

daan-ef2 commented 1 year ago

Yes its a problem with internationalisation :(

cyp3rius commented 1 year ago

Trying to reproduce exact cases to solve them.

daan-ef2 commented 1 year ago

If you have a Strapi install with one locale active and some menu's, try adding a new locale. It fails after that.

CodeVoyager commented 1 year ago

Hi @TasosBak @mattialorenzutti and @daan-ef2

Would share strapi versions and what kind of database are you using? This will help with debugging.

cyp3rius commented 1 year ago

Fixed in version v2.2.15

erikcvisser commented 1 year ago

I still experience this issue, using v2.2.15 (with MySQL, and Strapi 4.14.0). I had manually removed the duplicate entries from the database, but on startup, I still get:

"[2023-10-05 06:24:59.168] error: insert into navigations (created_at, locale_code, name, slug, updated_at, visible) values ('2023-10-05 06:24:59.160', 'es', 'Main navigation', 'main-navigation-es', '2023-10-05 06:24:59.160', true)

Error: ER_DUP_ENTRY: Duplicate entry 'main-navigation-es' for key 'navigations.navigations_slug_unique' at Sequence._packetToError (/opt/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14) at Query.ErrorPacket (/opt/node_modules/mysql/lib/protocol/sequences/Query.js:79:18) at Protocol._parsePacket (/opt/node_modules/mysql/lib/protocol/Protocol.js:291:23) at Parser._parsePacket (/opt/node_modules/mysql/lib/protocol/Parser.js:433:10) at Parser.write (/opt/node_modules/mysql/lib/protocol/Parser.js:43:10) at Protocol.write (/opt/node_modules/mysql/lib/protocol/Protocol.js:38:16) at Socket. (/opt/node_modules/mysql/lib/Connection.js:88:28) at Socket. (/opt/node_modules/mysql/lib/Connection.js:526:10) at Socket.emit (node:events:517:28) at Socket.emit (node:domain:489:12)"

CodeVoyager commented 1 year ago

Hi @erikcvisser,

Would you check if you don't have left-over items from failed navigation bootstrap, please?

erikcvisser commented 1 year ago

@CodeVoyager I no longer experience this issue. Perhaps there was indeed some migration half-executed. I will reopen if I encounter the issue again. Thanks.