Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install error in Safari - XMLHttpRequest cannot load http://127.0.0.1:38450/install_model due to access control checks #27

Open
fran-sgd opened this issue Nov 29, 2021 · 11 comments

Comments

@fran-sgd
Copy link

I'm getting same error as issue #15, Safari on macos is refusing to allow access to the server, which is running. I cleared the Safari settings for the site and the local server URL to both not do content blocking, but that doesn't seem to matter. I would rather not install Chrome, or any other browser, just to load models, is there an alternative method for getting the models to the server that doesn't use a browser?

The browser console shows this, with the correct local server:

xhr.js:184[blocked] The page at https://coqui.ai/english/coqui/v1.0.0-large-vocab?callback_url=http://127.0.0.1:38450/install_model&name=English%20STT%20v1.0.0-large-vocab&prefer_tflite=1#download was not allowed to display insecure content from http://127.0.0.1:38450/install_model.
xhr.js:184 Not allowed to request resource
xhr.js:184 [Error] XMLHttpRequest cannot load http://127.0.0.1:38450/install_model due to access control checks.
(anonymous function) 
@reuben
Copy link
Contributor

reuben commented Nov 29, 2021

Can you show the details of the request from the network tab? The local server has CORS configured appropriately so Safari should be able to handle it fine.

@reuben reuben changed the title Install error in browser Install error in Safari - XMLHttpRequest cannot load http://127.0.0.1:38450/install_model due to access control checks Nov 29, 2021
@fran-sgd
Copy link
Author

fran-sgd commented Dec 3, 2021

I was away all week, I'll check it tomorrow the next day.

@fran-sgd
Copy link
Author

Sorry, projects eat up too much time. I suspect that there may be a low level problem on my machine, I'll do a clean reinstall and try again.

@fran-sgd
Copy link
Author

I've managed to get back to this. I wiped the hard drive as I suspected some low level system permission problem as a few applications have had odd write access problems that required using the recovery console to attempt to fix. After a reformat I installed Monterey and updated my new system and pulled my apps and data from a backup. I tried running things again and nothing worked at all. I couldn't even get to the above error. I think that the restore mangled things. I'd like to wipe everything and start again from scratch, but I don't see anything about that in the repo or on the website, is there such a document?

@reuben
Copy link
Contributor

reuben commented Jan 16, 2022

@fran-sgd I don't understand your question. If you mean uninstalling the package, pip uninstall coqui-stt-model-manager will do that.

@fran-sgd
Copy link
Author

I could not recall all that I initially installed, so I removed all the libraries that seemed to be related, then started it all over, this time making sure that the content filtering for coqui.ai and 127.0.0.1 were turned off. I tried using the install button on the site and ended up in the same place as the first comment in this thread.

I looked at the Network panel to see where the request you mentioned was, but I have a large number of items showing there. I exported them all and it wrote a 2.6MB file, surely that isn't what you meant? I'll post it here if you like. Your question was "Can you show the details of the request from the network tab? " but do you mean a screenshot or everything or ??

Sorry, I'm just having troubling making a clear mental model of what's going on with the way trained models are installed. I'm evaluating solutions to see what might work for transcribing a large number of audio files. I typically do evaluations by doing the suggested installation, stt in this case, then testing it with the simplest HelloWorld kind of thing. Here, I just want to do the basic test, training my own model is well beyond where I am in evaluation, and the browser has been injected into the process of getting a usable model for simply testing the basic thing. I really don't see the value of debugging browser problems, but I'm happy to do it if it gets me a model I can use to test two minutes of audio. But, frankly, it seems like a locally run shell script or a bit of python could do this all without the massive black box of a browser being involved. It is your project, of course, but this just seems like overkill.

@fran-sgd
Copy link
Author

Finally got back to this after wiping the OS and installing the latest macos & everything else and I'm still getting the same error. I check that Safari isn't doing content blocking on the page provided by the running server on http://127.0.0.1:38450/install_model
Which, incidentally displays "Method Not Allowed" when I visit that URL with the browser.

The Network tab shows collapsable list of network events, so I can't just paste it in here as text. Instead, I cleared everything on Safari's Web Inspector right at the point where I am entering an email address and recorded the attached Network Panel and the general Console Panel as screen shots attached.

network_panel
console_panel

I have the option of exporting the network data as a file named coqui.ai.har which I've attached here with a TXT extension since github doesn't allow it otherwise.
coqui.ai.har.txt

My version of Safari is "Version 15.3 (17612.4.9.1.8)" which is the latest as of a few days ago. I haven't modified the system to block local requests, in fact I do it all the time with no problem, so I'm at a loss as to where the problem might be.

@fran-sgd
Copy link
Author

And, I wondered if this was my machine, so I pulled an 2011 macbook from the closet and updated python, installed the model manager and tried to load a model. I got essentially the same errors and tried changing various privacy settings on and off to no benefit. The one change in the console is this alert before the two errors (as shown above). This version of Safari is three years old, the last version this old machine can install.

The alert text is:

[Warning] [blocked] The page at https://coqui.ai/english/coqui/v1.0.0-large-vocab?callback_url=http://127.0.0.1:38450/install_model&name=English%20STT%20v1.0.0-large-vocab&prefer_tflite=1 was not allowed to display insecure content from http://127.0.0.1:38450/install_model. (component---src-templates-model-card-template-tsx-f778e97848850516bd96.js, line 2)

[Error] Not allowed to request resource
	(anonymous function) (component---src-templates-model-card-template-tsx-f778e97848850516bd96.js:2:158311)
	Promise
	(anonymous function) (component---src-templates-model-card-template-tsx-f778e97848850516bd96.js:2:156485)
	(anonymous function) (component---src-templates-model-card-template-tsx-f778e97848850516bd96.js:2:35578)
	(anonymous function) (component---src-templates-model-card-template-tsx-f778e97848850516bd96.js:2:14290)
	(anonymous function) (component---src-templates-model-card-template-tsx-f778e97848850516bd96.js:2:153242)
	ro (framework-5a12ce98eff3f0abd41c.js:2:95300)
	vu (framework-5a12ce98eff3f0abd41c.js:2:114380)
	(anonymous function) (framework-5a12ce98eff3f0abd41c.js:2:3937)
	(anonymous function) (framework-5a12ce98eff3f0abd41c.js:2:114050)
	U (framework-5a12ce98eff3f0abd41c.js:2:2876)
	(anonymous function) (framework-5a12ce98eff3f0abd41c.js:2:1632)

Otherwise, identical behavior. Does anyone use macos and and can confirm it works on Safari?

@reuben
Copy link
Contributor

reuben commented Feb 19, 2022

A-ha, thanks for sharing the network logs. It seems this has nothing to do with CORS. Rather, it's about mixed-content blocking (accessing http://localhost from https://coqui.ai). WebKit is the only browser that blocks this, and there's an ugly years long thread on their issue tracker: https://bugs.webkit.org/show_bug.cgi?id=171934

I'm afraid there's no easy way for us to workaround it to make the click to install workflow work seamlessly. What we could do is add a manual install option where you copy and paste from the website into the model manager.

@fran-sgd
Copy link
Author

Glad to know it was Safari and not my system. Since I had the old machine sitting there and it had Opera installed, I pasted the URL from Safari into Opera and ran the install. I used the provided link to locate the files at ~/.local/share/coqui/models and copied them to my development machine. I'll try it out as soon as I get a chance to read the docs and look at example code.
Thanks for digging into the WebKit issue. I thought I turned off the "Disable Cross Origin Restrictions" but I suppose it didn't apply in this case. I'll be happy to test out the manual option if needed.

@reuben
Copy link
Contributor

reuben commented Feb 19, 2022

Thanks for the patience and for following up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants