Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP Status 504

Tags:

http

I'm getting the following error when my win32 (c#) app is calling web services.

The request failed with HTTP status 504: Gateway timeout server response timeout. 

I understand 'I think' that this is because the upstream request does not get a response in a timely fashion.

But my question is this? How do I change the app.config settings in my win32 application to allow more time to process its data. I assume I require these changes to be made on my app settings as the webservices and IIS hosting the ws are setup with extended times.

Look forward to a response and thank you in advance.

like image 592
user26098 Avatar asked Nov 04 '08 11:11

user26098


People also ask

What does HTTP 504 mean?

The HyperText Transfer Protocol (HTTP) 504 Gateway Timeout server error response code indicates that the server, while acting as a gateway or proxy, did not get a response in time from the upstream server that it needed in order to complete the request.

What causes a 504 error?

A 504 Gateway Timeout Error means your web server didn't receive a timely response from another server upstream when it attempted to load one of your web pages. Put simply, your web servers aren't communicating with each other fast enough.

Is a 504 Gateway Timeout my fault?

They are no fault of the client. Your request is good, but the server can not generate the requested resource. The 504 Gateway Timeout error indicates that your web server didn't get a response on time from another server that it was accessing while trying to load the page.


2 Answers

You can't. The problem is not that your app is impatient and timing out; the problem is that an intermediate proxy is impatient and timing out. "The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URI." (http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.5) It most likely indicates that the origin server is having some sort of issue, so it's not responding quickly to the forwarded request.

Possible solutions, none of which are likely to make you happy:

  • Increase timeout value of the proxy (if it's under your control)
  • Make your request to a different server (if there's another server with the same data)
  • Make your request differently (if possible) such that you are requesting less data at a time
  • Try again once the server is not having issues
like image 195
james.garriss Avatar answered Sep 29 '22 04:09

james.garriss


CheckUpDown has a nice explanation of the 504 error:

A server (not necessarily a Web server) is acting as a gateway or proxy to fulfil the request by the client (e.g. your Web browser or our CheckUpDown robot) to access the requested URL. This server did not receive a timely response from an upstream server it accessed to deal with your HTTP request.

This usually means that the upstream server is down (no response to the gateway/proxy), rather than that the upstream server and the gateway/proxy do not agree on the protocol for exchanging data.

This problem is entirely due to slow IP communication between back-end computers, possibly including the Web server. Only the people who set up the network at the site which hosts the Web server can fix this problem.

like image 44
Toon Krijthe Avatar answered Sep 29 '22 03:09

Toon Krijthe