Does Railway blocks memory for files on runtime?
Im having problem with save file on buffer to process, the stack is Node + Fastify, and the code works on localhost perfectly, but on Railway just stop on that saves file in memory for usage.
27 Replies
Project ID:
af0ccfe5-cb9d-43cd-9c80-2ba515dc53b2
af0ccfe5-cb9d-43cd-9c80-2ba515dc53b2
I've use an in memory buffer and in memory file system before without issues
what node version are you using locally and what node version is railway using?
How do i find the version in production?
should be in the build table at the top of the build logs
I didn't find it, but it must be 18 default
show a screenshot of the build table please
o, finded, it is 18
what version are you using locally
18.18
is
file.toBuffer()
a new api in node 18.18?nop, is from fastify
then this would be a code issue
hmmm ok
Not seem like a code issue, now im trying to write a file on the app root directory and the promise never ends
Change the strategy to not use buffers in memory, again, not works
The MultipartFile appears normally in the log
this is an issue with your app, not railway
i dont wanna intrigue, but testing on others plataform the service run as expected,this logs is from render
I just wanna continue using Railway 😢
give me a minimal reproducible example and I will see what I can find out
and side question, how big are these xlsx files you are trying to handle the upload of?
btw, can't you use
stream
? XLSX seems to support streamsand if the file you're receiving is a
File
web api, you can just call await file.stream();
or just save the file to disk and then use fs
to create a read stream.
railway have ephemeral disk anyways so no need for a volume.+/- 700kb
I tried to include as much detail as possible in the code without exporting what is sensitive but still leaving it as close to my structure as possible.
im looking for a repo that i can simply just deploy and get the same error
Hello Thalles,
In fact I was doing exactly as you said, the problem was the same, for the promise that converting the upload file into a buffer or stream (I tried both), never ends.
Good morning guys,
any news on the subject?
I don't have the knowledge about infrastructure to test what the error could be...
In other providers, both the strategy of storing the file in memory as Buffer or saving a local copy are working, in Railway it still doesn't finalize the promises...
I'm sorry but this wouldn't be an issue with railway
however, this offer is still open
I understood that this description was enough, in this case, just copying the code into this folder structure should work
https://discord.com/channels/713503345364697088/1166349559665012846/1166794385866899559
help me, help you
let me know if that's something you'd be interested in providing, otherwise there's not much I can do for you here unfortunately