Bug 2189782 - salt doesn't work when importlib_metadata is at version >=5.0.0 (py3.10+)
Summary: salt doesn't work when importlib_metadata is at version >=5.0.0 (py3.10+)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: salt
Version: 38
Hardware: Unspecified
OS: Linux
urgent
urgent
Target Milestone: ---
Assignee: Kirill Ponomarev
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-04-26 07:05 UTC by Andreas Schneider
Modified: 2023-06-03 02:14 UTC (History)
8 users (show)

Fixed In Version: salt-3005.1-4.fc39 salt-3006.1-1.fc38 salt-3005.1-4.fc37
Clone Of:
Environment:
Last Closed: 2023-05-24 14:49:33 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github saltstack salt issues 62851 0 None closed [BUG] [v3005.1] salt-ssh crashes when dependency importlib_metadata is at version >=5.0.0 2023-05-05 17:26:38 UTC

Description Andreas Schneider 2023-04-26 07:05:45 UTC
krikkit:/srv/cfgmgmt # salt krikkit state.highstate
/usr/lib/python3.11/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.11/site-packages/salt/utils/parsers.py", line 212, in parse_args                                                                                           
    mixin_after_parsed_func(self)                                                         
  File "/usr/lib/python3.11/site-packages/salt/utils/parsers.py", line 905, in __setup_logging
    salt._logging.setup_logging()                                                                                                                                                   
  File "/usr/lib/python3.11/site-packages/salt/_logging/impl.py", line 971, in setup_logging
    setup_extended_logging(opts)                                                                                                                                                    
  File "/usr/lib/python3.11/site-packages/salt/_logging/impl.py", line 878, in setup_extended_logging
    providers = salt.loader.log_handlers(opts)                                                                                                                                      
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/salt/loader/__init__.py", line 857, in log_handlers
    _module_dirs(                                                                                                                                                                   
  File "/usr/lib/python3.11/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.11/site-packages/salt/utils/entrypoints.py", line 29, in _wrapped 
    return f(*args, **kwargs)                                                                                                                                                       
           ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/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'

Reproducible: Always

Comment 1 Christopher Tubbs 2023-05-05 17:26:38 UTC
Upstream issue is https://github.com/saltstack/salt/issues/62851 regarding entrypoints compatibility. Solved upstream. Need patch applied in Fedora, or update to newer version that works.

Comment 2 Christopher Tubbs 2023-05-22 23:00:28 UTC
Can the maintainer please patch this, or update it to the newer version? This is preventing salt from working at all in Fedora 38, and the fix is available.

Comment 4 Jonathan Steffan 2023-05-23 03:20:02 UTC
I've gone ahead and done an upgraded scratch build to 3006.1 with the following changes:

- Update to 3006.1
- Stop carrying unit files and use upstream (they match what we were carrying)
- Remove sysv init files from module (no longer used)
- Update requirements patch (should be reviewed but looks to still be needed); specifically we need to look at the note about "We need contextvars for salt-ssh"
- Refactor spec file to more closely match upstream
- Switch to rpmautospec

rawhide: https://koji.fedoraproject.org/koji/taskinfo?taskID=101477785

There are a couple of things to consider with this update:

- Upstream is running the master as non-root, we should review and decide if this would be a good change to import during the upgrade
- Is there an upgrade path from 3005->3006 that is safe?


We should still patch the existing 3005.1 packages to get them working again in the affected branches.

Comment 5 Jonathan Steffan 2023-05-23 04:10:29 UTC
I've done a scratch build with the upstream patch (https://github.com/saltstack/salt/commit/b676e6338a7c094cb3335d11f851ac0e12222017.patch) applied for F38. It would be great to know if this resolves all current issues.

f38: https://koji.fedoraproject.org/koji/taskinfo?taskID=101479366

Comment 6 Jonathan Steffan 2023-05-23 04:21:36 UTC
It looks like F37 would also need to be updated with this patch.

f37: https://koji.fedoraproject.org/koji/taskinfo?taskID=101480067

Comment 7 Sergio Basto 2023-05-23 09:40:36 UTC
what I would like is a pull request, it would save me that work . can you do it ?

Comment 8 Christopher Tubbs 2023-05-23 12:31:18 UTC
(In reply to Jonathan Steffan from comment #6)
> It looks like F37 would also need to be updated with this patch.
> 
> f37: https://koji.fedoraproject.org/koji/taskinfo?taskID=101480067

I don't think it's necessary to patch F37. Although it had the same version of salt, it seemed to work fine for me, probably because the older version of setuptools was used in F37. I only started seeing problems after upgrading to F38.

Comment 9 Christopher Tubbs 2023-05-23 12:55:18 UTC
(In reply to Jonathan Steffan from comment #5)
> I've done a scratch build with the upstream patch
> (https://github.com/saltstack/salt/commit/
> b676e6338a7c094cb3335d11f851ac0e12222017.patch) applied for F38. It would be
> great to know if this resolves all current issues.
> 
> f38: https://koji.fedoraproject.org/koji/taskinfo?taskID=101479366

I installed salt and salt-minion RPMs from that, and it seemed to have resolved all the issues I was seeing. Thanks!

Comment 10 Sergio Basto 2023-05-23 13:27:16 UTC
I did the PR [1] lets wait one or two days for response , if no answer,  I will merge and build it 


[1]
https://src.fedoraproject.org/rpms/salt/pull-request/8

Comment 11 Fedora Update System 2023-05-24 14:48:28 UTC
FEDORA-2023-b9be998334 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-b9be998334

Comment 12 Fedora Update System 2023-05-24 14:49:33 UTC
FEDORA-2023-b9be998334 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2023-05-24 14:58:25 UTC
FEDORA-2023-36308c4d0a has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-36308c4d0a

Comment 14 Fedora Update System 2023-05-24 14:58:25 UTC
FEDORA-2023-aa84f9d4e3 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-aa84f9d4e3

Comment 15 Fedora Update System 2023-05-25 01:54:05 UTC
FEDORA-2023-36308c4d0a has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-36308c4d0a`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-36308c4d0a

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 16 Fedora Update System 2023-05-25 01:57:24 UTC
FEDORA-2023-622965abe9 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-622965abe9`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-622965abe9

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 17 Fedora Update System 2023-05-31 17:31:52 UTC
FEDORA-2023-622965abe9 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 18 Fedora Update System 2023-06-03 02:14:41 UTC
FEDORA-2023-36308c4d0a has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.