I’m getting 502 Bad Gateway errors when trying to reach my (docker environment) web service.
Based Web service returning HTTP/1.1 502 Bad Gateway - #2 by shantanu, it sounds like Render may be trying to send me HEAD requests to figure out what port the server is running on. I don’t want to bother responding to HEAD requests, so I just set the environment variable PORT to the appropriate port number of my server. That affected my internal host:port value but I’m still seeing 502’s externally. I have not tested reaching the server internally.
I can see from the server logs that no incoming requests are making it through. Oddly enough I’m not seeing any HEAD requests in the logs either. In the Events tab I can see “Deploy failed: Timed out” events, but what exactly timed out? There’s no description.
Hi Samuela, I checked the service, and looks like the reason was that your service never built successfully. When the deploy fails (check for failed deploys in the events tab of your service page), you will not be able to access your service through the onrender address. So I recommend looking at your build event and resolving the issue causing the build to fail. The shell tab flickering is happening because of the same reason, since the service never successfully ran, you won’t be able to access the shell.
Thanks for sending this over, it makes things clear. My bad, looks like it was not the build but the fact that your application is listening on 127.0.0.1 instead of 0.0.0.0. If you can change this in your code, then the issue should be resolved.
Hi, I have the same challenge. Mine happens intermittently. Like 4 out of every 10 requests in a row will return 502. I’ve tried the ‘0.0.0.0’ and port recommendations. Still doesn’t work
Since 502 errors are a general symptom that can have many causes, we would recommend reaching out directly regarding this. As this is about a specific service we’d request that you login to our dashboard and contact us via the ‘Help’ link at the top of our dashboard and make sure you pick the service that this question relates to from your account.
As this is a public forum it’s probably best not to share that directly here,