Ajax not working with SSL on IE error code 12019 - ajax

I am working on a web application built on Java, JSP, Ajax the servers are JBoss with front in Apche 2 server. The application is accessed over the internet. clients are using mostly IE 7, 8, 9 Browsers.
The application was working perfectly before.Recently we applied SSL certificates over the site, after this we started getting complaints from the user that pages where Ajax is applied are not submitting. Normally we call the ajax on submit button and block the page till response is received from the server. we applied loggers and found that the ajax request calls are failed with ajax jqXHR error status as 12019.
We observed that this error is observed by the users where IE (mostly version 8 and 9) is used. the pattern of error is also not same. some time the same user able to submit page who complaint earlier and some time not. i tried best to produce this scenario over my local and development environment but could not.
i google the problem and found something that 12019 error code is a bug of IE. but why it worked before applying the SSL,
and if SSL is not correct why the problem is only at the ajax page why not somewhere else. I cant say users to change the browser.
This driving me crazy for more then a week. Please help me if anyone else has observed and solve this before.

This is due to IE attempting to cache something it shouldnt.
There are 2 options
Add no cache headers
"If-Modified-Since", "Thu, 1 Jan 1970 00:00:00 GMT"
"Cache-Control", "no-cache"
Append a cache busting parameter
"x-1&y=2...&ieispoo="+Date.now()
I realize this is an old question, but someone else might benefit from the answer.

Related

AJAX request terminated abnormally with select photo uploads in Drupal

I'm busy fixing an issue on a site a friend runs for her work. I have worked on this site before, and this is the only Drupal site I have ever worked on, so I am somewhat of a newbie to Drupal. The original dev decided they no longer wanted to maintain it quite some time ago and kind of disappeared shortly after.
The issue:- Most photos upload fine however some cause the following error:
An AJAX HTTP request terminated abnormally. Debugging information follows.
Path: /?q=file/ajax/field_accom_image/und/form--5hp1P7pzFdShaND24CsiI7QNe3f9bApEq9Gu78bRZg
StatusText: n/a
ResponseText: Bad Request Your browser sent a request that this server could not understand. Apache Server at REAL_URL_REDACTED Port 80
ReadyState: undefined
I have found "An AJAX HTTP request terminated abnormally" errors on StackOverflow and the Drupal site, however, none of them had a "ResponseText" of "Bad Request" and a "ReadyState" of "undefined" simultaneously.
This didn't stop me from trying troubleshooting from those answers, such as setting the $base_url variable in settings.php, checking and changing permissions on the server, disable the overlay feature for the admin settings, compressing the image to a smaller file size, dropping the image resolution, removing all possible metadata from the image, checking the upload max file size in the php config.
Drupal version is 7.59

Suspected IIS7.5 Connector Issue Tomcat & Coldfusion 10 if over certain size ajax call

I have test a form submission on my local testing server and all is good.
However once the code is uploaded to Coldfusion 10 on IIS7.5 it fails.
Basically if I have 2 contact details on the screen its fine, if there are three it refuses to update via ajax (called via ajaximport).
The url length is 2.48kb, the error varies from
"NS_ERROR_FAILURE: Failure"
Other times I get a 500 server error with
http://m.yapcrm.com/sites/dump/ii7errorlongajaxcall.cfm
I have checked the usual subjects and tweaked the server, but no joy..
Best I can figure its the connector to Tomcat as its the ISAPifilter picking up the issue.
In short, any hints or help would be great!!
As suggested above, no solution was found. However changing the default method from Get to Post
Example for reference anybody else.
var submitForm = new UpdateContact();
**submitForm.setHTTPMethod("POST");**
submitForm.setCallbackHandler(response);
submitForm.setErrorHandler(errorHandler);
submitForm.setForm("testValidator");
submitForm.UpdateContact();
UpdateContact() being the CFC method called via cfAjaxProxy.

Very Slow Sharepoint (Authentication Problem? - Getting 401 errors on images and styles)

I'm currently using Team Foundation Server and WSS 3.0 as the Team Portal. After the installation and configuring, I noticed the application was very slow sometimes, taking minutes to load a page. Then I googled it and found n solutions, none solved my problem.
Using Firebug I noticed I was getting a lot of 401 errors, mostly in _layouts and _themes folders.
Error image: http://i.stack.imgur.com/SmurI.jpg
Authentication method is NTLM
Any clue on what's happening? The page loads, it just takes forever before showing up.
EDIT: Here's fiddler statistics:
Request Count: 161
Bytes Sent: 144.851 (headers:133249; body:11602)
Bytes Received: 400.222 (headers:69769; body:330453)
ACTUAL PERFORMANCE
Requests started at: 09:47:55.449
Responses completed at: 09:50:03.311
Aggregate Session time: 00:03:11.542
Sequence (clock) time: 00:02:07.8627850
TCP/IP Connect time: 239ms
RESPONSE CODES
HTTP/401: 84
HTTP/200: 74
HTTP/302: 2
HTTP/404: 1
RESPONSE BYTES (by Content-Type)
application/x-javascript: 218.048
~headers~: 69.769
text/html: 37.837
image/gif: 31.467
text/css: 27.506
image/png: 10.133
image/jpeg: 3.937
text/javascript: 1.007
text/xml: 518
We have had exactly this problem with a sharepoint site.
The root cause is the way that NTLM works. The NTLM handshake is a 401.2 401.1 followed by a 200. Allways 3 requests for each file.
For each request, the web server will send a request to the AD server. The problem is that by default there is only 2 connections to the AD server. So the request get backed up and retried.
There are two things that you can do:
Make sure that you are caching the gif files (then you will not have to get them all the time)
Switch to Kerberos
Edit
For setting up Kerberos have a look at this blog post http://blogs.msdn.com/b/martinkearn/archive/2007/04/23/configuring-kerberos-for-sharepoint-2007-part-1-base-configuration-for-sharepoint.aspx
Did you look at this common SharePoint performance fix?
Can you verify this happens on all clients? If you access the page from a browser on the server itself, do you still get this result?
If you haven't yet, turn off IPv6 in your network settings. Also, verify your DNS settings. Slow AD authentication + RPC Server Unavailable leads me to believe you may have addressing issues. Does everything seem responsive from a ping? When you log on to your machine, does it take a long time to log in (another symptom of DNS setting problems)?
if you are 401 errors on CSS / js / Images / .axd. with sharepoint /
NTLM authentification
You must configure the anonymous access on the webapplication and if you have a publishing portal activate the anonymous on :
- style library
- sitecollectionimage
I came across this problem with css files I downloaded. For some reason, the windows setting "encrypt contents to secure data" was checked for some files. After removing this setting, everything went fine. Be sure to unblock them if necessary.
(just to be sure: I'm talking about (file)->properties->advanced->encrypt data...)

Ajax call from local html page in Webkit Qt

I'm trying to perform an Ajax/XMLHTTPrequest from within a local HTML file in QT 4.7RC QWebview. It consistently fails with an empty responseText and status 0. I've set the follwing
page->settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls,true);
but it has no effect (I can load remote images without problems though).
It seems to be a known issue and I'm not sure if there is a solution already.
https://bugs.webkit.org/show_bug.cgi?id=31875
Any ideas for a workaround would be very helpful. Basically what I'm trying to do is running a HTML/Javascript WebApp in QWebview that talks to a local server at 127.0.0.0 and this problem is kind of a show-stopper. Interestingly, the actual query is sent and my server responds with 200 and the requested data. But the response never arrives in my Javascript callbacks.
Not sure about your question but are you sure that you are inside an AJAX security sandbox that works with webkit? In Firefox, IE and others using AJAXin different domains does not work. In fact, http://demo1.demo.com is different than demo2.demo.com

Why is AJAX returning HTTP status code 0?

For some reason, while using AJAX (with my dashcode developed application) the browser just stops uploading and returns status codes of 0. Why does this happen?
Another case:
It could be possible to get a status code of 0 if you have sent an AJAX call and a refresh of the browser was triggered before getting the AJAX response. The AJAX call will be cancelled and you will get this status.
In my experience, you'll see a status of 0 when:
doing cross-site scripting (where access is denied)
requesting a URL that is unreachable (typo, DNS issues, etc)
the request is otherwise intercepted (check your ad blocker)
as above, if the request is interrupted (browser navigates away from the page)
Same problem here when using <button onclick="">submit</button>. Then solved by using <input type="button" onclick="">
Status code 0 means the requested url is not reachable. By changing http://something/something to https://something/something worked for me. IE throwns an error saying "permission denied" when the status code is 0, other browsers dont.
It is important to note, that ajax calls can fail even within a session which is defined by a cookie with a certain domain prefixed with www. When you then call your php script e.g. without the www. prefix in the url, the call will fail and viceversa, too.
Because this shows up when you google ajax status 0 I wanted to leave some tip that just took me hours of wasted time... I was using ajax to call a PHP service which happened to be Phil's REST_Controller for Codeigniter (not sure if this has anything to do with it or not) and kept getting status 0, readystate 0 and it was driving me nuts. I was debugging it and noticed when I would echo and return instead of exit the message I'd get a success. Finally I turned debugging off and tried and it worked. Seems the xDebug debugger with PHP was somehow modifying the response. If your using a PHP debugger try turning it off to see if that helps.
I found another case where jquery gives you status code 0 -- if for some reason XMLHttpRequest is not defined, you'll get this error.
Obviously this won't normally happen on the web, but a bug in a nightly firefox build caused this to crop up in an add-on I was writing. :)
This article helped me. I was submitting form via AJAX and forgotten to use return false (after my ajax request) which led to classic form submission but strangely it was not completed.
"Accidental" form submission was exactly the problem I was having. I just removed the FORM tags altogether and that seems to fix the problem. Thank you, everybody!
I had the same problem, and it was related to XSS (cross site scripting) block by the browser. I managed to make it work using a server.
Take a look at: http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/282972/why-am-i-getting-xmlhttprequest.status0
We had similar problem - status code 0 on jquery ajax call - and it took us whole day to diagnose it. Since no one had mentioned this reason yet, I thought I'll share.
In our case the problem was HTTP server crash. Some bug in PHP was blowing Apache, so on client end it looked like this:
mirek#toccata:~$ telnet our.server.com 80
Trying 180.153.xxx.xxx...
Connected to our.server.com.
Escape character is '^]'.
GET /test.php HTTP/1.0
Host: our.server.com
Connection closed by foreign host.
mirek#toccata:~$
where test.php contained the crashing code.
No data returned from the server (not even headers) => ajax call was aborted with status 0.
In my case, it was caused by running my django server under http://127.0.0.1:8000/ but sending the ajax call to http://localhost:8000/. Even though you would expect them to map to the same address, they don't so make sure you're not sending your requests to localhost.
In our case, the page link was changed from https to http. Even though the users were logged in, they were prevented from loading with AJAX.
In my case, setting url: '' in ajax settings would result in a status code 0 in ie8.. It seems ie just doesn't tolerate such a setting.
For me, the problem was caused by the hosting company (Godaddy) treating POST operations which had substantial response data (anything more than tens of kilobytes) as some sort of security threat. If more than 6 of these occurred in one minute, the host refused to execute the PHP code that responded to the POST request during the next minute. I'm not entirely sure what the host did instead, but I did see, with tcpdump, a TCP reset packet coming as the response to a POST request from the browser. This caused the http status code returned in a jqXHR object to be 0.
Changing the operations from POST to GET fixed the problem. It's not clear why Godaddy impose this limit, but changing the code was easier than changing the host.
I think I know what may cause this error.
In google chrome there is an in-built feature to prevent ddos attacks for google chrome extensions.
When ajax requests continuously return 500+ status errors, it starts to throttle the requests.
Hence it is possible to receive status 0 on following requests.
In an attempt to win the prize for most dumbest reason for the problem described.
Forgetting to call
xmlhttp.send(); //yes, you need this pivotal line!
Yes, I was still getting status returns of zero from the 'open' call.
In my case, I was getting this but only on Safari Mobile. The problem is that I was using the full URL (http://example.com/whatever.php) instead of the relative one (whatever.php). This doesn't make any sense though, it can't be a XSS issue because my site is hosted at http://example.com. I guess Safari looks at the http part and automatically flags it as an insecure request without inspecting the rest of the URL.
In my troubleshooting, I found this AJAX xmlhttpRequest.status == 0 could mean the client call had NOT reached the server yet, but failed due to issue on the client side. If the response was from server, then the status must be either those 1xx/2xx/3xx/4xx/5xx HTTP Response code. Henceforth, the troubleshooting shall focus on the CLIENT issue, and could be internet network connection down or one of those described by #Langdon above.
In my case, I was making a Firefox Add-on and forgot to add the permission for the url/domain I was trying to ajax, hope this saves someone a lot of time.
Observe the browser Console while making the request, if you are seeing "The Same Origin Policy disallows reading the remote resource at http ajax..... reason: cors header ‘access-control-allow-origin’ missing" then you need to add "Access-Control-Allow-Origin" in response header. exa: in java you can set this like response.setHeader("Access-Control-Allow-Origin", "*") where response is HttpServletResponse.

Resources