522 Bad Gateway with no logs
We've had a nodejs based docker service failing silently with a 502 bad gateway error for the last day or two randomly. While i'm not 100% sure it's origin is Railway, the code itself hasn't changed in a few days but the service has crashed multiple times in the last 24 hours seemingly at random
10 Replies
Project ID:
93bdb69d-3975-4e76-bc29-f940b0028664
93bdb69d-3975-4e76-bc29-f940b0028664
Solution
502 means your app has not responded to the incoming request
Are there any additional logs in this service? The last thing we see is a successful request completion
you can check the HTTP logs for your http logs
as for deploy logs, whatever your app logs will be there, so if there is something missing its because the app lacks verbose logging
im also seeing a lot of 500 logs, so something is going wrong with your application lately
you can filter for a specific status code with
@httpStatus:500
(replace 500 with your desired code)Is there a way to auto-restart containers?
by default railway will restart up to 10 times when your app crashes, is that not what you are looking for?
Is there a way to trigger it off a healthcheck?
nothing railway native, you would need to write code that interacts with the API to do that
but that is not a productive use of time, time would be better spent fixing the root issue with your app
Right - thanks for the help