Skip to content
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

Could not find a suitable TLS CA certificate bundle, when installing dependencies #6626

Closed
3 of 4 tasks
whs opened this issue Sep 26, 2022 · 2 comments
Closed
3 of 4 tasks
Labels
status/invalid Invalid issue or PR

Comments

@whs
Copy link

whs commented Sep 26, 2022

  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

Using the Dockerfile and pyproject.toml from the gist, I'm able to replicate #5977

  OSError

  Could not find a suitable TLS CA certificate bundle, invalid path: /usr/local/lib/python3.9/dist-packages/certifi/cacert.pem

  at /usr/local/lib/python3.9/dist-packages/requests/adapters.py:263 in cert_verify
      259│             if not cert_loc:
      260│                 cert_loc = extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH)
      261│ 
      262│             if not cert_loc or not os.path.exists(cert_loc):
    → 263│                 raise OSError(
      264│                     f"Could not find a suitable TLS CA certificate bundle, "
      265│                     f"invalid path: {cert_loc}"
      266│                 )
      267│ 

I've tested these variants:

  • The same case does work normally with python:3.10 (python@sha256:e9c35537103a2801a30b15a77d4a56b35532c964489b125ec1ff24f3d5b53409) image
  • In some case I can get it to break without installing requests, but I'm unable to produce a public test case
  • It reproduce on both bullseye (debian@sha256:3e82b1af33607aebaeb3641b75d6e80fd28d36e17993ef13708e9493e30e8ff9) and bullseye-slim (debian@sha256:5cf1d98cd0805951484f33b34c1ab25aac7007bb41c8b9901d97e4be3cf3ab04)
@whs whs added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 26, 2022
@neersighted neersighted added status/invalid Invalid issue or PR and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 26, 2022
@neersighted
Copy link
Member

neersighted commented Sep 26, 2022

This is not a valid reproduction -- you have installed Poetry into the system packages directory and then installed your own project into it. You are running into Poetry shifting certifi underneath itself while it is still running and removing the SSL CA bundle out from under itself. This creates a race and the next package cannot be retrieved due to not having a CA bundle.

To prevent this, please use a recommended method (as suggested in the docs/issue template) -- we cannot provide support for this unsupported configuration of Poetry, as there is simply no way to prevent Poetry from changing its own dependencies when sharing an environment with your project.

Also, please consider #6398 -- there is no good reason in 95% of circumstances to avoid a virtual environment in a container, and you expose yourself to all sorts of fun sharp edges if you choose not to use them. They serve as a barrier against decisions and contamination from your Python packager/distro as well as other projects (like Poetry itself).

@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Sep 26, 2022
Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/invalid Invalid issue or PR
Projects
None yet
Development

No branches or pull requests

2 participants