Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to load resource: net::ERR_EMPTY_RESPONSE http://test.com

Im working on a chrome extension which sends XMLHttpRequest to a URL, gets response in JSON format, parse the response and shows list of records. Its working fine. The problem is when user performs any action and go back to listing section, system follows the same process sends the XMLHttpRequest request but everytime i get this response:

Failed to load resource: net::ERR_EMPTY_RESPONSE http://test.com

First time when i load the extension everything works fine, after that it always show the above mentioned error.

Its a two HTML pages extension. One for signin and other for listing. Im using ajax to toggle divs based on results.

Now the Weird part. Only 3 of my users have this problem so far. Two of them have mac and one windows 8.1. For all other users it works perfectly fine.

like image 764
Kevin Avatar asked Mar 13 '14 09:03

Kevin


Video Answer


1 Answers

I have run across the same problem. I developed a very AJAX intensive application, which works perfectly on the localhost. Using the identical machine to test the live site (hosted by GoDaddy) pressing a button to activate an AJAX function is intermittently accepted.

If I repeatedly press the button, and watch what is going on in the developer tools, I see the Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data. indicated by the "(failed)":

enter image description here

On the eighth attempt in the above picture, you can see it finally worked. The best way to verify if this is what is happening to you is to wait 1 minute, and repeat the action. It seems that the speed of the connection is what is causing this problem, although the speed of the last error is much faster than the first success. And while I am checking other websites to verify that the internet is still "ON", this might do more with the settings in the web-browser, or the host computer. You can see that this seems to be the solution to the problem, according to this answer. But then again, this answer states to reset the network settings and restart the machine.

Other solutions point to clearing the browser's cache or disabling add-ons, but reloading or refreshing is difficult and unreliable as a solution for non-tech users. Finally, it might have something to do with the hosting server settings.

I suspect it may have something to do with the Server sensing a DDOS attack (a large number of small AJAX requests), so it temporarily blocks/ignores the request. Changing hosts (or self hosting) may be the best solution.

like image 141
Sablefoste Avatar answered Oct 11 '22 06:10

Sablefoste