Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Firefox aborts its http request silently within 60 seconds

  • 11 replies
  • 2 have this problem
  • 395 views
  • Last reply by usatosi

more options
  • Summary

Firefox aborts its http request within almost 60 seconds(period till timeout varies) and tells nothing to users. This happened with both of Nginx and Apache.

  • Environment

Client browser: Firefox 35.0.1 Client OS: Windows 7 Enterprise 32bit SP1 Web Server: Apache 2.2.3-91 & Nginx 1.6.2-1 Server OS: CentOS 5.11 PHP: 5.3.3 FastCGI: spawn-fcgi-1.6.3-1

  • Description of the issue

I have noticed that nginx logs http response code 499 so often.

We use nginx almost only for two web applications, the one based on PHP and others on ruby. We experiences this problem in both apps. The server and client PC belong to the same subnet.

Since last month, nginx logged 624 errors for Firefox and 16 for other browsers(almost IE).

So for test, I wrote the simple PHP (see the bottom of this article) and tried to access it through both of Apache & Nginx with Firefox 35.0.1 and IE 11. IE11 waited 120 seconds and returned html successfully through both of nginx and Apache, but Firefox failed either.

Let me describe Firefox's behaviour.

1. Enter the test php url at location bar and press enter. 2. The message 'waiting server response' appears at status bar for a while. 3. Watching network conversation through Wireshark, 'Keep Alive' signals are repeated some times between server and client, and after that, 4. The message dissappears. 'FIN' signal is sent to the server from the client just after that. Firebug logs 'Aborted' at the almost the same time. 5. The server responses 'FIN ACK.'

There is a bit difference with nginx and Apache in behaviour after 'FIN ACK'.

A.Nginx

Nginx logs '499' error and finish conversation immediately.

B.Apache doesn't log anthying at this step. After 120 seconds(sleep timer in PHP) from request it returns expected html. Of course Firefox don't render it but I could confirm both of request and response from Wireshark's 'Follow TCP Stream' function. Finally it is logged with http status code 200 at httpd log file.

I repeated this test several times. Actual timeout period varies from 22 to 70 seconds but results are same.

With my understanding, the browser is expected to show 'time out error' after such situation but it doesn't show anything. So end user can't know what happend.

---

  • What I tried to solve the problem
  • disabled all extentions other than firebug.
  • set 'network.tcp.keepalive.enabled' to false at about:config.
  • set 'network.http.spdy.enabled' to false, too.
  • set 'network.http.response.timeout' to 0.
  • disabled IPV6 and DNS prefetch seeing the following help.

https://support.mozilla.org/en-US/kb/websites-dont-load-troubleshoot-and-fix-errors

  • changed Timeout to 0 at apche's http.conf.

My purpose is make our web apps to work properly in our working environment. I've recommended Firefox to our collegues because it was very cool application. Changing the default brawser is nightmare to me. Any suggestions are welcome.

--- <test php> sleep(120); echo time();

*Summary Firefox aborts its http request within almost 60 seconds(period till timeout varies) and tells nothing to users. This happened with both of Nginx and Apache. *Environment Client browser: Firefox 35.0.1 Client OS: Windows 7 Enterprise 32bit SP1 Web Server: Apache 2.2.3-91 & Nginx 1.6.2-1 Server OS: CentOS 5.11 PHP: 5.3.3 FastCGI: spawn-fcgi-1.6.3-1 *Description of the issue I have noticed that nginx logs http response code 499 so often. We use nginx almost only for two web applications, the one based on PHP and others on ruby. We experiences this problem in both apps. The server and client PC belong to the same subnet. Since last month, nginx logged 624 errors for Firefox and 16 for other browsers(almost IE). So for test, I wrote the simple PHP (see the bottom of this article) and tried to access it through both of Apache & Nginx with Firefox 35.0.1 and IE 11. IE11 waited 120 seconds and returned html successfully through both of nginx and Apache, but Firefox failed either. Let me describe Firefox's behaviour. 1. Enter the test php url at location bar and press enter. 2. The message 'waiting server response' appears at status bar for a while. 3. Watching network conversation through Wireshark, 'Keep Alive' signals are repeated some times between server and client, and after that, 4. The message dissappears. 'FIN' signal is sent to the server from the client just after that. Firebug logs 'Aborted' at the almost the same time. 5. The server responses 'FIN ACK.' There is a bit difference with nginx and Apache in behaviour after 'FIN ACK'. A.Nginx Nginx logs '499' error and finish conversation immediately. B.Apache doesn't log anthying at this step. After 120 seconds(sleep timer in PHP) from request it returns expected html. Of course Firefox don't render it but I could confirm both of request and response from Wireshark's 'Follow TCP Stream' function. Finally it is logged with http status code 200 at httpd log file. I repeated this test several times. Actual timeout period varies from 22 to 70 seconds but results are same. With my understanding, the browser is expected to show 'time out error' after such situation but it doesn't show anything. So end user can't know what happend. --- *What I tried to solve the problem *disabled all extentions other than firebug. *set 'network.tcp.keepalive.enabled' to false at about:config. *set 'network.http.spdy.enabled' to false, too. *set 'network.http.response.timeout' to 0. *disabled IPV6 and DNS prefetch seeing the following help. https://support.mozilla.org/en-US/kb/websites-dont-load-troubleshoot-and-fix-errors *changed Timeout to 0 at apche's http.conf. My purpose is make our web apps to work properly in our working environment. I've recommended Firefox to our collegues because it was very cool application. Changing the default brawser is nightmare to me. Any suggestions are welcome. --- &lt;test php&gt; sleep(120); echo time();

Modified by cor-el

Chosen solution

Dear jscher2000,

I've accessed your site with my Firefox twice and it did not time out. After 120 seconds, Firefox rendered text 'Slept 120 seconds before generating HTML.'

So this is not the problem of Firefox, but of our network or server, or both of them.

Thank you everyone. I'll try to narrow down the cause of our problem.

Read this answer in context 👍 0

All Replies (11)

more options

The client closes the request before the Ngix can respond. Info about: network.http.connection_timeout: lxr -> update, setting http.network.connection_timeout to 0 will make the issue worse, you want to increase this number.

This seems like a similar environment and it suggests to override the timeout however the root for this situation was Amazon's ELB, load balancing where Firefox received a second request and timed out before Ngix could send the second request: http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&...

  • Are you seeing more than one request to Firefox, before the 60 second timeout?
  • Check the ssl version too, I just saw a site that did not have hsts and downgraded to tls 1.0-? this might be irrelevant.

Reference: outdated? https://www.mare-system.de/guide-to-nginx-ssl-spdy-hsts/


Hold tight, I am still looking for help....

Modified by guigs

more options

Note that you can see an internally generated X-Firefox-Spdy header (e.g. X-Firefox-Spdy:3) in the Response Headers that you can inspect (click the main HTML file) in the Web Console to indicate that SPDY is being used and what SPDY version.

See also:

Modified by cor-el

more options

Dear guigs2 and cor-el,

Thank you for your answers. I was very encouraged by that. My purpose is to make our web app (with plenty of Ajax codes) on nginx, but to make the issue simple, I'd like to focus on the case with single request to php script to Apache web server which is supposed to be more stable.

I also found stackoverflow's discussion on Amazon's ELB case, but I already set Timeout to 1200 seconds in my httpd.conf. So I think this is not the case.

> Are you seeing more than one request to Firefox, before the 60 second timeout?

No. enter php url(with autocomplete) and hit enter. That's all. Please refer to attached image of tcp sessions.

> For spdy: ngix uses version 2: http://forum.nginx.org/read.php?2,240278,240278 so it seems right to turn it off. Though since you are on version 1.6 it may have been fixed? : via ticket

SPDY is not enabled on both of Apache and nginx.

> Check the ssl version too, I just saw a site that did not have hsts and downgraded to tls 1.0-? this might be irrelevant.

SSL is enabled on nginx but not on Apache. ssl version is too old...

>Note that you can see an internally generated X-Firefox-Spdy header (e.g. X-Firefox-Spdy:3) in the Response Headers that you can inspect (click the main HTML file) in the Web Console to indicate that SPDY is being used and what SPDY version.

I could not find SPDY header neither from Web Console or Wireshark.

Here are logs from Wireshark. The text bellow is stream content and attached images are filtered tcp stream. Could you see Firefox send FIN but Apache sends response after 120 seconds sleep(as in the php code above). As a result tcp session fails. 192.168.0.2 is client and 192.168.0.40 is the server.

FYI, I rebooted the server in this morning. But the issue persists.

  • successful case with IE

GET /index.php HTTP/1.1 Accept: image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, application/x-ms-xbap, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-xpsdocument, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* Accept-Language: ja-JP User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3; .NET4.0E; Tablet PC 2.0) Accept-Encoding: gzip, deflate Host: myserver:81 DNT: 1 Connection: Keep-Alive

HTTP/1.1 200 OK Date: Fri, 20 Feb 2015 08:58:42 GMT Server: Apache/2.2.3 (CentOS) X-Powered-By: PHP/5.3.3 Content-Length: 102 Keep-Alive: timeout=150, max=100 Connection: Keep-Alive Content-Type: text/html; charset=UTF-8


(html body rendered correctly)

  • Unsuccessful case with Firefox 35

GET /index.php HTTP/1.1 Host: myserver:81 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:35.0) Gecko/20100101 Firefox/35.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: ja,en-us;q=0.7,en;q=0.3 Accept-Encoding: gzip, deflate Connection: keep-alive

HTTP/1.1 200 OK Date: Fri, 20 Feb 2015 10:40:05 GMT Server: Apache/2.2.3 (CentOS) X-Powered-By: PHP/5.3.3 Content-Length: 102 Keep-Alive: timeout=150, max=100 Connection: Keep-Alive Content-Type: text/html; charset=UTF-8

(html body rendered correctly)

more options

Second screensothttp://networkengineering.stackexchan.../why-do-i-see-a-rst-ack-packet-instead-of-a-rst-packet


network.http.connection-timeout set to 0 will never give that timeout message. AFAIK in the client this may be why the connection is closed.

more options

Update I am fling a bug to get more insight from the developers. Hold tight, please also follow the bug for more updates. https://bugzilla.mozilla.org/show_bug.cgi?id=1135282

Please also see for https://bugzilla.mozilla.org/page.cgi?id=etiquette.html

more options

usatosi, could you give us the php url you're testing with? A Firefox developer was looking to reproduce your problem but couldn't without it.

He also asked: I'm having trouble figuring out what the problem is - Is the question here about a resource that is timing out in between the request and response?

more options

Dear guigs2,

Thank you for filing a bug!

Dear Noah_SUMO,

I tried to post test php code here but it was removed after posting. My code is quite simple.

sleep(120);

echo time();

My problem is that Firefox quits its requests so often. Above code is just to reproduce the problem. Is it normal behavior for Firefox to time out it's request before waiting 120 seconds?

I also tried the test again with new profile, but the results were same.

more options

Following up, usatosi, would it be possible to share the url in the bug? Then we can CC the suggested person from the previous poster?

Thank you!!

more options

Our web server is not open to the internet. Instead I can post apache's httpd.conf and logs captured by wireshark if they are helpful.

more options

Here's a sample page that starts with:

<?php 
sleep(120);
?><!DOCTYPE html>...

http://www.jeffersonscher.com/res/sleep120.php (on Apache)

Strangely, my Firefox didn't time out loading it -- I thought it would time out after 90 seconds. ??

more options

Chosen Solution

Dear jscher2000,

I've accessed your site with my Firefox twice and it did not time out. After 120 seconds, Firefox rendered text 'Slept 120 seconds before generating HTML.'

So this is not the problem of Firefox, but of our network or server, or both of them.

Thank you everyone. I'll try to narrow down the cause of our problem.