2 years ago
After that error occurs, when I refresh the page again the app responds normally and there is nothing in logs. I have the new runtime enabled and the new proxy.
34 Replies
2 years ago
N/A
2 years ago
I would expect it to wait for the container to start up again and then display the page instead of just responding with a bad gateway
2 years ago
while the container is still being started
2 years ago
I assume that means the container did start but your app didn't respond in time
2 years ago
do you run migrations in your start command?
2 years ago
I do not
2 years ago
what kind of app is this?
2 years ago
nextjs site
2 years ago
which is not connected to any database or anything
2 years ago
just a static website
2 years ago
what's your start command?
2 years ago
Before the app starts railway responds
2 years ago
did not change it
2 years ago
not using custom
2 years ago
so its most likely just npm run start
2 years ago
are you using a health check
2 years ago
i am not
2 years ago
go ahead and implement that
2 years ago
just putting a / will work?
2 years ago
if it's a static site, yeah just the root path is fine
2 years ago
I can't remember if railway checks the health check when resuming a slept app, but it's good to have either way
2 years ago
Yeah it doesnt work
2 years ago
Before Starting Container appears in logs railway responds with a 502
2 years ago
i mean at the same time^
2 years ago
okay, i asked the team about this and will get back to you when i have more information
2 years ago
Thanks
2 years ago
did you need an immediate solution? because i may have something you can try
2 years ago
No
2 years ago
I will just disable app sleeping in the meantime Lol
2 years ago
sounds good!
2 years ago
got an answer back, this basically means your app was not able to answer the initial http request fast enough.
when there is an incoming request for a slept service, the sleeping service is started and is tcp probed every 30ms for a maximum of 10 seconds, once a prob is successful the http request gets sent to your app, if you app doesn't respond then you will see a railway error page
2 years ago
you have a few options -
figure out why your app accepts a tcp connection but not an http request and remedy that.
stick caddy in front of the service to retry connections on non-200 status code responses.
keep app sleeping disabled.
a year ago
We've resolved an issue where apps with longer startup times were showing 502 errors. Apps now have up to 10 seconds to start accepting traffic, thus preventing these error pages from appearing.
You will need to trigger a deployment so that the changes we have made take effect.
a year ago
cc @Bartek