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

13

78

I keep receiving this error when I do some Ajax calls...

It may even be something to do with Geocoding but I really have no idea how to capture the error to display something useful to users... or even how to solve the problem as it seems to just be referencing some kind of pointer or something :S 0x2ef3

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

An image might be more helpful than the error message:

enter image description here

Any ideas at all?

My code fires off 10 ajax calls in 1 second to be processed by geocoding server side.

The error comes up intermittently. Sometimes I get geocoded results and sometimes I get that error. I would say I get it 10% of the time. It completely stops the ajax call from firing my error handler in jQuery.

Sharronsharyl answered 25/1, 2013 at 17:42 Comment(3)
make a console.dir(request) to see the content of the XMLHttpRequest Object, check for status and readystate values and for response and responseTextDecarburize
Same problem here. Using https in IISExpress with self-signed certificate. Strange thing is that problem disappears when I uncheck TLS (all versions) in Advanced settings in Internet Explorer and have at least one SSL version checked.Rightward
Disable HTTP/2 protocol from IE options. https://mcmap.net/q/266357/-disable-http2-in-ie11Lowery
S
31

This is the fix that worked for me. There is invalid mime or bad characterset being sent with your json data causing that errror. Add the charset like this to help it from getting confused:

$.ajax({
  url:url,
  type:"POST",
  data:data,
  contentType:"application/json; charset=utf-8",
  dataType:"json",
  success: function(){
  ...
  }
});

Reference:

Jquery - How to make $.post() use contentType=application/json?

Could not complete the operation due to error c00ce56e

Sheeran answered 1/4, 2013 at 17:49 Comment(4)
You are mixing two things here: Response.ContentType seems to be a server-side thing which makes sure the server includes a charset in in the content type for its response. The contentType in the $.ajax call tells the browser which content-type to use when submitting the request to the server. So one is not an alternative for the other.Scone
Note that this error is (c00ce56e) different from the OP (00002ef3). I believe 00002ef3 is the certificate error mentioned in https://mcmap.net/q/266359/-ie10-11-ajax-xhr-error-script7002-xmlhttprequest-network-error-0x2ef3Whiteness
I see that error ID varying on the same connection attempt during my current struggle with this, so I would not assume it's anything more than some sort of offset.Pate
"...causing that 'errror' "Dene
S
23

We also encountered similar problems. However, setting the charset as noted in the previous comment did not help. Our application was making an AJAX request every 60 seconds and our webserver, nginx, was sending Keep-Alive timeout at 60 seconds.

We fixed the problem by setting the keep-alive timeout value to 75 seconds.

This is what we believe was happening:

  1. IE makes an AJAX request every 60 seconds, setting Keep-Alive in the request.
  2. At the same time, nginx knows that the Keep-Alive timeout value is ignored by IE, so it starts the TCP connection close process (in the case of FF/Chrome this is started by the client)
  3. IE receives the close connection request for the previously sent request. Since this is not expected by IE, it throws an error and aborts.
  4. nginx still seems to be responding to the request even though the connection is closed.

A Wireshark TCP dump would provide more clarity, our problem is fixed and we do not wish to spend more time on it.

Swaim answered 19/7, 2013 at 9:10 Comment(1)
Setting the timeout to 60 also fixed this issue for me on two sites I manage. Glad there was a quick fix for IE on this.Kristlekristo
R
11

I received the same error (SCRIPT7002: XMLHttpRequest: Network Error 0x80004004, Operation aborted), in our case it was because of JavaScript's same origin policy.

Our web app was making a JQuery AJAX call to our server on Port 8080. The call was getting intercepted and re-routed over SSL (due to server rules mandating that incoming traffic use SSL).

Once we made our web app load through the SSL port the issue was fixed.

Ridenour answered 8/10, 2013 at 19:23 Comment(1)
How did you get your web app to load through the SSL port?Truelove
P
2

I had this problem, a 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.

Tracked my issue down - 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 to the server, eventually it timed out and it 'aborted' the request; despite receiving the content and other headers.

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

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

Hope this helps someone!

Pierette answered 22/9, 2015 at 1:12 Comment(1)
can you post the full error for reference? Network Error 0x2ef3 is a general error, which is probably followed by a more specific error code.Whiteness
H
2

This issue happened in my project because of an ajax GET call with a long xml string as a parameter value. Solved by the following approach: Making it as ajax post call to Java Spring MVC controller class method like this.

$.ajax({
    url: "controller_Method_Name.html?variable_name="+variable_value,
    type: "POST",
    data:{ 
            "xmlMetaData": xmlMetaData // This variable contains a long xml string
    },
    success: function(response)
    {
        console.log(response);
    }
  });

Inside Spring MVC Controller class method:

@RequestMapping(value="/controller_Method_Name")
  public void controller_Method_Name(@RequestParam("xmlMetaData") String metaDataXML, HttpServletRequest request)
{
   System.out.println(metaDataXML);
}
Hiroshige answered 3/3, 2016 at 9:49 Comment(0)
T
1

I had this error for some time and found a fix. This fix is for Asp.net application, Strange it failed only in IE non compatibility mode, but works in Firefox and Crome. Giving access to the webservice service folder for all/specific users solved the issue.

Add the following code in web.config file:

 <location path="YourWebserviceFolder">
  <system.web>
   <authorization>
    <allow users="*"/>
   </authorization>
  </system.web>
 </location>
Thermopylae answered 5/3, 2015 at 6:56 Comment(0)
D
1

I have stumbled across this questions and answers after receiving the aforementioned error in IE11 when trying to upload files using XMLHttpRequest:

var reqObj = new XMLHttpRequest();

//event Handler
reqObj.upload.addEventListener("progress", uploadProgress, false);
reqObj.addEventListener("load", uploadComplete, false);
reqObj.addEventListener("error", uploadFailed, false);
reqObj.addEventListener("abort", uploadCanceled, false);

//open the object and set method of call (post), url to call, isAsynchronous(true)
reqObj.open("POST", $rootUrlService.rootUrl + "Controller/UploadFiles", true);

//set Content-Type at request header.for file upload it's value must be multipart/form-data
reqObj.setRequestHeader("Content-Type", "multipart/form-data");

//Set header properties : file name and project milestone id
reqObj.setRequestHeader('X-File-Name', name);

// send the file
// this is the line where the error occurs
reqObj.send(fileToUpload);

Removing the line reqObj.setRequestHeader("Content-Type", "multipart/form-data"); fixed the problem.

Note: this error is shown very differently in other browsers. I.e. Chrome shows something similar to a connection reset which is similar to what Fiddler reports (an empty response due to sudden connection close).

Also, this error appeared only when upload was done from a machine different from WebServer (no problems on localhost).

Deciliter answered 27/1, 2016 at 14:39 Comment(0)
L
1

I just want to add what solved this problem for me, as it is different to all of the above answers.

The ajax calls that were causing the problem were trying to pass an empty data object. It seems IE does not like this, but other browsers don't mind.

To fix it I simply removed data: {}, from the ajax call.

Licit answered 23/2, 2016 at 17:11 Comment(1)
for me, removing body: {} fixed it.Somber
H
1

With the Apache 2 change KeepAliveTimeout set it to 60 or above

Harm answered 15/3, 2016 at 12:6 Comment(0)
V
0

Upping the directive in the virtualhost for KeepAliveTimeout to 60 solved this for me.

Voletta answered 29/9, 2014 at 1:7 Comment(0)
I
0

Have encountered the same issue in my asp.net project, in the end i found the issue is with the target function not static, the issue fixed after I put the keyword static.

[WebMethod]
public static List<string> getRawData()
Induction answered 29/3, 2016 at 5:6 Comment(1)
This is very specific to your application's requirements. the use of "static" is not going to be specifically related to this message. Perhaps try investigate more into what the actual problem was. That would be awesome!Sharronsharyl
O
0

[SOLVED]

I only observed this error today, for me the Error code was different though.

SCRIPT7002: XMLHttpRequest: Network Error 0x2efd, Could not complete the operation due to error 00002efd.

It was occurring randomly and not all the time. but what it noticed is, if it comes for subsequent ajax calls. so i put some delay of 5 seconds between the ajax calls and it resolved.

Overrun answered 29/11, 2016 at 8:47 Comment(2)
It's hard to imagine a scenario where delaying ajax calls for "5 seconds" would be a reasonable solution to this.Larghetto
@ChiefTwoPencils, exactly same is my stand..! but this is what solved my issue after digging so much over the IE official help pages. I didn't found any helpful clue. basically, it's an IE bug but no logical solution. if you find it please update me too.Overrun
D
0

Incase none of these solutions were "clear" enough, essentially IE/Edge is failing to parse your "data" field of your AJAX call properly. More than likely you're sending an "encoded" JSON object.

What Failed: "data": "{\"Key\":\"Value\"}",

What Works: "data":'{"Key":"Value"}'

Dele answered 7/11, 2018 at 15:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.