R
Railway7mo ago
bebop

[ERROR] [MY-013131] [Server] Out of sort memory, consider increasing server sort buffer size!

Hi, I am getting this issue on MySQL database. I am unable to query it anymore and am not sure how to resolve it. Please help, thank you!
No description
Solution:
ideally you would write a more efficient query, but increasing the sort buffer size is alright
Jump to solution
33 Replies
Percy
Percy7mo ago
Project ID: c4aab2e0-3c93-4c07-b086-ac5d458bd1b1
bebop
bebopOP7mo ago
c4aab2e0-3c93-4c07-b086-ac5d458bd1b1 Should I try restarting or redploying my DB? What will happen to my data?
Brody
Brody7mo ago
I would first upgrade to the hobby plan and then grow the volume
bebop
bebopOP7mo ago
I am on the Pro Plan
Brody
Brody7mo ago
is your project located within a pro workspace
bebop
bebopOP7mo ago
Yes
Brody
Brody7mo ago
what's the size of the attached volume
bebop
bebopOP7mo ago
1.46 GB
Brody
Brody7mo ago
what's the total size
bebop
bebopOP7mo ago
50 GB max size? What do you suggest I do this is my prod db
Brody
Brody7mo ago
it's completely offline?
bebop
bebopOP7mo ago
I am unable to connect or query to it
⨯ PrismaClientUnknownRequestError:
Invalid `prisma.dataRoom.findMany()` invocation:


Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(Server(ServerError { code: 1038, message: "Out of sort memory, consider increasing server sort buffer size", state: "HY001" })), transient: false })
at DataRoomsPage (dashboard/page.tsx:49:23)
⨯ PrismaClientUnknownRequestError:
Invalid `prisma.dataRoom.findMany()` invocation:
⨯ PrismaClientUnknownRequestError:
Invalid `prisma.dataRoom.findMany()` invocation:


Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(Server(ServerError { code: 1038, message: "Out of sort memory, consider increasing server sort buffer size", state: "HY001" })), transient: false })
at DataRoomsPage (dashboard/page.tsx:49:23)
⨯ PrismaClientUnknownRequestError:
Invalid `prisma.dataRoom.findMany()` invocation:
Brody
Brody7mo ago
to get it temporarily back online, have you tried to redeploy?
bebop
bebopOP7mo ago
no will restarting or redeploying persist my data? I should probably restart before redeploy?
Brody
Brody7mo ago
unless you have severaly misconfigured something, no your data should be in tact
bebop
bebopOP7mo ago
would it make sense to fork the whole environment before I try this
Brody
Brody7mo ago
that doesnt copy any data
bebop
bebopOP7mo ago
as a backup? what can I do then to make sure it is backed up safely?
Brody
Brody7mo ago
do you not take backups?
bebop
bebopOP7mo ago
no not externally
Brody
Brody7mo ago
wdym externally?
bebop
bebopOP7mo ago
I guess should do that before I hit restart/redeploy? i just deployed a mysql db instance on railway with an attached volume i dont have backups beyond that
Brody
Brody7mo ago
that means you dont have any backups, since railway does not do backups for you go ahead and restart the database
bebop
bebopOP7mo ago
dont think I should create backup first? its a very vanilla deployment i didnt mess with config
Brody
Brody7mo ago
you said you cant access the database?
bebop
bebopOP7mo ago
ok i will try restart hmm seems like I can access the DB from prisma studio but not the client sdk i think identical to this issue: https://discord.com/channels/713503345364697088/1128981546544668704/1128981546544668704 I'm gonna try and setup backups first before trying restart/redeploy and will come back if none of that fixes it, thanks for help thus far
Brody
Brody7mo ago
i dont think fragly's suggested fix would persist between deploys you can permanently double the sort buffer size by appending --sort_buffer_size=512K onto your mysql start command
bebop
bebopOP7mo ago
@Brody I backed up and restarted it, still getting same error Will redeploy persist / reload my data?
Brody
Brody7mo ago
again, yes, unless you have severely missconfigured something
bebop
bebopOP7mo ago
ok will do, and wil try the sort buffer size command after if no luck
Solution
Brody
Brody7mo ago
ideally you would write a more efficient query, but increasing the sort buffer size is alright
bebop
bebopOP7mo ago
yeah changing sort in my query also fixes it, thanks for the help 🙏
Brody
Brody7mo ago
no problem
Want results from more Discord servers?
Add your server