Open victorhooi opened 2 years ago
Please provide the output from salt --versions
.
This is the output from salt --versions
- I seem to get the same Python error?
$ salt --versions
Traceback (most recent call last):
File "/usr/bin/salt", line 33, in <module>
sys.exit(load_entry_point('salt==3004.2', 'console_scripts', 'salt')())
File "/usr/lib/python3/dist-packages/salt/scripts.py", line 521, in salt_main
client.run()
File "/usr/lib/python3/dist-packages/salt/cli/salt.py", line 35, in run
self.parse_args()
File "/usr/lib/python3/dist-packages/salt/utils/parsers.py", line 177, in parse_args
self.print_versions_report()
File "/usr/lib/python3/dist-packages/salt/utils/parsers.py", line 246, in print_versions_report
print("\n".join(version.versions_report()), file=file, flush=True)
File "/usr/lib/python3/dist-packages/salt/version.py", line 874, in versions_report
ver_info = versions_information(
File "/usr/lib/python3/dist-packages/salt/version.py", line 864, in versions_information
extensions_info = extensions_information()
File "/usr/lib/python3/dist-packages/salt/version.py", line 840, in extensions_information
for entry_point in salt.utils.entrypoints.iter_entry_points("salt.loader"):
File "/usr/lib/python3/dist-packages/salt/utils/entrypoints.py", line 43, in _wrapped
return f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/salt/utils/entrypoints.py", line 55, in iter_entry_points
entry_points = importlib.metadata.entry_points()
File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 1009, in entry_points
return SelectableGroups.load(eps).select(**params)
File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 459, in load
ordered = sorted(eps, key=by_group)
File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 1006, in <genexpr>
eps = itertools.chain.from_iterable(
File "/usr/lib/python3.10/importlib/metadata/_itertools.py", line 16, in unique_everseen
k = key(element)
AttributeError: 'PathDistribution' object has no attribute '_normalized_name'
I did run with --version
on some of the salt commands, in case that helps - output below:
$ salt-master --version
salt-master 3004.2
$ salt --version
salt 3004.2
Not just the master, but the minion as well. This is also broken on Ubuntu Jammy or any other distro using Python 3.10.
This is due to the inclusion of importlib_metadata
with salt, which conflicts with the version installed with newer Python.
If you need to get salt working, I have made this patch which seems to get everything working normally. This will have to do until salt officially supports newer Python.
Edit /usr/lib/python3/dist-packages/salt/ext/importlib_metadata/__init__.py
with:
--- /usr/lib/python3/dist-packages/salt/ext/importlib_metadata/__init__.py.old 2022-07-14 22:05:51.475525329 -0400
+++ /usr/lib/python3/dist-packages/salt/ext/importlib_metadata/__init__.py 2022-07-14 22:07:13.627100769 -0400
@@ -243,6 +243,11 @@
class Distribution:
"""A Python distribution package."""
+ # FIXME hack for Python 3.10 support
+ @property
+ def _normalized_name(self):
+ return Prepared.normalize(self.name)
+
@abc.abstractmethod
def read_text(self, filename):
"""Attempt to load metadata file given by the name.
This issues seems to be fixed on salt 3005rc1
This issues seems to be fixed on salt 3005rc1
Are you using the Tiamat build? That's because it uses Python 3.9.
This issues seems to be fixed on salt 3005rc1
Are you using the Tiamat build? That's because it uses Python 3.9.
I'm using my own custom salt-master docker image:
docker pull ghcr.io/cdalvaro/docker-salt-master:3005rc1
PR: https://github.com/cdalvaro/docker-salt-master/pull/152
One of the CI tests checks exactly your command: https://github.com/cdalvaro/docker-salt-master/runs/7406672767?check_suite_focus=true
==> Checking salt-master version ...
Salt Version:
Salt: 3005rc1
Dependency Versions:
cffi: Not Installed
cherrypy: 18.6.1
dateutil: 2.8.1
docker-py: Not Installed
gitdb: 4.0.9
gitpython: 3.1.24
Jinja2: 3.1.2
libgit2: 1.1.0
M2Crypto: Not Installed
Mako: 1.1.3
msgpack: 1.0.4
msgpack-pure: Not Installed
mysql-python: 1.4.6
pycparser: Not Installed
pycrypto: Not Installed
pycryptodome: 3.15.0
pygit2: 1.6.1
Python: 3.10.4 (main, Jun 29 2022, 12:14:53) [GCC 11.2.0]
python-gnupg: 0.4.8
PyYAML: 6.0
PyZMQ: 20.0.0
smmap: 5.0.0
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.3.3
System Versions:
dist: ubuntu 22.04 Jammy Jellyfish
locale: utf-8
machine: x86_64
release: 5.15.0-1014-azure
system: Linux
version: Ubuntu 22.04 Jammy Jellyfish
3005 has now been released! 🎉
This means this bug should be fixed in latest version.
Description
Salt-master will not start on latest Debian testing (Bookworm), due to a Python error:
This appears similar to https://github.com/saltstack/salt/issues/61819 - however, that issue claimed the issue was fixed in Python 3.10.1+.
However, I am running Python 3.10.5, and the issue still appears to exist:
Setup
VM (QEMU 6.2)
Debian Testing (Bookworm)
Python 3.10.5
[ ] 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
Steps to Reproduce the behavior
Install Debian Testing, with Python 3.10.5. Install SaltStack per https://repo.saltproject.io/#debian
Expected behavior Salt-master should be able to successfully run after installation.