-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] [v3005.1] salt-ssh crashes when dependency importlib_metadata is at version >=5.0.0 #62851
Comments
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.
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. |
Hi
Downgrade works (if you have the old package still in the pacman cache, otherwise you need to re-download it again first):
salt --versions-report before downgradesalt --versions-report /usr/lib/python3.10/site-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils. warnings.warn("Setuptools is replacing distutils.") Traceback (most recent call last): File "/usr/bin/salt", line 33, in sys.exit(load_entry_point('salt==3005', 'console_scripts', 'salt')()) File "/usr/lib/python3.10/site-packages/salt/scripts.py", line 530, in salt_main client.run() File "/usr/lib/python3.10/site-packages/salt/cli/salt.py", line 34, in run self.parse_args() File "/usr/lib/python3.10/site-packages/salt/utils/parsers.py", line 175, in parse_args self.print_versions_report() File "/usr/lib/python3.10/site-packages/salt/utils/parsers.py", line 251, in print_versions_report print("\n".join(version.versions_report()), file=file, flush=True) File "/usr/lib/python3.10/site-packages/salt/version.py", line 857, in versions_report ver_info = versions_information( File "/usr/lib/python3.10/site-packages/salt/version.py", line 847, in versions_information extensions_info = extensions_information() File "/usr/lib/python3.10/site-packages/salt/version.py", line 823, in extensions_information for entry_point in salt.utils.entrypoints.iter_entry_points("salt.loader"): File "/usr/lib/python3.10/site-packages/salt/utils/entrypoints.py", line 29, in _wrapped return f(*args, **kwargs) File "/usr/lib/python3.10/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' [ERROR ] An un-handled exception was caught by Salt's global exception handler: AttributeError: 'EntryPoints' object has no attribute 'items' Traceback (most recent call last): File "/usr/bin/salt", line 33, in sys.exit(load_entry_point('salt==3005', 'console_scripts', 'salt')()) File "/usr/lib/python3.10/site-packages/salt/scripts.py", line 530, in salt_main client.run() File "/usr/lib/python3.10/site-packages/salt/cli/salt.py", line 34, in run self.parse_args() File "/usr/lib/python3.10/site-packages/salt/utils/parsers.py", line 175, in parse_args self.print_versions_report() File "/usr/lib/python3.10/site-packages/salt/utils/parsers.py", line 251, in print_versions_report print("\n".join(version.versions_report()), file=file, flush=True) File "/usr/lib/python3.10/site-packages/salt/version.py", line 857, in versions_report ver_info = versions_information( File "/usr/lib/python3.10/site-packages/salt/version.py", line 847, in versions_information extensions_info = extensions_information() File "/usr/lib/python3.10/site-packages/salt/version.py", line 823, in extensions_information for entry_point in salt.utils.entrypoints.iter_entry_points("salt.loader"): File "/usr/lib/python3.10/site-packages/salt/utils/entrypoints.py", line 29, in _wrapped return f(*args, **kwargs) File "/usr/lib/python3.10/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'salt --versions-report after downgradesalt --versions-report /usr/lib/python3.10/site-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils. warnings.warn("Setuptools is replacing distutils.") Salt Version: Salt: 3005Dependency Versions: System Versions: |
Seeing this on Salt 3003.5 + Ubuntu 20.04 too:
Downgrading
(I know, I know) After downgrade:
|
This is also happening with v3004.2 on Amazon Linux 2. I can't get to the versions report as it's occurring during an automated build where the host is torn down but I can see the same exception in the log output. |
I can confirm this issue on Debian Buster as well |
Since salt is broken and a fix is already merged, can you release a new hotfix/minor version? |
For the record, the post-3005.1 fix used in Arch and Gentoo is commit b676e63 . |
…but patch b676e63 seems broken @MKLeb @Ch3LL: # 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.")
host123:
----------
_error:
Failed to return clean data
retcode:
64
stderr:
Usage: salt-call [options] <function> [arguments]
salt-call: error: Error while processing <function LogLevelMixIn.__setup_logging at 0x7f0cf7669cf0>: Traceback (most recent call last):
File "/var/tmp/.root_590ab3_salt/pyall/salt/utils/parsers.py", line 212, in parse_args
mixin_after_parsed_func(self)
File "/var/tmp/.root_590ab3_salt/pyall/salt/utils/parsers.py", line 905, in __setup_logging
salt._logging.setup_logging()
File "/var/tmp/.root_590ab3_salt/pyall/salt/_logging/impl.py", line 971, in setup_logging
setup_extended_logging(opts)
File "/var/tmp/.root_590ab3_salt/pyall/salt/_logging/impl.py", line 878, in setup_extended_logging
providers = salt.loader.log_handlers(opts)
File "/var/tmp/.root_590ab3_salt/pyall/salt/loader/__init__.py", line 857, in log_handlers
_module_dirs(
File "/var/tmp/.root_590ab3_salt/pyall/salt/loader/__init__.py", line 153, in _module_dirs
for entry_point in entrypoints.iter_entry_points("salt.loader"):
File "/var/tmp/.root_590ab3_salt/pyall/salt/utils/entrypoints.py", line 29, in _wrapped
return f(*args, **kwargs)
File "/var/tmp/.root_590ab3_salt/pyall/salt/utils/entrypoints.py", line 51, in iter_entry_points
for entry_point in entry_points.select(group=group):
AttributeError: 'dict' object has no attribute 'select'
stdout: This is with importlib_metadata 5.0.0 |
Hi @MKLeb, thanks for bringing this^^ to light. I'm not sure why both Arch and Gentoo chose to only cherry pick an insufficient subset of #62854 but maybe that is an indicator that a new upstream Salt release 3005.2 would help to get a consistent fix to packaging downstreams. After all, the ideal downstream patch count is zero. |
I would welcome 3005.2 |
I hit this problem trying to apply a state on a minion with ubuntu 20.04 that ships with python3-importlib-metadata version |
Hello 👋, Quick workaround. On Archlinux the last working version is |
... For using salt on Archlinux I can recommend the downgrade script. In case someone cleans the package cache regularly. |
This issue exists on Ubuntu 20.04 as well. |
@hartwork Sorry, I'll backport the patches like suse did when I find the time :) Forgot this issue. |
@Foxboron any news? |
…1 hosts The Python 3.11 issue upstream: - saltstack/salt#62676 - saltstack/salt#62677 The importlib-metadata issue: - saltstack/salt#62851 - saltstack/salt#62854 Patches have been extracted from pull requests as following: - git clone https://github.com/saltstack/salt - cd salt - git diff b676e6338a7c094cb3335d11f851ac0e12222017^ 45b924bad865a00116d2e045fe71229f2dc3376e -- salt/utils/entrypoints.py > salt-3005.1-importlib-metadata-5-r1.patch - git diff 00352ae6e0ed0b80a75ec65cb925dd31a625010d^ 91efaea4975f37de97a88687d40e54e774151a8b -- salt/modules/file.py | head -n 123 > salt-3005.1-modules-file-python-3.11-host.patch Be sure to call salt-ssh with "--regen-thin" the first time after updating, to not end up running unpatched 3005.1(-r0) code. Closes: https://bugs.gentoo.org/875389 Closes: https://bugs.gentoo.org/883671 Signed-off-by: Sebastian Pipping <[email protected]>
@Foxboron PS: Here's the replacement patch I just applied for Gentoo, essentially flattened pull request #62854: |
Been a busy few weeks :) Patched now. |
@Foxboron excellent! 👍 |
…1 hosts The Python 3.11 issue upstream: - saltstack/salt#62676 - saltstack/salt#62677 The importlib-metadata issue: - saltstack/salt#62851 - saltstack/salt#62854 Patches have been extracted from pull requests as following: - git clone https://github.com/saltstack/salt - cd salt - git diff b676e6338a7c094cb3335d11f851ac0e12222017^ 45b924bad865a00116d2e045fe71229f2dc3376e -- salt/utils/entrypoints.py > salt-3005.1-importlib-metadata-5-r1.patch - git diff 00352ae6e0ed0b80a75ec65cb925dd31a625010d^ 91efaea4975f37de97a88687d40e54e774151a8b -- salt/modules/file.py | head -n 123 > salt-3005.1-modules-file-python-3.11-host.patch Be sure to call salt-ssh with "--regen-thin" the first time after updating, to not end up running unpatched 3005.1(-r0) code. Closes: https://bugs.gentoo.org/875389 Closes: https://bugs.gentoo.org/883671 Signed-off-by: Sebastian Pipping <[email protected]>
Same issue found with my Ubuntu 22.04 box. Running salt 3005.1, and somehow I've ended up with importlib_metadata 6.0. Downgrade worked just fine (knock on wood). Makes me wonder how I ended up with such a new version, as the Ubuntu manifest lists 4.6.4, and the only tool I have directly installed as an OS dependency is poetry that also targets |
Salt 3006.0rc1 is out and should fix this issue. We welcome your feedback from testing this RC, and you can report back here if you are still seeing this problem come up. To install the RC, refer to this guide: https://docs.saltproject.io/salt/install-guide/en/latest/topics/release-candidate.html |
Closing as fixed, feel free to reopen if this issue is still present on 3006 |
Description
With Salt 3005 and importlib_metadata 5.0.0 I get this crash when running salt-ssh:
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: python/importlib_metadata#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.
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.
The text was updated successfully, but these errors were encountered: