The symptom is this: >> # 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] Goes away after: sudo emerge -1 "<dev-python/importlib_metadata-5"
PS: Similar to this one on bandit: https://github.com/PyCQA/bandit/issues/951
I don't see a report for Salt yet upstream. Could you file one?
(In reply to Sam James from comment #2) > I don't see a report for Salt yet upstream. Could you file one? Good point, done. Not my best report ever, but I think it should do.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d3850ddf61052187f59b26d2359a31903c88ec9a commit d3850ddf61052187f59b26d2359a31903c88ec9a Author: Patrick McLean <chutzpah@gentoo.org> AuthorDate: 2022-11-02 19:07:01 +0000 Commit: Patrick McLean <chutzpah@gentoo.org> CommitDate: 2022-11-02 23:40:09 +0000 app-admin/salt: add 3005.1 Closes: https://bugs.gentoo.org/875389 Signed-off-by: Patrick McLean <chutzpah@gentoo.org> app-admin/salt/Manifest | 2 +- .../files/salt-3005.1-importlib-metadata-5.patch | 37 ++++ .../salt/files/salt-3005.1-no-entry-points.patch | 13 ++ app-admin/salt/files/salt-3005.1-tests.patch | 40 ++++ app-admin/salt/salt-3005.1.ebuild | 219 +++++++++++++++++++++ 5 files changed, 310 insertions(+), 1 deletion(-) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90006acdb1e2ca2b0634c6bbeea25d426d436882 commit 90006acdb1e2ca2b0634c6bbeea25d426d436882 Author: Patrick McLean <chutzpah@gentoo.org> AuthorDate: 2022-11-02 18:56:41 +0000 Commit: Patrick McLean <chutzpah@gentoo.org> CommitDate: 2022-11-02 23:40:09 +0000 app-admin/salt: revbump 3005 to force <importlib_metadata-5 Bug: https://bugs.gentoo.org/875389 Signed-off-by: Patrick McLean <chutzpah@gentoo.org> app-admin/salt/{salt-3005.ebuild => salt-3005-r1.ebuild} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ed75a45b3a1cbc104cc3c598e42a0dceb241fdb commit 5ed75a45b3a1cbc104cc3c598e42a0dceb241fdb Author: Patrick McLean <chutzpah@gentoo.org> AuthorDate: 2022-11-02 18:55:54 +0000 Commit: Patrick McLean <chutzpah@gentoo.org> CommitDate: 2022-11-02 23:40:09 +0000 app-admin/salt: revbump 3004.2 to force <importlib_metadata-5 Bug: https://bugs.gentoo.org/875389 Signed-off-by: Patrick McLean <chutzpah@gentoo.org> app-admin/salt/Manifest | 1 + app-admin/salt/salt-3004.1-r4.ebuild | 207 --------------------- ...salt-3004.2-r1.ebuild => salt-3004.2-r2.ebuild} | 3 +- 3 files changed, 3 insertions(+), 208 deletions(-) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f7ca6a0782e42312371c848dc887b422f8af20b6 commit f7ca6a0782e42312371c848dc887b422f8af20b6 Author: Patrick McLean <chutzpah@gentoo.org> AuthorDate: 2022-11-02 18:55:17 +0000 Commit: Patrick McLean <chutzpah@gentoo.org> CommitDate: 2022-11-02 23:40:08 +0000 app-admin/salt: revbump 3003.5 to force <importlib_metadata-5 Bug: https://bugs.gentoo.org/875389 Signed-off-by: Patrick McLean <chutzpah@gentoo.org> app-admin/salt/Manifest | 1 + app-admin/salt/salt-3003.4-r1.ebuild | 205 --------------------- ...salt-3003.5-r1.ebuild => salt-3003.5-r2.ebuild} | 3 +- 3 files changed, 3 insertions(+), 206 deletions(-) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b00e6364c3cae36c5240f78bb509833b29beeb4 commit 5b00e6364c3cae36c5240f78bb509833b29beeb4 Author: Patrick McLean <chutzpah@gentoo.org> AuthorDate: 2022-11-02 18:54:36 +0000 Commit: Patrick McLean <chutzpah@gentoo.org> CommitDate: 2022-11-02 23:40:08 +0000 app-admin/salt: revbump 3002.9 to force <importlib_metadata-5 Signed-off-by: Patrick McLean <chutzpah@gentoo.org> Bug: https://bugs.gentoo.org/875389 app-admin/salt/Manifest | 3 --- app-admin/salt/{salt-3002.9.ebuild => salt-3002.9-r1.ebuild} | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-)
Reopening, 3005.1 also broken for >=dev-python/importlib_metadata-5.0.0, now failing in code added by patch files/salt-3005.1-importlib-metadata-5.patch: >> # 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: PS: What is the expected effect of patch files/salt-3005.1-no-entry-points.patch ?
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4880642564e0285f7670d186aa254c3f9202f86d commit 4880642564e0285f7670d186aa254c3f9202f86d Author: Sebastian Pipping <sping@gentoo.org> AuthorDate: 2023-01-30 04:48:57 +0000 Commit: Sebastian Pipping <sping@gentoo.org> CommitDate: 2023-01-30 04:53:23 +0000 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/62677 The importlib-metadata issue: - https://github.com/saltstack/salt/issues/62851 - https://github.com/saltstack/salt/pull/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 <sping@gentoo.org> .../salt-3005.1-importlib-metadata-5-r1.patch | 29 +++ ...salt-3005.1-modules-file-python-3.11-host.patch | 123 ++++++++++++ app-admin/salt/salt-3005.1-r1.ebuild | 220 +++++++++++++++++++++ 3 files changed, 372 insertions(+)