Question

I'm using HttpUrlConnection class in my java code.

In my environment the connect code never experiences any HTTP 504 error. Whereas in one of my customer environment it throws HTTP 504 error.

Have googled about what 504 is. Based on that have instructed customer to check the proxy, firewall settings in the network/machines. But he claims all are good in their environment. How can I debug the problem.

Any suggestions would be greatly appreciated.

Was it helpful?

Solution

504 Gateway Timeout - The server was acting as a gateway or proxy and did not receive a timely response from the upstream server

You can view your HTTP-server logs and see whether the requests are hitting your server.

If not, then some proxy between client and you is not patient enough to wait for your server's response or experiences network problems.

If yes, then probably your application server (Tomcat, Ruby, Node.js, ...) is stalling the request or is not reachable.

And it would be interesting whether the 504 is returned intermittendly (often or rare) or your customer cannot reach your web resources at all. If this is a big problem for your customers, you should install some kind of End-to-End monitor.

BTW if the traffic is HTTP and not HTTPS, you can sniff it on different points in the network. On Solaris you can use snoop, and on other Linux/*nix OSs tcpdump or wireshark. Wireshark comes with a very nice GUI and you can view the dumps you made with tcpdump on another machine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top