29

SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3, Could not complete the operation due to error 00002ef3

No valid solution at the moment.

Update: Noticed on IE11 also.

After more and more investigation, I come with this results:

  1. The problem is specific to my application, it does not happen on facebook.
  2. The problem has nothing to do with max number of requests per host (I did sample page that flood the server, IE10 is able to handle up to 8-10 req at the same time, inside my application I also tried to do ajax requests serially, it failed also).
  3. The problem is specific to POST requests.
  4. The problem is not specific to the JS library used (I tried direct XMLHttpRequest from console it also failed).
  5. The failure happened after xhr.send(), xhr.readyState = 4 and xhr.onreadystatechange triggered.
  6. The failure is not related to any Content-type, proper requests or server configuration. It is only client, requesting dummy page will fail, with a bare minimum XHR, just xhr.open and xhr.send.
  7. It happened mainly after clearing browser cache.
  8. Doing GET request before POST does not solve this problem.

My questions are:

  1. How browser cache may affect POST ajax requests?
  2. Does any body have contact with IE developers to tell us what this error 'Network Error 0x2ef3' mapped to ?

For now the temporary solution I am doing is simply retry for a max 3 times if the HTTP status code was zero. But it is very ugly because even upload requests sometimes failed, and it become slow for those requests with retry, sometimes it will take extra 100ms.

Steps to reproduce:

  1. Make sure fiddler or proxy is disabled.
  2. http://ie10.laiths.name/#!login
  3. Open IE10 console, delete your browser cache.
  4. Try this invalid login: random@rand.com/random
  5. After 3-4 times (clear-cache/invalid-login) you will see this error: SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3, Could not complete the operation due to error 00002ef3.

My IE Version:

  • Win7 IE10 Version: 10.0.9200.16618
  • Update Version: 10.0.6 (KB2838727)

For now I am solving it by retrying a max of 3 times if the browser is IE10 && Request is POST && HTTP status code is 0.

I would appreciate if somebody can help me to remove my ugly solution, because with such solution even if the the request goes to the server and it returns 0 I will also retry (I was trying to avoid that by measuring the time between xhr.send and its callback but it is not reliable), what about if IE10 in comptMode, what about if IE11 has same problem, add to that performance, it will take on my machine ~170ms between each retry.

Laith Shadeed
  • 4,271
  • 2
  • 23
  • 27
  • I'm unable to reproduce this in IE10. Tried something like 10 times. – Jan Sommer Jun 16 '13 at 17:08
  • I am adding the automatic retry, did you try to clear the cache before each try? are you using the developer toolbar remove cache button ? – Laith Shadeed Jun 16 '13 at 18:24
  • Yes, I cleared the cache after every try by clicking Cache (in developer tools) -> Clear browser cache... – Jan Sommer Jun 16 '13 at 19:09
  • Now I tried again, it happened for me. I am using Win7 IE10 Version: 10.0.9200.16618 , Update Version: 10.0.6 (KB2838727). I closed my fiddler or any other proxy (for some reason with proxy like fiddler it does not happen). Open IE and start network capture, try invalid-login-clear-cache, after 2 times I got the problem. – Laith Shadeed Jun 17 '13 at 06:41
  • Just curious, was this on Vista? – NoBugs Sep 10 '13 at 23:16
  • It was not specific to Vista, it was also occurring on Win7 and Win8 – Laith Shadeed Sep 11 '13 at 10:29

2 Answers2

11

This can be happening due a security certificate issue. If you clear the cache you loose part (if not all) of certificate information.

You can find more information (and a workaround) in http://www.jonnyreeves.co.uk/2013/making-xhr-request-to-https-domains-with-winjs/

Basically it says you must do a GET before your POST request in order to update the certificate information.

Robert Levy
  • 28,747
  • 6
  • 62
  • 94
Ezequiel Gorbatik
  • 2,475
  • 1
  • 16
  • 19
  • 1
    Thank you, in fact I saw this URL before, but I was not convinced with the idea, however I will give it a try. Btw I am *not* using HTTPS – Laith Shadeed May 30 '13 at 06:58
  • What server are you using? – Ezequiel Gorbatik May 30 '13 at 11:19
  • 1
    I am using Apache, but it is purely client side, the request did not go over the wire, it even did not go outside the browser itself. – Laith Shadeed May 30 '13 at 14:32
  • Check this out http://social.msdn.microsoft.com/Forums/en-US/scripting/thread/3ce4fdd8-f481-46eb-9755-c09a1bf49333 – Ezequiel Gorbatik May 30 '13 at 17:19
  • 1
    I don't use HTTPS, my domain is HTTP and I don't see facebook does such double request (GET then POST) on IE10 although they are using HTTPS – Laith Shadeed Jun 06 '13 at 21:27
  • In this page: http://ie10.laiths.name/#!login, I am doing GET request before POST, but no difference. It does not solve my problem. – Laith Shadeed Jun 19 '13 at 23:51
  • 1
    I am currently experiencing this issue with the new Edge browser. AJAX POST cross-domain call does not work until you do a HEAD/GET request before-hand. Both domains are connected over HTTPS. IE 11 works fine. Is this a bug? – Dmitry S. Aug 01 '15 at 04:23
  • I am also facing this issue intermittently on IE11. Was anyone able to find the fix? – Peter Jan 11 '18 at 04:03
1

I had this problem, an AJAX Post request that returned some JSON would fail, eventually returning abort, with the:

SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3

error in the console. On other browsers (Chrome, Firefox, Safari) the exact same AJAX request was fine.

Further investigation revealed that the response was missing the status code - in this case it should have been 500 internal error.

This was being generated as part of a C# web application using service stack that requires an error code to be explicitly set.

IE seemed to leave the connection open, eventually network layer closed it and it 'aborted' the request; despite receiving the content and other headers.

Updating the web application to correctly return the status code fixed the issue.

Perhaps there is an issue with how IE is handling the headers in posts.

Hope this helps someone!