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.19k stars 5.48k forks source link

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

Open naqoyqatsi83 opened 2 years ago

naqoyqatsi83 commented 2 years ago

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.

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..

welcome[bot] commented 2 years ago

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey. Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. If you have additional questions, email us at saltproject@vmware.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!

OrangeDog commented 2 years ago

[Errno 101] Network is unreachable

Is this machine able to access the Internet?

OrangeDog commented 2 years ago

Note that you're also going to need all the build prerequisites as there are no wheels provided.

naqoyqatsi83 commented 2 years ago

[Errno 101] Network is unreachable

Is this machine able to access the Internet?

Yes.. it is behind proxy.. on purpose I've skipped part of command line showing IP address of proxy.. (yes.. I could also replace it with some dummy variable).

We have also checked logs on proxy and we don't see any attempts for download of something what is not allowed.

OrangeDog commented 2 years ago

How is the proxy configured? Possibly that is not propagating to the pip sub-processes correctly.

OrangeDog commented 2 years ago

This might be due to https://github.com/pypa/pip/issues/7805.

naqoyqatsi83 commented 2 years ago

How is the proxy configured? Possibly that is not propagating to the pip sub-processes correctly. I've used command line argument to parse proxy setting to salt-pip with other modules I had no issues.. but build process might be different in their cases

This might be due to pypa/pip#7805. Yep.. you hit a nail.. I've used pip config set global.proxy http://{host}:{port} and suddenly everything works as intended.. compilation and installation of module is done.

Thanks! .. I was completely unaware of this bug of pip