24

The client requested to download a compressed log file, using Ext.js a form submission on an embedded iframe. Request was sent to server, which has Apache and JBoss 6. The servlet compresses log files, do some database operation and returns the compressed file.

Exactly after 2 min, the 504 Gateway Time-out The server didn't respond in time message is seen at the browser net panel. How to fix this error?

Community
  • 1
  • 1
Ricardo
  • 3,696
  • 5
  • 36
  • 50

3 Answers3

31

The servlet was taking a long time to compress the log files, and Apache's timeout was set to 2min.

The error was fixed by increasing the TimeOut Directive on the httpd.conf file:

#
# Timeout: The number of seconds before receives and sends time out.
#
##Timeout 120
Timeout 600
Mark Eirich
  • 10,016
  • 2
  • 25
  • 27
Ricardo
  • 3,696
  • 5
  • 36
  • 50
  • 11
    Please notice that this solution might not be acceptable for the user. Instead of making a longer `timeout`, other option could be reviewing the workflow and implement the use case differently. E.g.: one request to start the operation (in this case compression), some notifications of the progress and a final notification with the link to download the file. – Ricardo Jan 20 '15 at 17:41
1

Check your apache error logs. This can also be caused if the file size limit is set too low.

Jack Vial
  • 2,354
  • 1
  • 28
  • 30
0

In my case more simply. I forgot to disable the Proxy extention in the browser.

Ruslan Novikov
  • 1,320
  • 15
  • 21