I have a consistent extremely long (2min+) blocking call on mac/chrome. The same set of steps work just fine on other operating systems or browsers. (And even some other macs.) The site isn't super chatty, and there aren't any other requests that take anywhere over 2 seconds.
The blocking PUT call almost always follows a DELETE call to a different url. (Same server.) According to my console logs, the server actually receives and returns the results of the PUT call very quickly. So Chrome thinks it is blocked but it is actually already processed!
Any ideas?
Following up on this post: Chrome and Firefox CORS AJAX calls get aborted on some Mac machines
This mac had a DISABLED Sophos antivirus on the machine. Uninstalling it completely fixed this issue.
ARGGGGG.
Hopefully someone else finds this post and is able to spend less than the hours we spent on it.
Related
I have been stuck on this for a couple of weeks now and this is a follow on from SO question Delphi REST Debugger Returns Error 429 Too Many Requests but Browser Returns JSON as Expected
I was wanting to get the content of a url response using the TNetHTTPRequest and TNetHTTPClient components. I was continually getting 429 errors “too many requests”. When using Firefox Inspect Element to look at network and storage, I discovered that I needed to receive cookies and then send those cookies with my request. Unfortunately, one of the cookies essential to the website content seems to be dependent (I think) on the execution of javascript. I went back to first principles and dropped a TWebbrowser on a form (VCL) and sure enough browser shows a javascript error “Expected Identifier”.
When I use the TWebbrowser in FMX it does not throw an error it just does not return the website contents at all and remains blank. I need FMX as I will be in a cross platform mobile environment.
The URL is https://shop.coles.com.au/a/national/home
I use Delphi Community Edition 10.3.3 Rio.
The URL returns perfectly in commercial browsers Firefox, Safari, Chrome and even CEF4Delphi. Unfortunately, I can’t use CEF as I need cross platform.
I would like to know how to get the website content returned to the browser (or even better NetHTTPClient) without script errors and how to access the browsers current cookies.
Any help will be most appreciated.
Thanks,
John.
URL returns perfectly in commercial browsers ... without script errors and how to access the browsers current cookies
If you'd inspect the network traffic (F12 > Network, then requesting your URL) or use uMatrix (to block everything that doesn't belong to the domain by default) you'd see the JS does at least one XHR to amazonaws.com. Your HTTP transfer alone (as done by TNetHTTP*) works fine and you get the same resource that each internet browser gets.
However, you don't operate with what you got (in contrast to the internet browser, which also automatically parses the HTML, sees JS resources, and executes them). TWebbrowser does not what you take for granted most likely due to security settings (try to get an error console in there, preferably F12 again). You need to do the same: parse the HTML resource for JS URIs, requesting those and executing what you get, while still providing the same cookie environment.
For executing JS you could use Chakra or mORMot or BESEN. It's challenging at first, but the more you understand about HTTP (including cookies) and a JS engine, the more you'll see why "things work" in one situation and not in another. There's a reason why an internet browser is a very complex software and not just a downloader.
As per this forcing IE11 Quirks mode might cure your problem already when using TWebBrowser:
TBrowserEmulationAdjuster.SetBrowserEmulationDWORD(TBrowserEmulationAdjuster.IE11_Quirks);
I would like to know. Is there any option to generate random network errors for testing of js code? I am trying to implement some error handling during the upload of files to the PHP server but "unfortunately", my internet is rather stable at home + I do it in LAN. I was trying to use a VPN switch, but it switches almost instantly, without network disruption (or at least it seems that way) and even if it worked, I do not feel like using that solution because of that frustrating routine that comes with it...
Thanks!
The Chrome inspector's Network tab has options for, among other things,
throttling your connection
blocking requests
and simulating offline mode for your tab (which might do the trick if you hit it during a request).
I'm trying to troubleshoot a problem on a client's machine for our website. We're using an ajax call to get information on a page to select additional parameters. Our callback function has a block of code for reading when the ajax coming back is an error or is correct. For every other computer that we've tested this with, the ajax comes back. However, for a particular client, we're seeing the ajax come back with the error message, meaning the response never got there successfully or that it's corrupted or broken.
Does anyone know how this would happen? The client is using IE 8 and I've tested IE 8, IE 9, IE 10, and Chrome and all of those work on my computers.
EDIT: As of now, we don't have access to the system and the network that would be causing the error. They are trying to see if they can accept everything from our domain and see if that fixes it, but right now, I can't put Fiddler on their computer.
I've seen any amount of random behaviour caused by virus scanners and so-called network security products. Try adding an exception for your site to any security software your client is running.
The other thing to do is to use Wireshark, Fiddler, etc. to see what's actually happening at the network level.
For a special project I chose to write my very own tiny web server which is actually quite easy with the .Net Framework (HttpListener class).
Everything was working beautifully until yesterday when I started to test with Internet Explorer.
My server kept crashing on any ie request ! I finally managed to figure the reason out : ie litterally stutters ! (well at least ie7 and ie8, I've not tried other versions yet).
The problem never occurs with FireFox nor Chrome nor Opera.
To be more specific, I'm using dynamic javascript insertion in the web page to get around the same origin policy in a cross-domain call scenario. This script generates a request to my tiny server. Let's say the request built is :
http://localhost:8081/myService?p1=A,p2=B,p3=C,p4=D,p5=E
With FFox, Chrome or Opera, my server indeed receives a single request from the browser :
http://localhost:8081/myService?p1=A,p2=B,p3=C,p4=D,p5=E
with ie, my server receives a random amount of partial requests like :
http://localhost:8081/myService?p1=A,
http://localhost:8081/myService?p1=A,p2=B,
http://localhost:8081/myService?p1=A,p2=B,p3=C,
http://localhost:8081/myService?p1=A,p2=B,p3=C,p4=D,
(and in fact a lot of them since I have 20 parameters or so...)
and finally :
http://localhost:8081/myService?p1=A,p2=B,p3=C,p4=D,p5=E
This is bascically not big deal as my logic is able to handle the lacking parameters situation. The problem is that each incomplete request actually closes the connection (error 1229). That was crashing the server which was trying to answer to each request. The fix was easy but I still don't like the fact that the server is flooded with those intermediate "unanswerable" and thus unuseful requests.
(Moreover, the request sometimes looks like :
http://localhost:8081/myService?p1=A,p2=B,p3=C,?p1=A,p2=B,p3=C,p4=D,p5=E
!!! )
I traced the javascript : the generation function is called only once (whatever browser) so this really sounds like an ie issue.
Does anyone have an idea to prevent this behaviour from ie ?
I'm using Express and Node.jx 0.6.7. Server is EC2 Small instance..
For some reason, Node.js is sometimes not receiving my ajax requests (sometimes). Firebug would say "pending..." and the spinning wheel would show.
It would take about 30 seconds before my node.js server actually gets the request. (When I hit it, I console.log, to check).
I've read information that a browser only allows 6 parallel connections. But, in my Firebug, I never have more than 3! In fact, I make sure everything loads, and all my ajax requests loads. After I see that everything has loaded, I "click" to call the AJAX...and it hangs. THis is the only spinning loading wheel. Everything else is loaded...so the simultaneous connections cannot be the problem, right?
The server returns responses very fast--the problem is that it's not receiving the response. Literally, the server does not get the request until like 30 seconds later.
This happens with static images just as well. (basically any request. It's really random)
I'm on Firefox 10 and Chrome (latest stable), and this happens. On Safari, it never happens. It's random and this problem happens in different spots.
Note: this does not happen in my EC2 Micro instance (only on my small instance). They are both the latest versions of Ubuntu.
Screenshot: http://i.imgur.com/X7801.png (as you can see, there is only 1 spinner. Everything else is returned. the Server is NOT under heavy load. it's idle. Yet, the server is not receiving the request)
Note: I am using AWS Load Balancer, but that's not the problem, because I turned that off and it's still happening.
Figured it out.
Cloudflare! I disabled the security crap.