importlib-metadata 5.0 breaks stevedore

Bug #1991559 reported by Stephen Finucane
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
stevedore
Fix Released
Medium
Stephen Finucane

Bug Description

importlib-metadata has broken us again. This time it's the removal of 'EntryPoints.items()'. This results in error messages like the following:

    Traceback (most recent call last):
      File "/usr/local/lib/python3.7/dist-packages/stevedore/_cache.py", line 159, in _get_data_for_path
        with open(filename, 'r') as f:
    FileNotFoundError: [Errno 2] No such file or directory: '/root/.cache/python-entrypoints/aa1e52575b0b33cd4df0aed2af56d2b5dfa248c667d0055ed45042f5ce9d68b9'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/usr/local/bin/openstack", line 5, in <module>
        from openstackclient.shell import main
      File "/usr/local/lib/python3.7/dist-packages/openstackclient/shell.py", line 26, in <module>
        from openstackclient.common import clientmanager
      File "/usr/local/lib/python3.7/dist-packages/openstackclient/common/clientmanager.py", line 198, in <module>
        'openstack.cli.base',
      File "/usr/local/lib/python3.7/dist-packages/openstackclient/common/clientmanager.py", line 149, in get_plugin_modules
        mgr = stevedore.ExtensionManager(group)
      File "/usr/local/lib/python3.7/dist-packages/stevedore/extension.py", line 136, in __init__
        verify_requirements)
      File "/usr/local/lib/python3.7/dist-packages/stevedore/extension.py", line 218, in _load_plugins
        for ep in self.list_entry_points():
      File "/usr/local/lib/python3.7/dist-packages/stevedore/extension.py", line 207, in list_entry_points
        eps = list(_cache.get_group_all(self.namespace))
      File "/usr/local/lib/python3.7/dist-packages/stevedore/_cache.py", line 179, in get_group_all
        data = self._get_data_for_path(path)
      File "/usr/local/lib/python3.7/dist-packages/stevedore/_cache.py", line 162, in _get_data_for_path
        data = _build_cacheable_data(path)
      File "/usr/local/lib/python3.7/dist-packages/stevedore/_cache.py", line 110, in _build_cacheable_data
        for name, group_data in real_groups.items():
    AttributeError: 'EntryPoints' object has no attribute 'items'
    + echo 'failed 1 times: openstack versions show'
    failed 1 times: openstack versions show

Changed in python-stevedore:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Stephen Finucane (stephenfinucane)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to stevedore (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/stevedore/+/860105

Changed in python-stevedore:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to stevedore (stable/zed)

Fix proposed to branch: stable/zed
Review: https://review.opendev.org/c/openstack/stevedore/+/860392

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to stevedore (stable/yoga)

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/stevedore/+/860394

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to stevedore (stable/xena)

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/stevedore/+/860396

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to stevedore (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/stevedore/+/860398

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to stevedore (master)

Reviewed: https://review.opendev.org/c/openstack/stevedore/+/860105
Committed: https://opendev.org/openstack/stevedore/commit/28fc7164dace83abc3ecc06fcb56f7ca880d735a
Submitter: "Zuul (22348)"
Branch: master

commit 28fc7164dace83abc3ecc06fcb56f7ca880d735a
Author: Stephen Finucane <email address hidden>
Date: Mon Oct 3 16:14:50 2022 +0100

    Fix compatibility with Python 3.12, importlib-metadata 5.0

    importlib-metadata 5.0 has removed support for dict-style interaction
    with entrypoints [1]. This is going to eventually affect us when Python
    3.12 is released but even before then anyone not properly using upper
    constraints with an older Python 3.7-based release (the only Python
    version where we require the third-party importlib-metadata package
    rather than the stdlib importlib.metadata package) will be bitten. Fix
    it now to address both.

    [1] https://github.com/python/importlib_metadata/commit/dde2b9de2973ce1c6fa9ba21dfe81069b0baa77b

    Signed-off-by: Stephen Finucane <email address hidden>
    Change-Id: Ib9c2b0a14edea91e97d122d2ac93b650029f918e
    Closes-Bug: #1991559

Changed in python-stevedore:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to stevedore (stable/zed)

Reviewed: https://review.opendev.org/c/openstack/stevedore/+/860392
Committed: https://opendev.org/openstack/stevedore/commit/1e4d71d4b552494ff33ad03b76d2a590d58efe77
Submitter: "Zuul (22348)"
Branch: stable/zed

commit 1e4d71d4b552494ff33ad03b76d2a590d58efe77
Author: Stephen Finucane <email address hidden>
Date: Mon Oct 3 16:14:50 2022 +0100

    Fix compatibility with Python 3.12, importlib-metadata 5.0

    importlib-metadata 5.0 has removed support for dict-style interaction
    with entrypoints [1]. This is going to eventually affect us when Python
    3.12 is released but even before then anyone not properly using upper
    constraints with an older Python 3.7-based release (the only Python
    version where we require the third-party importlib-metadata package
    rather than the stdlib importlib.metadata package) will be bitten. Fix
    it now to address both.

    [1] https://github.com/python/importlib_metadata/commit/dde2b9de2973ce1c6fa9ba21dfe81069b0baa77b

    Signed-off-by: Stephen Finucane <email address hidden>
    Change-Id: Ib9c2b0a14edea91e97d122d2ac93b650029f918e
    Closes-Bug: #1991559
    (cherry picked from commit 28fc7164dace83abc3ecc06fcb56f7ca880d735a)

tags: added: in-stable-zed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to stevedore (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/stevedore/+/860394
Committed: https://opendev.org/openstack/stevedore/commit/143a3e9f0716690be7343d4d083f65d7624b3d2e
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit 143a3e9f0716690be7343d4d083f65d7624b3d2e
Author: Stephen Finucane <email address hidden>
Date: Mon Oct 3 16:14:50 2022 +0100

    Fix compatibility with Python 3.12, importlib-metadata 5.0

    importlib-metadata 5.0 has removed support for dict-style interaction
    with entrypoints [1]. This is going to eventually affect us when Python
    3.12 is released but even before then anyone not properly using upper
    constraints with an older Python 3.7-based release (the only Python
    version where we require the third-party importlib-metadata package
    rather than the stdlib importlib.metadata package) will be bitten. Fix
    it now to address both.

    [1] https://github.com/python/importlib_metadata/commit/dde2b9de2973ce1c6fa9ba21dfe81069b0baa77b

    Signed-off-by: Stephen Finucane <email address hidden>
    Change-Id: Ib9c2b0a14edea91e97d122d2ac93b650029f918e
    Closes-Bug: #1991559
    (cherry picked from commit 28fc7164dace83abc3ecc06fcb56f7ca880d735a)
    (cherry picked from commit 1e4d71d4b552494ff33ad03b76d2a590d58efe77)

tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to stevedore (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/stevedore/+/860398
Committed: https://opendev.org/openstack/stevedore/commit/48e178ab5ca6d8d2e6c6b9eee9e2fc62176d1340
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 48e178ab5ca6d8d2e6c6b9eee9e2fc62176d1340
Author: Stephen Finucane <email address hidden>
Date: Mon Oct 3 16:14:50 2022 +0100

    Fix compatibility with Python 3.12, importlib-metadata 5.0

    importlib-metadata 5.0 has removed support for dict-style interaction
    with entrypoints [1]. This is going to eventually affect us when Python
    3.12 is released but even before then anyone not properly using upper
    constraints with an older Python 3.7-based release (the only Python
    version where we require the third-party importlib-metadata package
    rather than the stdlib importlib.metadata package) will be bitten. Fix
    it now to address both.

    [1] https://github.com/python/importlib_metadata/commit/dde2b9de2973ce1c6fa9ba21dfe81069b0baa77b

    Signed-off-by: Stephen Finucane <email address hidden>
    Change-Id: Ib9c2b0a14edea91e97d122d2ac93b650029f918e
    Closes-Bug: #1991559
    (cherry picked from commit 28fc7164dace83abc3ecc06fcb56f7ca880d735a)
    (cherry picked from commit 1e4d71d4b552494ff33ad03b76d2a590d58efe77)
    (cherry picked from commit 143a3e9f0716690be7343d4d083f65d7624b3d2e)
    (cherry picked from commit 54acda936d41e9de7601b36223050faaccef8529)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/stevedore 4.0.1

This issue was fixed in the openstack/stevedore 4.0.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/stevedore 3.5.1

This issue was fixed in the openstack/stevedore 3.5.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/stevedore 3.3.2

This issue was fixed in the openstack/stevedore 3.3.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to stevedore (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/stevedore/+/860396
Committed: https://opendev.org/openstack/stevedore/commit/97dee6c435e4609231c96106fe253a1d9749d9cc
Submitter: "Zuul (22348)"
Branch: stable/xena

commit 97dee6c435e4609231c96106fe253a1d9749d9cc
Author: Stephen Finucane <email address hidden>
Date: Mon Oct 3 16:14:50 2022 +0100

    Fix compatibility with Python 3.12, importlib-metadata 5.0

    importlib-metadata 5.0 has removed support for dict-style interaction
    with entrypoints [1]. This is going to eventually affect us when Python
    3.12 is released but even before then anyone not properly using upper
    constraints with an older Python 3.7-based release (the only Python
    version where we require the third-party importlib-metadata package
    rather than the stdlib importlib.metadata package) will be bitten. Fix
    it now to address both.

    [1] https://github.com/python/importlib_metadata/commit/dde2b9de2973ce1c6fa9ba21dfe81069b0baa77b

    Signed-off-by: Stephen Finucane <email address hidden>
    Change-Id: Ib9c2b0a14edea91e97d122d2ac93b650029f918e
    Closes-Bug: #1991559
    (cherry picked from commit 28fc7164dace83abc3ecc06fcb56f7ca880d735a)
    (cherry picked from commit 1e4d71d4b552494ff33ad03b76d2a590d58efe77)
    (cherry picked from commit 143a3e9f0716690be7343d4d083f65d7624b3d2e)

tags: added: in-stable-xena
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/stevedore 4.1.0

This issue was fixed in the openstack/stevedore 4.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/stevedore 3.4.2

This issue was fixed in the openstack/stevedore 3.4.2 release.

Revision history for this message
Lesley Kimmel (lkimmz8765) wrote :

This bug appears to have re-emerged with stevedore>=3.5.0

Revision history for this message
Stephen Finucane (stephenfinucane) wrote :

I'm not able to reproduce this. Can you please test with stevedore>=4.1.0 and provide a traceback plus pip freeze output if you can? I suspect you're using a version without the fix. This was first fixed in 4.1.0. We backported the fix to stable branches but you'll need to use one the releases with the fix. These can be seen above, but in summary they are: 4.1.0 (antelope), 4.0.2 (zed), 3.5.2 (yoga), 3.4.2 (xena), 3.3.3 (wallaby). Older stable releases such as 4.0.0-4.0.1, 3.5.0-3.5.1, etc. won't contain the fix.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.