salt: [BUG] mysqlclient installation (via salt-pip) fails on 3006.6
Description Trying to install mysqlclient into 3006.6 relenv fails:
salt-pip install mysqlclient
Downloading mysqlclient-2.2.1.tar.gz (89 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.0/90.0 kB 7.4 MB/s eta 0:00:00
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
╰─> [20 lines of output]
Error in sitecustomize; set PYTHONVERBOSE for traceback:
TypeError: expected str, bytes or os.PathLike object, not NoneType
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 617, in <module>
main()
File "/opt/saltstack/salt/lib/python3.10/site.py", line 610, in main
execsitecustomize()
File "/opt/saltstack/salt/lib/python3.10/site-packages/relenv/runtime.py", line 932, in wrapper
import sitecustomize
File "/tmp/pip-build-env-8sua0kqf/site/sitecustomize.py", line 23, in <module>
site.addsitedir(path)
File "/opt/saltstack/salt/lib/python3.10/site.py", line 216, in addsitedir
sitedir, sitedircase = makepath(sitedir)
File "/opt/saltstack/salt/lib/python3.10/site.py", line 97, in makepath
dir = os.path.join(*paths)
File "/opt/saltstack/salt/lib/python3.10/posixpath.py", line 76, in join
a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
[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.
No problems on 3006.5
Setup AlmaLinux 8.9, salt-minion 3006.6 installed via bootstrap.saltstack.com
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 21 (8 by maintainers)
Confirming this still occurs in 3006.7 per milestone set above.
I think I finally found the underlying issue and have opened an issue in the relenv project: saltstack/relenv#182
There, I also provide an alternative workaround.
What about the released 3007.1 or the upcoming 3007.2 (?) ?
@nf-brentsaner, @timwsuqld, @DaAwesomeP , @max-arnold , @lburinov73 : Please see my (long) comment https://github.com/saltstack/salt/issues/65980#issuecomment-2084721288 for a possible long-term fix.
The TLDR is a
patchof/usr/bin/salt-pipand/opt/saltstack/salt/salt-pipis needed to change$0in theexecline (which returns the full path to the file) to-m pip(after which the command matches the workaround you all used).It would be good if some of the Developers would implement this in the code though …
EDIT 1: For completeness, here is the
salt --versions-reportto show the Versions ofsaltand its Dependencies that I am using:I can confirm the issue and that
/opt/saltstack/salt/bin/python3.10 -m pip install mysqlclientis a workaround for my version:Confirmed here as well; occurred for me with libvirt-python.
Issue still occurs even if calling
salt-pipexplicitly at the shell on the minion.Running
/opt/saltstack/salt/bin/python3.10 -m pip install libvirt-pythonas root did work for me (after the failed pip.installed state ran, at least). You’ll probably have to restart salt-minion after.This definitely looks like a salt-pip/
pip.installedcockup.