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

select * from strapi_database_schema order by time DESC limit 1 - Out of sort memory, consider increasing server sort buffer size #20312

Open
claudiograssia opened this issue May 15, 2024 · 1 comment
Assignees
Labels
issue: bug Issue reporting a bug severity: low If the issue only affects a very niche base of users and an easily implemented workaround can solve source: core:database Source is core/database package status: pending reproduction Waiting for free time to reproduce the issue, or more information

Comments

@claudiograssia
Copy link

Bug report

Hi, I found this error after the schema column in the strapi_database_schema table reached 262kb.

Required System information

Strapi Version: You can reproduce this bug using Strapi versions from 4.5.0 to 4.24.2.
Database: Mysql 8
Node Versione: 16,18,20
NPM: 6.0
OS: Ubuntu 20.04
Project: Javascript

Describe the bug

I encountered this error when I added many collections, resulting in the schema column in the strapi_database_schema table reaching a size of 262kb. When I attempted to start the server using the command:

yarn develop

I receive the error:

Error: select * from `strapi_database_schema` order by `time` DESC limit 1 - Out of sort memory, consider increasing server sort buffer size

I attempted to resolve the issue by adding a simple index key to the schema column, but it did not work in any case.

Steps to reproduce the behavior

  1. Create a Strapi instance with a MySQL database.
  2. Create many collections until the schema column in the strapi_database_schema table reaches 262kb.
  3. Attempt to start Strapi using the command yarn develop.
  4. Observe the error in the console.

Expected behavior

The error:

Error: select * from `strapi_database_schema` order by `time` DESC limit 1 - Out of sort memory, consider increasing server sort.

should not appear; otherwise, the Strapi instance will not start.

@claudiograssia
Copy link
Author

"I also tried this query directly in the database; if I try to insert 'id' instead of 'time' in the sorting, the error does not appear."

@joshuaellis joshuaellis added issue: bug Issue reporting a bug severity: low If the issue only affects a very niche base of users and an easily implemented workaround can solve source: core:database Source is core/database package status: pending reproduction Waiting for free time to reproduce the issue, or more information labels May 15, 2024
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: low If the issue only affects a very niche base of users and an easily implemented workaround can solve source: core:database Source is core/database package status: pending reproduction Waiting for free time to reproduce the issue, or more information
Projects
Status: To be reviewed (Open)
Status: To review
Development

No branches or pull requests

3 participants