What Can Cause Chrome To Give An Net::err_failed On Cached Content Against A Server On Localhost?
Solution 1:
I run into similar problem. I have copied request as fetch in Network tab in devtools.
Then I have run it in browser dev console. There I could read description of the error about CORS. After setting cors on the api server, it worked.
You have to paste the fetch command into the dev console of the same origin and NOT accidentally e.g. open it from stackoverflow.
Solution 2:
Another cause is, when you use withCredentials: true
(sending cross origin cookies) for XHR calls, you are not allowed to set Access-Control-Allow-Origin: *
, but have to provide a specific domain!
Sadly, you cannot use a list of domains here, because no browser supports this official standard. But several frameworks, like Spring, allow you to set a whitelist configuration, which then is matched on request.
See also:
Solution 3:
One very important and un-loved comment in this set of answers is, "Look at your CORS headers." I had a problem much like this, and it gave me this error with some prodding. No data in my Apache logs, but I noticed that we were calling a secondary URL and getting no response for that secondary URL.
Chrome didn't initially call it a CORS issue, but lack of response caused me to dig into our Apache settings and change the allowable CORS source header.
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
Header set Access-Control-Allow-Origin "https://our-site.com"
Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"
</Directory>
This answer may not apply to YOUR situation, but it applied to my net::ERR_FAILED
Solution 4:
There is only one way to get to the bottom of these types of error
In chrome use chrome://net-export/ in a tab, then record the session in another and debug with https://netlog-viewer.appspot.com/#import which allows you to view the output in a more readable format.
We recently found an ERR_FAILED down to the socket being closed because of a proxy authentication issue on the clients network.
This can also be useful reference once you've got the error code from the above chrome://network-errors/
Solution 5:
One possible reason is that you write your AppCache Manifest wrong. For example: in you /a/b/cache.html file you refer the cache.appcache Manifest file, but in cache.appcache file you announce like:
CACHE:
/cache.html
which is wrong.
you should write:
CACHE:
/a/b/cache.html
hope this can help you.
Post a Comment for "What Can Cause Chrome To Give An Net::err_failed On Cached Content Against A Server On Localhost?"