Skip to content

Improve SSL error message to instruct the user what to do #8473

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

Open
uranusjr opened this issue Jun 20, 2020 · 10 comments
Open

Improve SSL error message to instruct the user what to do #8473

uranusjr opened this issue Jun 20, 2020 · 10 comments
Labels
C: error messages Improving error messages type: enhancement Improvements to functionality UX User experience related

Comments

@uranusjr
Copy link
Member

uranusjr commented Jun 20, 2020

What's the problem this feature will solve?
I’ve seen quite a few issues on the tracker on the same error message:

WARNING: pip is configured with locations that require TLS/SSL,
however the ssl module in Python is not available.

They all have the same root cause: The ssl built-in module is not available, and pip cannot access HTTPS URLs without it. The warning is however not easy to understand for less experienced users, and they tend to report this as an issue (pypa/virtualenv#1139, #8171, #8472 to list a few. It is, however, a system configuration problem that pip cannot fix.

Describe the solution you'd like
Revise the error message to clearly say

  1. This is not a pip bug.
  2. Propose the solution to the most likely causes
    a. If the user is using a self-compiled Python, it needs to be recompiled.
    b. If the user is using pyenv, the system is missing build dependencies. This wiki page lists instructions on common platforms.
    c. If the Python is installed by Anaconda or a package manager (e.g. Homebrew), this is likely a runtime configuration issue.
  3. Point to a documentation page that discusses the issue in detail, and provide more generic solutions if none of the specific instructions fit the user’s scenario.
  4. Instruct the user to ask for help on pypa/packaging-problems.

Alternative Solutions
Do nothing, and continue marking the issues as duplicates. They are not that common, so the overhead isn’t that bad. Maybe it’s possible to have a bot responding to them as well.

Additional context
Some popular destinations if you search the issue description on the Internet. They list quite a few popular causes to this that can be helpful:

  • StackOverflow (has diagnoses for Anaconda on Windows, Homebrew on macOS, and generic compiled-from-source scenarios)
  • AskUbuntu (i.e. similar to the SO one, but Ubuntu-specific)
  • Unix/Linux (describing a compiled-from-source scenario)
@ghost ghost added the S: needs triage Issues/PRs that need to be triaged label Jun 20, 2020
@uranusjr uranusjr added UX User experience related type: enhancement Improvements to functionality labels Jun 20, 2020
@ghost ghost removed the S: needs triage Issues/PRs that need to be triaged label Jun 20, 2020
@pfmoore
Copy link
Member

pfmoore commented Jun 20, 2020

Maybe also suggest downloading all needed packages by other means and using a local wheelhouse via --find-links? Or is this too much detail? (It's hard to cover dependencies like this, so we risk getting people confused by the fact that they downloaded what they thought they needed and they still got errors...)

Note that checking for the SSL module and failing early isn't really an option as pip install local_file doesn't need it, and we need that to still work. (Adding this note because my initial thought was exactly "hey, let's check and fail early" 🙂)

@uranusjr
Copy link
Member Author

Note that checking for the SSL module and failing early isn't really an option as pip install local_file doesn't need it, and we need that to still work.

I went through exactly this before filing this 😆

The --find-links suggestion is probably too niche to be included in the error message, but IMO it’d fit well in documentation. Maybe there really should be a dedicated section on “common pip patterns” that discusses various strategies and techniques, like how --find-links can be used to maintain an in-house package repository, and how pip wheel can help building it in cases, especially when it might be unnecessary or even undesired to compile the Python with SSL in some edge cases (e.g. in a Docker container?) But that’s likely a big enough issue to tackle as a (say) GSoc or even funded project, so I’d say let’s not include that (for now) to keep things simple.

@pfmoore
Copy link
Member

pfmoore commented Jun 20, 2020

Agreed. It's borederline related to the existing funded UX work (the suggested message here is very similar to where we've ended up with the ResolutionImpossible error for the new resolver) so maybe an "error messages style guide" would be reasonable to look at from that work?

@uranusjr
Copy link
Member Author

The current UX work is an important source of inspiration to the suggestion 😆

@uranusjr
Copy link
Member Author

Adding #8487 to the list of confused users.

@pradyunsg pradyunsg added this to the Print Better Error Messages milestone Jun 25, 2020
@nlhkabu nlhkabu added C: error messages Improving error messages UX: functionality research epic Temporary label to link tickets to #8516 labels Jul 28, 2020
@nlhkabu nlhkabu removed this from the Print Better Error Messages milestone Jul 29, 2020
@nlhkabu nlhkabu removed the UX: functionality research epic Temporary label to link tickets to #8516 label Jul 29, 2020
@McSinyx
Copy link
Contributor

McSinyx commented Jul 29, 2020

Also see pypa/setuptools#2289.

@beesuns
Copy link

beesuns commented Nov 23, 2020

Still do not know how to solve this problem :(

@pfmoore
Copy link
Member

pfmoore commented Nov 23, 2020

@beesuns Upgrade your Python installation to include ssl support. Unfortunately, we can't tell you how to do that, it depends on how you installed Python, and possibly how your distribution packages Python.

@zhuofeng6

This comment was marked as off-topic.

@zhuofeng6

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: error messages Improving error messages type: enhancement Improvements to functionality UX User experience related
Projects
Status: Task Bucket
Development

No branches or pull requests

7 participants