borg icon indicating copy to clipboard operation
borg copied to clipboard

vagrant: macos1012 box has issues with pip 24.2

Open ThomasWaldmann opened this issue 1 year ago • 4 comments

    macos1012:   ? pip subprocess to install build dependencies did not run successfully.
    macos1012:   ? exit code: 2
    macos1012:   ??> [109 lines of output]
    macos1012:       ERROR: Exception:
    macos1012:       Traceback (most recent call last):
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 105, in _run_wrapper
    macos1012:           status = _inner_run()
    macos1012:                    ^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 96, in _inner_run
    macos1012:           return self.run(options, args)
    macos1012:                  ^^^^^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_internal/cli/req_command.py", line 67, in wrapper
    macos1012:           return func(self, options, args)
    macos1012:                  ^^^^^^^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_internal/commands/install.py", line 379, in run
    macos1012:           requirement_set = resolver.resolve(
    macos1012:                             ^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 95, in resolve
    macos1012:           result = self._result = resolver.resolve(
    macos1012:                                   ^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
    macos1012:           state = resolution.resolve(requirements, max_rounds=max_rounds)
    macos1012:                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers.py", line 397, in resolve
    macos1012:           self._add_to_criteria(self.state.criteria, r, parent=None)
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _add_to_criteria
    macos1012:           if not criterion.candidates:
    macos1012:                  ^^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_vendor/resolvelib/structs.py", line 156, in __bool__
    macos1012:           return bool(self._sequence)
    macos1012:                  ^^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 174, in __bool__
    macos1012:           return any(self)
    macos1012:                  ^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 162, in <genexpr>
    macos1012:           return (c for c in iterator if id(c) not in self._incompatible_ids)
    macos1012:                              ^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 49, in _iter_built
    macos1012:           for version, func in infos:
    macos1012:                                ^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 301, in iter_index_candidate_infos

    macos1012:           result = self._finder.find_best_candidate(
    macos1012:                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_internal/index/package_finder.py", line 883, in find_best_candidate
    macos1012:           candidates = self.find_all_candidates(project_name)
    macos1012:                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_internal/index/package_finder.py", line 824, in find_all_candidates
    macos1012:           page_candidates = list(page_candidates_it)
    macos1012:                             ^^^^^^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_internal/index/sources.py", line 194, in page_candidates
    macos1012:           yield from self._candidates_from_page(self._link)
    macos1012:                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_internal/index/package_finder.py", line 784, in process_project_url
    macos1012:           index_response = self._link_collector.fetch_response(project_url)
    macos1012:                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_internal/index/collector.py", line 448, in fetch_response
    macos1012:           return _get_index_content(location, session=self.session)
    macos1012:                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_internal/index/collector.py", line 352, in _get_index_content
    macos1012:           resp = _get_simple_response(url, session=session)
    macos1012:                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_internal/index/collector.py", line 131, in _get_simple_response
    macos1012:           resp = session.get(
    macos1012:                  ^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_vendor/requests/sessions.py", line 602, in get
    macos1012:           return self.request("GET", url, **kwargs)
    macos1012:                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_internal/network/session.py", line 522, in request
    macos1012:           return super().request(method, url, *args, **kwargs)
    macos1012:                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_vendor/requests/sessions.py", line 589, in request
    macos1012:           resp = self.send(prep, **send_kwargs)
    macos1012:                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_vendor/requests/sessions.py", line 703, in send
    macos1012:           r = adapter.send(request, **kwargs)
    macos1012:               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_vendor/cachecontrol/adapter.py", line 76, in send
    macos1012:           resp = super().send(request, stream, timeout, verify, cert, proxies)
    macos1012:                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_vendor/requests/adapters.py", line 667, in send
    macos1012:           resp = conn.urlopen(
    macos1012:                  ^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_vendor/urllib3/connectionpool.py", 

    macos1012:           httplib_response = self._make_request(
    macos1012:                              ^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_vendor/urllib3/connectionpool.py", line 404, in _make_request
    macos1012:           self._validate_conn(conn)
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_vendor/urllib3/connectionpool.py", line 1058, in _validate_conn
    macos1012:           conn.connect()
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_vendor/urllib3/connection.py", line 419, in connect
    macos1012:           self.sock = ssl_wrap_socket(
    macos1012:                       ^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_vendor/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
    macos1012:           ssl_sock = _ssl_wrap_socket_impl(
    macos1012:                      ^^^^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_vendor/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
    macos1012:           return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
    macos1012:                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_vendor/truststore/_api.py", line 105, in wrap_socket
    macos1012:           _verify_peercerts(ssl_sock, server_hostname=server_hostname)
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_vendor/truststore/_api.py", line 311, in _verify_peercerts
    macos1012:           _verify_peercerts_impl(
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/envs/borg-env/lib/python3.12/site-packages/pip/_vendor/truststore/_macos.py", line 435, in _verify_peercerts_impl
    macos1012:           sec_trust_eval_result = Security.SecTrustEvaluateWithError(
    macos1012:                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ctypes/__init__.py", line 392, in __getattr__
    macos1012:           func = self.__getitem__(name)
    macos1012:                  ^^^^^^^^^^^^^^^^^^^^^^
    macos1012:         File "/Users/vagrant/.pyenv/versions/3.12.6/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ctypes/__init__.py", line 397, in __getitem__
    macos1012:           func = self._FuncPtr((name_or_ordinal, self))
    macos1012:                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    macos1012:       AttributeError: dlsym(0x7f8224f425f0, SecTrustEvaluateWithError): symbol not found
    macos1012:       [end of output]
    macos1012: 
    macos1012:   note: This error originates from a subprocess, and is likely not a problem with pip.
    macos1012: WARNING: There was an error checking the latest version of pip.
    macos1012: error: subprocess-exited-with-error

ThomasWaldmann avatar Sep 25 '24 18:09 ThomasWaldmann

pip 24.2 is broken, pip 24.1 works.

ThomasWaldmann avatar Sep 26 '24 15:09 ThomasWaldmann

Need to fix requirements files to "pip == 24.1" for now.

ThomasWaldmann avatar Sep 26 '24 15:09 ThomasWaldmann

https://github.com/pypa/pip/issues/12901#issuecomment-2382233917

https://github.com/sethmlarson/truststore/pull/157

ThomasWaldmann avatar Sep 30 '24 14:09 ThomasWaldmann

Looks like this is more effort that just pinning pip: something upgrades pip in our CI, not sure what exactly it is, but we have the pip 24.2 crash even with pip pinned in requirements.d/*.

ThomasWaldmann avatar Oct 02 '24 15:10 ThomasWaldmann

Looks like the issue will be fixed in pip 24.3 soon.

https://github.com/pypa/pip/tags

https://pypi.org/project/pip/

Hopefully that will also get into next CPython releases. The box must currently use an old 3.12.4, because .5 .6 .7 are all bundling the broken pip release.

ThomasWaldmann avatar Oct 26 '24 23:10 ThomasWaldmann