question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possibly TLS related package installation problem

See original GitHub issue
  • Poetry version: 1.3.1
  • Python version: 3.8.5 (AMD64)
  • OS version and name: Windows 10 21H2
  • pyproject.toml: gist
  • 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

Some of my colleagues are reporting a package installation issue that happens with 1.3.1 but not with 1.2.2. These users have installed poetry via pip. Personally, I have not been able to reproduce this, but will keep trying and also provide a -vvv output. PyPI in use are two different Artifactory PyPIs. The certificate PEM is in the root of the repository. Our poetry.toml:

[certificates]
pypi-remote.cert = "corporation.pem"
pypi-virtual.cert = "corporation.pem"

[experimental]
new-installer = false

[virtualenvs]
create = true
in-project = true

Package installation output:

Updating dependencies
Resolving dependencies...
 
Writing lock file
 
Package operations: 177 installs, 0 updates, 0 removals
 
  • Installing atomicwrites (1.4.1)
  • Installing attrs (22.1.0)
  • Installing colorama (0.4.6)
  • Installing iniconfig (1.1.1)
  • Installing packaging (22.0)
  • Installing pluggy (0.13.1)
  • Installing py (1.11.0)
  • Installing toml (0.10.2)
 
  CalledProcessError
 
  Command 'C:\Users\USERNAME\PycharmProjects\my_project\.venv\Scripts\python.exe -m pip install --use-pep517 --disable-pip-version-check --isolated --no-input --prefix C:\Users\USERNAME\PycharmProjects\my_project\.venv --no-deps C:\Users\USERNAME\AppData\Local\pypoetry\Cache\artifacts\ef\b7\5a\7aa4aac785d953cbaca8a55c7f3a9632f9127335b4569de7bb6f5135e0\atomicwrites-1.4.1.tar.gz' returned non-zero exit status 1.
 
  at c:\python385\lib\subprocess.py:512 in run
       508|             # We don't call process.wait() as .__exit__ does that for us.
       509|             raise
       510|         retcode = process.poll()
       511|         if check and retcode:
    >  512|             raise CalledProcessError(retcode, process.args,
       513|                                      output=stdout, stderr=stderr)
       514|     return CompletedProcess(process.args, retcode, stdout, stderr)
       515| 
       516|
 
The following error occurred when trying to handle this error:
 

  EnvCommandError
 
  Command C:\Users\USERNAME\PycharmProjects\my_project\.venv\Scripts\python.exe -m pip install --use-pep517 --disable-pip-version-check --isolated --no-input --prefix C:\Users\USERNAME\PycharmProjects\my_project\.venv --no-deps C:\Users\USERNAME\AppData\Local\pypoetry\Cache\artifacts\ef\b7\5a\7aa4aac785d953cbaca8a55c7f3a9632f9127335b4569de7bb6f5135e0\atomicwrites-1.4.1.tar.gz errored with the following return code 1, and output: 
  Processing c:\users\USERNAME\appdata\local\pypoetry\cache\artifacts\ef\b7\5a\7aa4aac785d953cbaca8a55c7f3a9632f9127335b4569de7bb6f5135e0\atomicwrites-1.4.1.tar.gz
    Installing build dependencies: started
    Installing build dependencies: finished with status 'error'
    error: subprocess-exited-with-error
    pip subprocess to install build dependencies did not run successfully.
    exit code: 1
    [8 lines of output]
    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000288D4594430>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/setuptools/
    WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000288D4594F70>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/setuptools/
    WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000288D45A63D0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/setuptools/
    WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000288D45A6580>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/setuptools/
    WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000288D45A6730>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/setuptools/
    ERROR: Could not find a version that satisfies the requirement setuptools>=40.8.0 (from versions: none)
    ERROR: No matching distribution found for setuptools>=40.8.0
    WARNING: There was an error checking the latest version of pip.
    [end of output]
    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: subprocess-exited-with-error
  pip subprocess to install build dependencies did not run successfully.
  exit code: 1
  See above for output.
  note: This error originates from a subprocess, and is likely not a problem with pip.
 
  at c:\python385\lib\site-packages\poetry\utils\env.py:1540 in _run
      1536|                 output = subprocess.check_output(
      1537|                     command, stderr=subprocess.STDOUT, env=env, **kwargs
      1538|                 )
      1539|         except CalledProcessError as e:
    > 1540|             raise EnvCommandError(e, input=input_)
      1541| 
      1542|         return decode(output)
      1543| 
      1544|     def execute(self, bin: str, *args: str, **kwargs: Any) -> int:
 
The following error occurred when trying to handle this error:
 

  PoetryException
 
  Failed to install C:/Users/USERNAME/AppData/Local/pypoetry/Cache/artifacts/ef/b7/5a/7aa4aac785d953cbaca8a55c7f3a9632f9127335b4569de7bb6f5135e0/atomicwrites-1.4.1.tar.gz
 
  at c:\python385\lib\site-packages\poetry\utils\pip.py:58 in pip_install
       54| 
       55|     try:
       56|         return environment.run_pip(*args)
       57|     except EnvCommandError as e:
    >  58|         raise PoetryException(f"Failed to install {path.as_posix()}") from e
       59|

I believe this is TLS related – when I generated the lockfile for the colleague and asked them to install it, the error below came up. I asked them if they were in the root of the project directory, but then realized they were using the PyCharm GUI, so it should definitely be running there.

OSError

  Could not find a suitable TLS CA certificate bundle, invalid path: corporation.pem

  at c:\python385\lib\site-packages\requests\adapters.py:227 in cert_verify
      223│             if not cert_loc:
      224│                 cert_loc = extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH)
      225│
      226│             if not cert_loc or not os.path.exists(cert_loc):
    → 227│                 raise IOError("Could not find a suitable TLS CA certificate bundle, "
      228│                               "invalid path: {}".format(cert_loc))
      229│
      230│             conn.cert_reqs = 'CERT_REQUIRED'
      226│             if not cert_loc or not os.path.exists(cert_loc):
    → 227│                 raise IOError("Could not find a suitable TLS CA certificate bundle, "
      228│                               "invalid path: {}".format(cert_loc))
      229│
      230│             conn.cert_reqs = 'CERT_REQUIRED'
      231│

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
radoeringcommented, Dec 15, 2022

possibly a duplicate of #7182

1reaction
neersightedcommented, Dec 15, 2022

Closing as duplicate, I think we should update the release announcement/blogpost with a heads up/explanation. Thanks for the list of paths @FlotterCodername.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SSL/TLS communication problems after you install KB 931125
This article provides a solution to SSL/TLS communication problems that occur after you install KB 931125. Applies to: Windows Server 2008 ...
Read more >
Rehash: How to Fix the SSL/TLS Handshake Failed Error
The TLS Handshake Failed error can originate from the client or the server, here's a guide for fixing the problem for both users...
Read more >
Nuget not working again - Could not create SSL/TLS secure ...
I am using Visual Studio Professional 2017 Version 15.9.24 on a Windows 7 machine. I can't download any packages from nuget. This message...
Read more >
Not able to install Python packages [SSL - Stack Overflow
1 · Possible duplicate of Unable to install python libraries · Make sure you have the correct openssl version. · make sure you...
Read more >
TLS/SSL Handshake Failures | Apigee Edge
A TLS/SSL handshake failure occurs when a client and server cannot establish communication using the TLS/SSL protocol. When this error occurs in Apigee...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found