What does "ERR_HTTP2_PING_FAILED" mean in Chrome error code? - ajax

That error message logged to the chrome console from a long-pending request after around 15 minutes.
It looks client-side error because server processing still worked.
I did not find any article related to this error message.
can any buddy let me know how to solve this issue?

According to the chromium source I think it means that a spdy ping timed out.
...
{net::ERR_EMPTY_RESPONSE, "http.response.empty"},
{net::ERR_HTTP2_PING_FAILED, "spdy.ping_failed"},
{net::ERR_HTTP2_PROTOCOL_ERROR, "spdy.protocol"},
...
Source https://chromium.googlesource.com/chromium/src/+/lkgr/components/domain_reliability/util.cc#48
Chrome sends such pings before and after a request.
Source https://groups.google.com/d/msg/spdy-dev/HFjAbFRd-N0/p-Edt-lneGsJ

Related

Jmeter - error message "500/unexpected alert open"

I can't close an alert with Jmeter on my website.
Jmeter return me the following message : "500/unexpected alert open".
I tried a lot of methods and I investigated a lot on internet, but I haven't found a solution :(
please, help...
JMeter is not a browser, as such it doesn't interpret client javascript as Selenium does it.
So you need to understand what Javascript does in terms of request(s) going to server and reproduce this with HTTP Request
Finally I have found a solution to my problem with the following command :
WDS.browser.executeScript('window.onbeforeunload = null;')

How do I avoid the "java.util.zip.ZipException: Not in GZIP format" error while using JMeter 2.12

I'm trying to record my interactions with a SAAS website using JMeter 2.12. I get the following error trace as soon as I try to login:
java.util.zip.ZipException: Not in GZIP format
at java.util.zip.GZIPInputStream.readHeader(Unknown Source)
at java.util.zip.GZIPInputStream.(Unknown Source)
at java.util.zip.GZIPInputStream.(Unknown Source)
at org.apache.http.client.entity.GzipDecompressingEntity.decorate(GzipDecompressingEntity.java:56)
at org.apache.http.client.entity.DecompressingEntity.getDecompressingStream(DecompressingEntity.java:68)
at org.apache.http.client.entity.DecompressingEntity.getContent(DecompressingEntity.java:82)
at org.apache.http.client.entity.GzipDecompressingEntity.getContent(GzipDecompressingEntity.java:41)
at org.apache.http.conn.BasicManagedEntity.getContent(BasicManagedEntity.java:89)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:348)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1141)
at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:236)
Blockquote
I searched for the solution and found one in BugZilla: Bug 51918 where it says to turn off the concurrent download. I tried that by unchecking the "Retrieve All Embedded Resources" option in the 'HTTP Requests Defaults'- but still getting the error and cannot proceed.
Can anyone please help? Thanks a lot!
--Ishti
Ok, I think I got an answer. Thanks to Bhargav in his post where he basically told to change the 'HTTP sampler settings' (in the HTTP test script recorder) to 'Java'. I tried that and it's not giving me the error anymore. I can proceed. Thanks!
I got into this problem in JMETER this week. The solution that worked for me in current version is.
In the header manager add:
Accept-Encoding: gzip;q=0,deflate,sdch
The server will send you a response that JMETER can handle.
I got this error on a Web application (Genexus WebApp) when it sent me an HTTP 403 error code with invalid encoding.
So to troubleshoot the problem I use two approaches:
First, turn on the log level to DEBUG, and enable the Log Viewer:
With this we can see the current payload in the Viewer:
Another alternative is to set the accept-encoding to identity, to receive the payload uncompressed.
So after that, I figured out the problem was my request (invalid params)

AJAX error, Drupal 7

I got an AJAX error while running Drupal 7.
"An AJAX error occured.
HTTP result code: 500
Debugging information follows:
Path: system/AJAX
StatusText: error
Response text:"
There is no response text. I have looked everywhere and tried a couple of things, but nothing works. Anyone have an idea on how to fix it?
Thanks
Check your watchdog table, if nothing there check the php error log.
Also use Firebug's console to check what is returned after the ajax request for any clues.
Can also try disabling third party modules one at a time to find out what is causing the error.

ASIHTTPRequest Error, Code 2, on actual iPad

I have a program that asynchronously downloads 4 files into the Documents folder of an ipad, and this works perfectly on the simulator, but when I use it on an actual ipad it gives me this error:
Error Domain=ASIHTTPRequestErrorDomain Code=2 "The request timed out" UserInfo=0x1c0810 {NSLocalizedDescription=The request timed out}
Is there any way to fix this, or extend the time until time out?
The reason why you are getting better results in the simulator is probably because the simulator uses the built in network card and your Mac's network card is likely stronger than the one in the iPad.
You can use the following code to change the timeout interval. This code will set the timeout to twenty seconds:
[request setTimeOutSeconds:20]
According to the ASIHTTPRequest "How to Use" page, you can tell ASIHTTPRequest to try again N times, like so:
[request setNumberOfTimesToRetryOnTimeout:2];
EDIT:
Although it's 2016 and ASIHTTPRequest is long since deprecated, there's another useful bit of information to help diagnose networking issues on iOS devices. Try using the Network Link Conditioner. It ships with iOS and can be downloaded on macOS.
This article (link) from NSHipster has some great information on getting set up.
Cause of this problem may be the following. When we send a httprequest and don't received response from server but at this time you send another httprequest again and with second request response is received before first request.

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