saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Install Salt from the Salt package repositories here:
https://docs.saltproject.io/salt/install-guide/en/latest/
Apache License 2.0
14.21k stars 5.48k forks source link

[BUG] Unable to install python-freeipa #66689

Open rimskij opened 4 months ago

rimskij commented 4 months ago

Description Cant install python-freeipa (Python Requests library) on minion 3007 https://python-freeipa.readthedocs.io/en/latest/ No problems on 3004-3005 minions Setup

salt-pip install python-freeipa
Collecting python-freeipa
  Using cached python-freeipa-1.0.8.tar.gz (71 kB)
ERROR: Exception:
Traceback (most recent call last):
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 179, in exc_logging_wrapper
    status = run_func(*args)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/relenv/runtime.py", line 638, in wrapper
    return func(self, options, args)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 67, in wrapper
    return func(self, options, args)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 377, in run
    requirement_set = resolver.resolve(
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 95, in resolve
    result = self._result = resolver.resolve(
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 397, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _add_to_criteria
    if not criterion.candidates:
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_vendor/resolvelib/structs.py", line 156, in __bool__
    return bool(self._sequence)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 174, in __bool__
    return any(self)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 162, in <genexpr>
    return (c for c in iterator if id(c) not in self._incompatible_ids)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 53, in _iter_built
    candidate = func()
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 185, in _make_candidate_from_link
    base: Optional[BaseCandidate] = self._make_base_candidate_from_link(
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 231, in _make_base_candidate_from_link
    self._link_candidate_cache[link] = LinkCandidate(
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 303, in __init__
    super().__init__(
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 158, in __init__
    self.dist = self._prepare()
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 235, in _prepare
    dist = self._prepare_distribution()
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 314, in _prepare_distribution
    return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/operations/prepare.py", line 527, in prepare_linked_requirement
    return self._prepare_linked_requirement(req, parallel_builds)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/operations/prepare.py", line 642, in _prepare_linked_requirement
    dist = _get_prepared_distribution(
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/operations/prepare.py", line 72, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/distributions/sdist.py", line 46, in prepare_distribution_metadata
    self._prepare_build_backend(finder)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/distributions/sdist.py", line 77, in _prepare_build_backend
    self.req.build_env = BuildEnvironment()
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/build_env.py", line 87, in __init__
    self._prefixes = OrderedDict(
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/build_env.py", line 88, in <genexpr>
    (name, _Prefix(os.path.join(temp_dir.path, name)))
  File "/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/build_env.py", line 40, in __init__
    scheme = get_scheme("", prefix=path)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/relenv/runtime.py", line 673, in wrapper
    scheme.platlib = TARGET.PATH
  File "<string>", line 4, in __setattr__
dataclasses.FrozenInstanceError: cannot assign to field 'platlib'
sticky-note commented 4 months ago

Faced this issue, Seems to be pip>=24.1 which is broken with salt-pip. It works fine for me with version that come with salt : pip==23.3.2 You can downgrade quickly with:

/opt/saltstack/salt/bin/python3 -m pip install pip==24.0
rimskij commented 4 months ago

Столкнулся с этой проблемой, похоже, что pip>=24.1она сломала с salt-pip. У меня отлично работает версия, которая идет с солью: pip==23.3.2 Вы можете быстро понизить версию с помощью:

/opt/saltstack/salt/bin/python3 -m pip install p

have another problem

salt-pip install python-freeipa
Collecting python-freeipa
  Using cached python-freeipa-1.0.8.tar.gz (71 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      Error in sitecustomize; set PYTHONVERBOSE for traceback:
      AssertionError:
      Fatal Python error: init_import_site: Failed to import the site module
      Python runtime state: initialized
      Traceback (most recent call last):
        File "/opt/saltstack/salt/lib/python3.10/site.py", line 627, in <module>
          main()
        File "/opt/saltstack/salt/lib/python3.10/site.py", line 620, in main
          execsitecustomize()
        File "/opt/saltstack/salt/lib/python3.10/site-packages/relenv/runtime.py", line 969, in wrapper
          import sitecustomize
        File "/tmp/pip-build-env-v48v7u51/site/sitecustomize.py", line 22, in <module>
          assert not path in sys.path
      AssertionError
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel 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.

[notice] A new release of pip is available: 23.3.2 -> 24.1.1
rimskij commented 4 months ago

Столкнулся с этой проблемой, похоже, что pip>=24.1она сломала с salt-pip. У меня отлично работает версия, которая идет с солью: pip==23.3.2 Вы можете быстро понизить версию с помощью:

/opt/saltstack/salt/bin/python3 -m pip install p

have another problem

salt-pip install python-freeipa
Collecting python-freeipa
  Using cached python-freeipa-1.0.8.tar.gz (71 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      Error in sitecustomize; set PYTHONVERBOSE for traceback:
      AssertionError:
      Fatal Python error: init_import_site: Failed to import the site module
      Python runtime state: initialized
      Traceback (most recent call last):
        File "/opt/saltstack/salt/lib/python3.10/site.py", line 627, in <module>
          main()
        File "/opt/saltstack/salt/lib/python3.10/site.py", line 620, in main
          execsitecustomize()
        File "/opt/saltstack/salt/lib/python3.10/site-packages/relenv/runtime.py", line 969, in wrapper
          import sitecustomize
        File "/tmp/pip-build-env-v48v7u51/site/sitecustomize.py", line 22, in <module>
          assert not path in sys.path
      AssertionError
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel 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.

[notice] A new release of pip is available: 23.3.2 -> 24.1.1

so, it's not a problem with with salt-pip, some bug with lib python-freeipa--1.0.8. i`ll try to repack this lib. im Successfully installed python-freeipa-1.0.6 (salt-pip install python-freeipa==1.0.6)

rimskij commented 4 months ago

sticky-note

thank you very much for your help in solving this problem