salt: [BUG] [v3005.1] salt-ssh crashes when dependency importlib_metadata is at version >=5.0.0
Description With Salt 3005 and importlib_metadata 5.0.0 I get this crash when running salt-ssh:
# time salt-ssh '*' state.apply setup
/usr/lib/python3.8/site-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
[ERROR ] 'EntryPoints' object has no attribute 'items'
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/salt/utils/parsers.py", line 212, in parse_args
mixin_after_parsed_func(self)
File "/usr/lib/python3.8/site-packages/salt/utils/parsers.py", line 905, in __setup_logging
salt._logging.setup_logging()
File "/usr/lib/python3.8/site-packages/salt/_logging/impl.py", line 971, in setup_logging
setup_extended_logging(opts)
File "/usr/lib/python3.8/site-packages/salt/_logging/impl.py", line 878, in setup_extended_logging
providers = salt.loader.log_handlers(opts)
File "/usr/lib/python3.8/site-packages/salt/loader/__init__.py", line 857, in log_handlers
_module_dirs(
File "/usr/lib/python3.8/site-packages/salt/loader/__init__.py", line 153, in _module_dirs
for entry_point in entrypoints.iter_entry_points("salt.loader"):
File "/usr/lib/python3.8/site-packages/salt/utils/entrypoints.py", line 29, in _wrapped
return f(*args, **kwargs)
File "/usr/lib/python3.8/site-packages/salt/utils/entrypoints.py", line 41, in iter_entry_points
for entry_point_group, entry_points_list in entry_points.items():
AttributeError: 'EntryPoints' object has no attribute 'items'
Usage: salt-ssh [options] '<target>' <function> [arguments]
After downgrading importlib_metadata to 4.13.0 things are working fine again. Please make Salt work with importlib_metadata >=5.0.0. Thank you!
Related: https://github.com/python/importlib_metadata/issues/409
Setup (Please provide relevant configs and/or SLS files (be sure to remove sensitive info. There is no general set-up of Salt.)
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 See description
Expected behavior No crash
Screenshots none
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)PASTE HERE
Additional context Add any other context about the problem here.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 23 (5 by maintainers)
Commits related to this issue
- app-admin/salt: Fix importlib-metadata usage + fix salt-ssh for py3.11 hosts The Python 3.11 issue upstream: - https://github.com/saltstack/salt/issues/62676 - https://github.com/saltstack/salt/pull/... — committed to gentoo/gentoo by hartwork a year ago
- app-admin/salt: Fix importlib-metadata usage + fix salt-ssh for py3.11 hosts The Python 3.11 issue upstream: - https://github.com/saltstack/salt/issues/62676 - https://github.com/saltstack/salt/pull/... — committed to freijon/gentoo by hartwork a year ago
Seeing this on Salt 3003.5 + Ubuntu 20.04 too:
Downgrading
importlib_metadata:(I know, I know)
After downgrade:
I would welcome 3005.2
Since salt is broken and a fix is already merged, can you release a new hotfix/minor version?
@hartwork Sorry, I’ll backport the patches like suse did when I find the time 😃 Forgot this issue.