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

nnevenPRO

a year ago

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!

0 Replies

nnevenPRO

a year ago

c4aab2e0-3c93-4c07-b086-ac5d458bd1b1


nnevenPRO

a year ago

Should I try restarting or redploying my DB? What will happen to my data?


a year ago

I would first upgrade to the hobby plan and then grow the volume


nnevenPRO

a year ago

I am on the Pro Plan


a year ago

is your project located within a pro workspace


nnevenPRO

a year ago

Yes


a year ago

what's the size of the attached volume


nnevenPRO

a year ago

1.46 GB


a year ago

what's the total size


nnevenPRO

a year ago

50 GB


nnevenPRO

a year ago

max size?


nnevenPRO

a year ago

What do you suggest I do this is my prod db


a year ago

it's completely offline?


nnevenPRO

a year ago

I am unable to connect or query to it


nnevenPRO

a year ago

  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:

a year ago

to get it temporarily back online, have you tried to redeploy?


nnevenPRO

a year ago

no


nnevenPRO

a year ago

will restarting or redeploying persist my data?


nnevenPRO

a year ago

I should probably restart before redeploy?


a year ago

unless you have severaly misconfigured something, no your data should be in tact


nnevenPRO

a year ago

would it make sense to fork the whole environment


nnevenPRO

a year ago

before I try this


a year ago

that doesnt copy any data


nnevenPRO

a year ago

as a backup?


nnevenPRO

a year ago

what can I do then to make sure it is backed up safely?


a year ago

do you not take backups?


nnevenPRO

a year ago

no not externally


a year ago

wdym externally?


nnevenPRO

a year ago

I guess should do that before I hit restart/redeploy?


nnevenPRO

a year ago

i just deployed a mysql db instance on railway with an attached volume


nnevenPRO

a year ago

i dont have backups beyond that


a year ago

that means you dont have any backups, since railway does not do backups for you


a year ago

go ahead and restart the database


nnevenPRO

a year ago

dont think I should create backup first?


nnevenPRO

a year ago

its a very vanilla deployment i didnt mess with config


a year ago

you said you cant access the database?


nnevenPRO

a year ago

ok i will try restart


nnevenPRO

a year ago

hmm seems like I can access the DB from prisma studio but not the client sdk



nnevenPRO

a year ago

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


a year ago

i dont think fragly's suggested fix would persist between deploys


a year ago

you can permanently double the sort buffer size by appending --sort_buffer_size=512K onto your mysql start command


nnevenPRO

a year ago

@Brody I backed up and restarted it, still getting same error


nnevenPRO

a year ago

Will redeploy persist / reload my data?


a year ago

again, yes, unless you have severely missconfigured something


nnevenPRO

a year ago

ok will do, and wil try the sort buffer size command after if no luck


a year ago

ideally you would write a more efficient query, but increasing the sort buffer size is alright


nnevenPRO

a year ago

yeah changing sort in my query also fixes it, thanks for the help 🙏


a year ago

no problem


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