widgetti / solara

A Pure Python, React-style Framework for Scaling Your Jupyter and Web Apps
https://solara.dev
MIT License
1.62k stars 105 forks source link

detect blocked CDN and suggest solara-assets and document this #75

Open maartenbreddels opened 1 year ago

maartenbreddels commented 1 year ago

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]".

joaompinto commented 1 year ago

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/font-awesome@4.5.0/css/font-awesome.min.css](mailto:/npm/font-awesome@4.5.0/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

maartenbreddels commented 1 year ago

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

There shouldn't be any more configuration.

joaompinto commented 1 year ago

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

joaompinto commented 1 year ago

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

maartenbreddels commented 1 year ago

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

joaompinto commented 1 year ago

@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 .

maartenbreddels commented 1 year ago

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 commented 11 months ago

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!

joaompinto commented 11 months ago

@maartenbreddels perfect. Thanks a lot.

cyrfar commented 7 months ago

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/mermaid@9.1.7/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!