solara icon indicating copy to clipboard operation
solara copied to clipboard

detect blocked CDN and suggest solara-assets and document this

Open maartenbreddels opened this issue 2 years ago • 10 comments

A client ran solara, but the firewall blocked access to the CDN. We should detect this, suggest fixing this by giving a link to the docs (that we need to write) and by suggesting running pip install "solara[assets]".

maartenbreddels avatar May 03 '23 12:05 maartenbreddels

Hi, I tested this in a corporate network, despite installing solara[assets] I still get the CDN connection attempt:

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='[cdn.jsdelivr.net](http://cdn.jsdelivr.net/)', port=443): Max retries exceeded with url: [/npm/[email protected]/css/font-awesome.min.css](mailto:/npm/[email protected]/css/font-awesome.min.css) (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f086db69ed0>: Failed to establish a new connection: [Errno 101] Network is unreachable')) Is there additional configuration required to use the assets package ?

Thanks

joaompinto avatar May 12 '23 16:05 joaompinto

Do you get more errors than this, or is it just font awesome?

There shouldn't be any more configuration.

maartenbreddels avatar May 12 '23 20:05 maartenbreddels

I get more errors for different resources, I will try to gather a complete log.

joaompinto avatar May 13 '23 06:05 joaompinto

Hi, I have attached all the errors I got while testing the quickstart example. error.txt

joaompinto avatar May 18 '23 16:05 joaompinto

Thank you.

I only see mermaid, and not fontawesome anymore, Can you confirm that fontawesome is not a problem anymore? And is solara working despite these errors?

Regards,

Maarten

maartenbreddels avatar May 18 '23 16:05 maartenbreddels

@maartenbreddels yes, I can confirm it is working despite the errors, and btw, I have used --dev as the method to disable the telemetry.

A document on the use it on an airgapped environment should probably refer both the assets package requirement, and the need to disable SOLARA_TELEMETRY_MIXPANEL_ENABLE .

joaompinto avatar May 18 '23 16:05 joaompinto

Yes, it might be good to have an explicit page on this. Actually, now that I think of it, I don't think we describe on our documentation page that solara-assets exists right? How did you find out? Would you willing to contribute to the documentation on this? Maybe a howto xx-airgapped-installs.md orso? I don't think disabling telemetry is a must right, since it would just fail. Or does it clutter the logs?

maartenbreddels avatar May 18 '23 16:05 maartenbreddels

See also https://github.com/widgetti/solara/discussions/116 I've added docs on this in https://github.com/widgetti/solara/commit/9496712ec5510ad74564bb1808c1b96e6cb7fd10 Feel free to improve it!

maartenbreddels avatar May 25 '23 14:05 maartenbreddels

@maartenbreddels perfect. Thanks a lot.

joaompinto avatar May 27 '23 05:05 joaompinto

Hi, I have installed solara using pip install solara[assets] inside a proxied environment (linux) and I am able to deploy and use my app without issues. However, I still see these mermaid error messages in the logs:

requests.exceptions.ProxyError: HTTPSConnectionPool(host='cdn.jsdelivr.net', port=443): Max retries exceeded with url: /npm/[email protected]/dist/mermaid.min.js (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden')))

They seem to be triggered randomly or after some time interval (a few times per day). Any idea as to why and if they can be removed to avoid log pollution?

Thanks!

cyrfar avatar Oct 13 '23 15:10 cyrfar