saltstack / saltstack/salt

[BUG] salt-pip - cannot install python-ldap module

Open
#62,814 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug dependency needs-triage Upstream-Bug
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
Since new packaging way (onedir) is bringing it's own python with salt installation.. salt-pip should be used to install modules so salt can work with them.. One of modules which we're using is python-ldap for authentication against the LDAP and getting tokens for next x-hours.. but in version 3005.x it's not possible to install this module via salt-pip command.

Setup
Nothing specific.. clean installation of salt-master using onedir distribution packages (tested on RedHat 8)

Please be as specific as possible and give set-up details.

  • on-prem machine
  • VM (Virtualbox, KVM, etc. please specify)
  • VM running on a cloud service, please be explicit and add details
  • container (Kubernetes, Docker, containerd, etc. please specify)
  • or a combination, please be explicit
  • jails if it is FreeBSD
  • classic packaging
  • onedir packaging
  • used bootstrap to install

Steps to Reproduce the behavior
Try to install python-ldap module via salt-pip

Expected behavior
Expected is successfull installation of python-ldap module with it's dependencies and full functionality while using salt with authentication against LDAP

Screenshots

[root@tsm2r401 ~]# salt-pip install python-ldap
Collecting python-ldap
  Using cached python-ldap-3.4.3.tar.gz (377 kB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [7 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 0x7f3ae6451a30>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /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 0x7f3ae6451d60>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /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 0x7f3ae6451fd0>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /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 0x7f3ae6078430>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /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 0x7f3ae6078580>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /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
      [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.

[root@tsm2r401 ~]# salt-pip list
Package                   Version
------------------------- -----------
altgraph                  0.17.3
certifi                   2022.5.18.1
cffi                      1.14.6
chardet                   3.0.4
cheroot                   8.5.2
CherryPy                  18.6.1
contextvars               2.4
cryptography              3.3.2
distro                    1.5.0
idna                      2.8
immutables                0.15
importlib-metadata        4.6.4
jaraco.classes            3.2.1
jaraco.collections        3.4.0
jaraco.functools          2.0
jaraco.text               3.5.1
Jinja2                    3.1.0
jmespath                  1.0.1
MarkupSafe                2.0.1
more-itertools            5.0.0
msgpack                   1.0.2
pip                       22.2.2
portend                   2.4
psutil                    5.8.0
pycparser                 2.21
pycryptodomex             3.9.8
pyinstaller               4.10
pyinstaller-hooks-contrib 2022.10
pyOpenSSL                 19.1.0
python-dateutil           2.8.1
python-gnupg              0.4.8
pytz                      2022.1
PyYAML                    5.4.1
pyzmq                     23.2.0
requests                  2.25.1
rpm-vercmp                0.1.2
salt                      3005.1
setproctitle              1.1.10
setuptools                60.6.0
six                       1.16.0
tempora                   4.1.1
tiamat-pip                1.11.0
timelib                   0.2.5
urllib3                   1.26.6
wheel                     0.37.1
zc.lockfile               1.4
zipp                      3.5.0

Versions Report

salt --versions-report
[root@tsm2r401 ~]# salt --versions-report

Salt Version:
          Salt: 3005.1

Dependency Versions:
          cffi: 1.14.6
      cherrypy: unknown
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.0
       libgit2: Not Installed
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.9.8
        pygit2: Not Installed
        Python: 3.9.14 (main, Oct  3 2022, 21:24:00)
  python-gnupg: 0.4.8
        PyYAML: 5.4.1
         PyZMQ: 23.2.0
         smmap: Not Installed
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: rhel 8.6 Ootpa
        locale: utf-8
       machine: x86_64
       release: 4.18.0-372.9.1.el8.x86_64
        system: Linux
       version: Red Hat Enterprise Linux 8.6 Ootpa

Additional context
We have succeeded with installation of some other python modules which we need.. but this one seems to be problem..

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing salt-pip install python-ldap with the Salt 3005.1 onedir package on RHEL 8.6, then inspect the onedir packaging and salt-pip dependency-installation path implicated by the build-isolation error. Done means python-ldap and its dependencies install successfully through salt-pip and can support LDAP authentication.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.