sukeesh / Jarvis

Personal Assistant for Linux and macOS
MIT License
2.97k stars 1.03k forks source link

MacOS Installer hangs infinitely on SSL certs failure #1058

Open dlwrnc opened 1 year ago

dlwrnc commented 1 year ago

Issue seen on MacOS Monterey, Python 3.11.

Behavior is that when running the "python installer" command, the installer will hang infinitely during the wordnet install.

example:

x@x-Macbook-Pro Jarvis % python3 installer
Logging to /var/folders/xz/w79ssb3j0yn_6gpm6ht_h0s40000gn/T/tmpy8crjzwm

============== Preparing virtualenv ==============

============ Installing requirements =============

==== Downloading additional data (Dictionary) ====
* wordnet
/^C

what is happening under the hood here is the following:

x@x-MacBook-Pro Jarvis % python3 -m nltk.downloader -d jarviscli/data/nltk {{}}
<frozen runpy>:128: RuntimeWarning: 'nltk.downloader' found in sys.modules after import of package 'nltk', but prior to execution of 'nltk.downloader'; this may result in unpredictable behaviour
[nltk_data] Error loading {{}}: <urlopen error [SSL:
[nltk_data]     CERTIFICATE_VERIFY_FAILED] certificate verify failed:
[nltk_data]     unable to get local issuer certificate (_ssl.c:992)>
Error installing package. Retry? [n/y/e]
y

Because the console is waiting on the n/y/e response, and it's not being pushed up to the installer page, it hangs forever.

While the ideal behavior is certainly for the user to have certs already installed, I think bubbling up the error message to the user would be more helpful than the infinite hang that we're currently seeing.

The ideal solution (in my mind) is to modify the installer helper to report hangs and print out all shell output. however, given that the base shell method is used across a bunch of files/OSs/python versions, it would require quite a bit of validation. A temporary solution that I'd like to propose is adding checking for SSL certs before doing the nltk installs, and reporting to the user that they may experience this behavior if no certs are detected. There's also a third solution, which is to ignore certificates altogether when running the install process. I would not recommend this.

anshulshah99 commented 1 year ago

I am experiencing this issue. How can I download the required SSL certs so that I can get past this issue?

dlwrnc commented 1 year ago

I am experiencing this issue. How can I download the required SSL certs so that I can get past this issue?

This page has instructions on different commands you can run on different OS' to resolve the issue: https://stackoverflow.com/questions/41691327/ssl-sslerror-ssl-certificate-verify-failed-certificate-verify-failed-ssl-c#41692664

Celiian commented 8 months ago

Any news in the issue ?