alphagov/gds-pre-commit

SSL errors on install

Closed this issue · 6 comments

reported by @36degrees, who couldn't install:

⏳ Installing pip dependencies.
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pre-commit/
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pre-commit/
  WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pre-commit/
  WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pre-commit/
  WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pre-commit/
  ERROR: Could not find a version that satisfies the requirement pre-commit (from versions: none)
ERROR: No matching distribution found for pre-commit
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.✔️  Detect-secrets hook installed⏳ Registering your installation with GDS Cybersecurity...
You have been registered successfully.✔️  Installation done. Questions to #cyber-security-help. Thanks!

His environment:

➜ python --version
Python 2.7.16~
➜ python3 --version
Python 3.7.4~
➜ which python
/usr/bin/python~
➜ which python3
/usr/local/bin/python3

@36degrees Thanks for reporting this, how did you workaround this? Slack's lost the history and I didn't capture it, apologies.

I haven't, yet – we just uninstalled the hook.

Thanks @36degrees, I've clarified the install procedure, and made it clear what dependencies are needed. Could you, in a quiet moment, try the new instructions here:
https://github.com/alphagov/gds-pre-commit/blob/master/README.md#quick-install

Be prepared to roll back the install if this solution has not fixed the issue. If so, my apologies, but we will try further fixes 💪

Pretty much the same, except of course now the pip install isn't part of the script the lack of error handling isn't as much of an issue (assuming I didn't just carry on to step 2)

$ pip3 install -q pre-commit detect-secrets six
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pre-commit/
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pre-commit/
  WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pre-commit/
  WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pre-commit/
  WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pre-commit/
  ERROR: Could not find a version that satisfies the requirement pre-commit (from versions: none)
ERROR: No matching distribution found for pre-commit
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

@36degrees thanks for the update, I think your brew installed python is broken (if you're on mac).
Try the instructions here: https://stackoverflow.com/a/60057102/333294

closing due to the new scope of this project (see readme)