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

core::5.0.0-discard-drafts migration fails when not using i18n #20225

Open
laurenskling opened this issue Apr 28, 2024 · 6 comments
Open

core::5.0.0-discard-drafts migration fails when not using i18n #20225

laurenskling opened this issue Apr 28, 2024 · 6 comments
Assignees
Labels
issue: bug Issue reporting a bug severity: high If it breaks the basic use of the product source: core:core Source is core/core status: pending reproduction Waiting for free time to reproduce the issue, or more information version: 5

Comments

@laurenskling
Copy link
Contributor

Bug report

Required System information

Environment: development
OS: darwin-arm64
Strapi Version: 5.0.0-beta.5
Node/Yarn Version: yarn/1.22.19 npm/? node/v18.20.2 darwin arm64
Edition: Community
Database: sqlite

Describe the bug

Starting beta.5 runs migration core::5.0.0-discard-drafts thats crashes on a missing locale field

Steps to reproduce the behavior

  1. have a strapi 4 without i18n
  2. install beta 5
  3. start
  4. crash

Expected behavior

No crash

@derrickmehaffy derrickmehaffy added issue: bug Issue reporting a bug severity: high If it breaks the basic use of the product status: pending reproduction Waiting for free time to reproduce the issue, or more information version: 5 source: core:core Source is core/core labels May 1, 2024
@derrickmehaffy derrickmehaffy removed their assignment May 1, 2024
@n-alonso n-alonso self-assigned this May 2, 2024
@n-alonso
Copy link

n-alonso commented May 2, 2024

Hi @laurenskling ,

I am not able to reproduce the in 5.0.0-beta.5.
Im also in a mac, using yarn 1.22, node 18, SQLite and upgraded from v4@latest without i18. yarn develop still works just fine and I am able to create and delete content.

Also your reproduction steps are not very descriptive, please in the future try to be as explicit as possible.

I will mark this issue as 'unable to reproduce' until you provide further steps.

EDIT: Also, in addition, i18 is a required package in v5 as entities are now grouped as 'documents' which include also locales.

@n-alonso n-alonso added status: can not reproduce Not enough information to reproduce and removed status: pending reproduction Waiting for free time to reproduce the issue, or more information labels May 2, 2024
Copy link
Contributor

github-actions bot commented May 2, 2024

This is a templated message

Hello @laurenskling,

Thank you for reporting this bug, however we are unable to reproduce the issue you described given the information we have on hand. Can you please create a fresh project that you are able to reproduce the issue in, provide clear steps to reproduce this issue, and either upload this fresh project to a new GitHub repo or compress it into a .zip and upload it on this issue?

We would greatly appreciate your assistance with this, by working in a fresh project it will cut out any possible variables that might be unrelated.
Please note that issues labeled with status: can not reproduce will be closed in 14 days if there is no activity.

Thank you!

@laurenskling
Copy link
Contributor Author

laurenskling commented May 2, 2024

Hi Nicolas,
thanks for taking the time to debug this.
Sorry for my limited bug report. Somewhere I was sure this migration just forgot about v4 working without having i18n turned on and it just failed to work with that use case. But you mention that you are able to migration from a v4 without i18n, that changes the situation.
My error:

⠙ Loading Strapi{ event: 'migrating', name: 'core::5.0.0-discard-drafts' }
[ERROR]  There seems to be an unexpected error, try again with --debug for more information 

MigrationError: Migration core::5.0.0-discard-drafts (up) failed: Original error: select `t0`.`id`, `t0`.`document_id`, `t0`.`locale` from                  
`documents_document` as `t0` where (`t0`.`published_at` is not null) order by `t0`.`id` asc limit 1000 - no such column: t0.locale                          
at /Users/laurenskling/sites/strapi5/node_modules/umzug/lib/umzug.js:151:27                                                                                
at async Umzug.runCommand (/Users/laurenskling/sites/strapi5/node_modules/umzug/lib/umzug.js:107:20)                                                       
at async Object.up (/Users/laurenskling/sites/strapi5/node_modules/@strapi/database/dist/index.js:6239:7)                                                  
at async Object.up (/Users/laurenskling/sites/strapi5/node_modules/@strapi/database/dist/index.js:6263:11)                                                 
at async Object.sync (/Users/laurenskling/sites/strapi5/node_modules/@strapi/database/dist/index.js:2211:9)                                                
at async Strapi.bootstrap (/Users/laurenskling/sites/strapi5/node_modules/@strapi/core/dist/Strapi.js:328:5)                                                
at async Strapi.load (/Users/laurenskling/sites/strapi5/node_modules/@strapi/core/dist/Strapi.js:294:5)                                                     
at async Module.develop (/Users/laurenskling/sites/strapi5/node_modules/@strapi/strapi/dist/node/develop.js:177:28)                                         
at async action (/Users/laurenskling/sites/strapi5/node_modules/@strapi/strapi/dist/cli/commands/develop.js:18:5)                                           
at async Command.parseAsync (/Users/laurenskling/sites/strapi5/node_modules/commander/lib/command.js:923:5)                                                 

My situation:

  • i come from a v4 without i18n
  • i have content types in plugins
  • i still do not have i18n installed in v5, as it is now auto installed

Edit: I got confused by the from documents_document.. This is not Strapi Documents. I have a content type called Document in my Documents plugin 🤷 If i disable that plugin, it just errors on the next content with draftAndPublish enabled

@laurenskling
Copy link
Contributor Author

By the way, I am talking about the migration. If I start without a database, yes it boots and you can work. But thats not the point. The point is the migration called core::5.0.0-discard-drafts when I have content.

@derrickmehaffy derrickmehaffy added status: pending reproduction Waiting for free time to reproduce the issue, or more information and removed status: can not reproduce Not enough information to reproduce labels May 2, 2024
@derrickmehaffy
Copy link
Member

By the way, I am talking about the migration. If I start without a database, yes it boots and you can work. But thats not the point. The point is the migration called core::5.0.0-discard-drafts when I have content.

@laurenskling we aren't to the point of being ready for testing migrations from v4 yet. We don't expect to be able to do that until probably around May 22nd or so.

@Eventyret Eventyret removed their assignment May 3, 2024
@laurenskling
Copy link
Contributor Author

Thanks @derrickmehaffy , I guess we can keep this open until testing of migration starts then :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug severity: high If it breaks the basic use of the product source: core:core Source is core/core status: pending reproduction Waiting for free time to reproduce the issue, or more information version: 5
Projects
Status: To be reviewed (Open)
Status: Can't reproduce
Status: Can't reproduce on Strapi 5
Development

No branches or pull requests

4 participants