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

Possibly TLS related package installation problem #7202

Closed
3 of 4 tasks
FlotterCodername opened this issue Dec 15, 2022 · 6 comments
Closed
3 of 4 tasks

Possibly TLS related package installation problem #7202

FlotterCodername opened this issue Dec 15, 2022 · 6 comments

Comments

@FlotterCodername
Copy link

FlotterCodername commented Dec 15, 2022

  • 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│
@FlotterCodername FlotterCodername added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Dec 15, 2022
@Joffreybvn
Copy link

Joffreybvn commented Dec 15, 2022

I have this issue too. Poetry is installed via pip in a Docker image for our ci-cd.

  • Python 3.9
  • Poetry 1.3.1 and 1.3.0

Works fine on Python 3.9 with poetry 1.1.14, and 1.2.2.
We have two pypi sources configured in the pyproject.toml.

Some packages do install, but this one failed:

(I will update this post with a -vvv asap)

• Installing wrapt (1.14.1)
  Stack trace:
  2  /opt/app-root/lib64/python3.9/site-packages/poetry/utils/env.py:1536 in _run
       output = subprocess.check_output(
  1  /usr/lib64/python3.9/subprocess.py:424 in check_output
       return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  CalledProcessError
  Command '['/opt/app-root/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/opt/app-root', '--no-deps', '/opt/home/.cache/pypoetry/artifacts/da/58/27/43aa3f76ee698e8977edbadd84ad32ceef2ce8cf05434edf38015b194b/jupyter_contrib_core-0.4.2.tar.gz']' returned non-zero exit status 1.
  at /usr/lib64/python3.9/subprocess.py:528 in run
       524│             # We don't call process.wait() as .__exit__ does that for us.
       525│             raise
       526│         retcode = process.poll()
       527│         if check and retcode:
    →  528│             raise CalledProcessError(retcode, process.args,
       529│                                      output=stdout, stderr=stderr)
       530│     return CompletedProcess(process.args, retcode, stdout, stderr)
       531│ 
       532│ 
The following error occurred when trying to handle this error:
  Stack trace:
  3  /opt/app-root/lib64/python3.9/site-packages/poetry/utils/pip.py:56 in pip_install
       return environment.run_pip(*args)
  2  /opt/app-root/lib64/python3.9/site-packages/poetry/utils/env.py:1497 in run_pip
       return self._run(cmd, **kwargs)
  1  /opt/app-root/lib64/python3.9/site-packages/poetry/utils/env.py:1776 in _run
       return super()._run(cmd, **kwargs)
  EnvCommandError
  Command ['/opt/app-root/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/opt/app-root', '--no-deps', '/opt/home/.cache/pypoetry/artifacts/da/58/27/43aa3f76ee698e8977edbadd84ad32ceef2ce8cf05434edf38015b194b/jupyter_contrib_core-0.4.2.tar.gz'] errored with the following return code 1, and output: 
  Processing /opt/home/.cache/pypoetry/artifacts/da/58/27/43aa3f76ee698e8977edbadd84ad32ceef2ce8cf05434edf38015b194b/jupyter_contrib_core-0.4.2.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 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required'))': /simple/setuptools/
        WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required'))': /simple/setuptools/
        WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required'))': /simple/setuptools/
        WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required'))': /simple/setuptools/
        WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required'))': /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 /opt/app-root/lib64/python3.9/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:
  Stack trace:
  5  /opt/app-root/lib64/python3.9/site-packages/poetry/installation/executor.py:[263](https://git.infrabel.be/business-intelligence/modules/multiface/-/jobs/556760#L263) in _execute_operation
       result = self._do_execute_operation(operation)
  4  /opt/app-root/lib64/python3.9/site-packages/poetry/installation/executor.py:334 in _do_execute_operation
       result: int = getattr(self, f"_execute_{method}")(operation)
  3  /opt/app-root/lib64/python3.9/site-packages/poetry/installation/executor.py:454 in _execute_install
       status_code = self._install(operation)
  2  /opt/app-root/lib64/python3.9/site-packages/poetry/installation/executor.py:496 in _install
       return self.pip_install(archive, upgrade=operation.job_type == "update")
  1  /opt/app-root/lib64/python3.9/site-packages/poetry/installation/executor.py:125 in pip_install
       pip_install(req, self._env, upgrade=upgrade, editable=editable)
  PoetryException
  Failed to install /opt/home/.cache/pypoetry/artifacts/da/58/27/43aa3f76ee698e8977edbadd84ad32ceef2ce8cf05434edf38015b194b/jupyter_contrib_core-0.4.2.tar.gz
  at /opt/app-root/lib64/python3.9/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│ 
  Stack trace:
  2  /opt/app-root/lib64/python3.9/site-packages/poetry/utils/env.py:1536 in _run
       output = subprocess.check_output(
  1  /usr/lib64/python3.9/subprocess.py:424 in check_output
       return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  CalledProcessError
  Command '['/opt/app-root/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/opt/app-root', '--no-deps', '/opt/home/.cache/pypoetry/artifacts/51/5e/3e/e2b50db0e898fb4678727daa33c93ccadbd2e1d2cb825fc90a12d63fd8/lazy-object-proxy-1.8.0.tar.gz']' returned non-zero exit status 1.
  at /usr/lib64/python3.9/subprocess.py:528 in run
       524│             # We don't call process.wait() as .__exit__ does that for us.
       525│             raise
       526│         retcode = process.poll()
       527│         if check and retcode:
    →  528│             raise CalledProcessError(retcode, process.args,
       529│                                      output=stdout, stderr=stderr)
       530│     return CompletedProcess(process.args, retcode, stdout, stderr)
       531│ 
       532│ 
The following error occurred when trying to handle this error:
  Stack trace:
  3  /opt/app-root/lib64/python3.9/site-packages/poetry/utils/pip.py:56 in pip_install
       return environment.run_pip(*args)
  2  /opt/app-root/lib64/python3.9/site-packages/poetry/utils/env.py:1497 in run_pip
       return self._run(cmd, **kwargs)
  1  /opt/app-root/lib64/python3.9/site-packages/poetry/utils/env.py:1776 in _run
       return super()._run(cmd, **kwargs)
  EnvCommandError
  Command ['/opt/app-root/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/opt/app-root', '--no-deps', '/opt/home/.cache/pypoetry/artifacts/51/5e/3e/e2b50db0e898fb4678727daa33c93ccadbd2e1d2cb825fc90a12d63fd8/lazy-object-proxy-1.8.0.tar.gz'] errored with the following return code 1, and output: 
  Processing /opt/home/.cache/pypoetry/artifacts/51/5e/3e/e2b50db0e898fb4678727daa33c93ccadbd2e1d2cb825fc90a12d63fd8/lazy-object-proxy-1.8.0.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 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required'))': /simple/setuptools/
        WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required'))': /simple/setuptools/
        WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required'))': /simple/setuptools/
        WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required'))': /simple/setuptools/
        WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required'))': /simple/setuptools/
        ERROR: Could not find a version that satisfies the requirement setuptools>=30.3.0 (from versions: none)
        ERROR: No matching distribution found for setuptools>=30.3.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 /opt/app-root/lib64/python3.9/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:
  Stack trace:
  5  /opt/app-root/lib64/python3.9/site-packages/poetry/installation/executor.py:263 in _execute_operation
       result = self._do_execute_operation(operation)
  4  /opt/app-root/lib64/python3.9/site-packages/poetry/installation/executor.py:334 in _do_execute_operation
       result: int = getattr(self, f"_execute_{method}")(operation)
  3  /opt/app-root/lib64/python3.9/site-packages/poetry/installation/executor.py:454 in _execute_install
       status_code = self._install(operation)
  2  /opt/app-root/lib64/python3.9/site-packages/poetry/installation/executor.py:496 in _install
       return self.pip_install(archive, upgrade=operation.job_type == "update")
  1  /opt/app-root/lib64/python3.9/site-packages/poetry/installation/executor.py:125 in pip_install
       pip_install(req, self._env, upgrade=upgrade, editable=editable)
  PoetryException
  Failed to install /opt/home/.cache/pypoetry/artifacts/51/5e/3e/e2b50db0e898fb4678727daa33c93ccadbd2e1d2cb825fc90a12d63fd8/lazy-object-proxy-1.8.0.tar.gz
  at /opt/app-root/lib64/python3.9/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│

@radoering
Copy link
Member

possibly a duplicate of #7182

@Joffreybvn
Copy link

Joffreybvn commented Dec 15, 2022

possibly a duplicate of #7182

Indeed, poetry is not using the primary custom pypi, but use the official one instead. Which makes it fail.
The /etc/pip.conf workaround did the job.

Thanks !

@FlotterCodername
Copy link
Author

possibly a duplicate of #7182

Looks likely for our case, too. Will try to reproduce tomorrow with blank proxy settings.
On Mac, the workaround with is done with /Library/Application Support/pip/pip.conf and on Windows>=7 C:\ProgramData\pip\pip.ini.

@neersighted
Copy link
Member

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

@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Dec 15, 2022
@neersighted neersighted removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Dec 15, 2022
Copy link

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 Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants