5 months ago
I notice that sometimes when i have a larger payload , i get the error below on railway , but sometimes even if the payload is large , it works fine
BadRequestError: request aborted
at IncomingMessage.onAborted (/app/node_modules/raw-body/index.js:245:10)
at IncomingMessage.emit (node:events:517:28)
at IncomingMessage._destroy (node:_http_incoming:224:10)
at _destroy (node:internal/streams/destroy:109:10)
at IncomingMessage.destroy (node:internal/streams/destroy:71:5)
at abortIncoming (node:_http_server:781:9)
at socketOnClose (node:_http_server:775:3)
at Socket.emit (node:events:529:35)
at TCP. (node:net:350:12)
0 Replies
5 months ago
is the request taking longer than 5 minutes? we have a 5 minute request timeout
You mean 5 minutes before the server completes the process? Yes sometimesit does. Also i get the error immediately after the payload hits the server
5 months ago
so 5 minutes doesn't come into play at all?
Honestly it could because sometimes there are multiple users accessing the server
5 months ago
right but if a single request takes longer than 5 minutes we will close it
I'm not sure but i'm guessing the error is because i'm only using one replica. When i increase the replicas , it messes with my SSE.
You mean if it runs for more than 5 minutes the connection will be closed? If that's the case that should be one of the issues because some request take more than 5 minutes to complete. What is the solution to this?
5 months ago
Websockets are not subject to the 5 minutes, only HTTP and SSE requests
Yes the http request could take longer than 5 minutes. The server uses ffmpeg for video generation so sometimes it does take more than 5 minutes to complete the video generation and send it back to the client.
5 months ago
you would need to move to task queues so that you don't keep the connection open for the entire time
5 months ago
you can find lots of resources on that on the interwebs!
Will it be ok if i end the request immediately but the server keeps running in the background , and when thats done(may take longer than 5 mins) , i send it back to the client
5 months ago
yes
So i have the client send a request to the server , i open an sse to track the progress of the video generation , the video generation goes on for 10 minutes (the sse is also open for 10 minutes) and when the video generation is done , i send another request from the client to retrieve the video
5 months ago
that should work
is there some config required for this:
I have a stream of sse events that shuts off exactly at 300s (5 minutes)
i do have the correct response headers
Hi @Brody , Im trying to set up redis using the railway template but its not working. I set it up from the railway dashboard but when i try to connet from my nodejs server i get connection error
5 months ago
please see our docs on this topic -
5 months ago
and please use reference variables -
5 months ago
awesome!
Hey Brody , it seems like my redis server only works on one tasks(not concurrent) even though i set the concurrency to 2 using bullmq in my nodejs server
5 months ago
I'm sorry but that would be an issue with your code
Ah ok i'll keep checking then. I'm just making sure there isnt any railway settings that im missing
5 months ago
nope we have no interaction with how your code talks to Redis