zipapp file path conflicts

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

Bug Description

After running a packaged application (with zipapp.create_archive) which uses the latest python-openstackclient library, when using OpenStack functionality there is a path related exception, this only occurs on the packaged application, everything runs fine otherwise (IDE etc..).

Stacktrace:

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "zipapped.py/__main__.py", line 60, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "zipapped.py/main.py", line 96, in <module>
  File "zipapped.py/main.py", line 67, in main
  File "zipapped.py/logs.py", line 26, in _
  File "zipapped.py/tasks/_accumulator.py", line 97, in _
  File "zipapped.py/tasks/base_os.py", line 27, in execute
  File "zipapped.py/actions/open_stack.py", line 56, in from_cluster
  File "zipapped.py/actions/open_stack.py", line 64, in __init__
  File "/tmp/zipapped61tbjh5n/libs_posix/openstack/__init__.py", line 58, in connect
  File "/tmp/zipappedp61tbjh5n/libs_posix/openstack/config/__init__.py", line 36, in get_cloud_region
  File "/tmp/zipapped61tbjh5n/libs_posix/openstack/config/loader.py", line 1138, in get_one
  File "/tmp/zipapped61tbjh5n/libs_posix/openstack/config/loader.py", line 935, in _get_auth_loader
  File "/tmp/zipapped61tbjh5n/libs_posix/keystoneauth1/loading/base.py", line 79, in get_plugin_loader
  File "zipapped.py/libs_posix/stevedore/driver.py", line 54, in __init__
  File "zipapped.py/libs_posix/stevedore/named.py", line 78, in __init__
  File "zipapped.py/libs_posix/stevedore/extension.py", line 218, in _load_plugins
  File "zipapped.py/libs_posix/stevedore/extension.py", line 207, in list_entry_points
  File "zipapped.py/libs_posix/stevedore/_cache.py", line 179, in get_group_all
  File "zipapped.py/libs_posix/stevedore/_cache.py", line 155, in _get_data_for_path
  File "zipapped.py/libs_posix/stevedore/_cache.py", line 85, in _hash_settings_for_path
  File "zipapped.py/libs_posix/stevedore/_cache.py", line 62, in _get_mtime
NotADirectoryError: [Errno 20] Not a directory: 'zipapped.py/libs_posix'

francisco (frsilva7)
description: updated
Changed in python-stevedore:
status: New → Triaged
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/+/856833

Changed in python-stevedore:
status: Triaged → In Progress
Changed in python-stevedore:
importance: Undecided → Low
assignee: nobody → Stephen Finucane (stephenfinucane)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to stevedore (master)

Reviewed: https://review.opendev.org/c/openstack/stevedore/+/856833
Committed: https://opendev.org/openstack/stevedore/commit/462be040a6980f2be88d8f9bcad91e666805f8a2
Submitter: "Zuul (22348)"
Branch: master

commit 462be040a6980f2be88d8f9bcad91e666805f8a2
Author: Stephen Finucane <email address hidden>
Date: Fri Sep 9 17:01:58 2022 +0100

    Catch NotADirectoryError error

    Per the documentation [1]:

      exception NotADirectoryError
        Raised when a directory operation (such as os.listdir()) is
        requested on something which is not a directory. On most POSIX
        platforms, it may also be raised if an operation attempts to open or
        traverse a non-directory file as if it were a directory. Corresponds
        to errno ENOTDIR.

    Apparently creating a packaged application can cause this issue. There's
    no harm in ignoring it so do just that.

    Signed-off-by: Stephen Finucane <email address hidden>
    Closes-bug: #1980383
    Change-Id: I19b14c7f3b70bee5310cafcaa90fcee9003713c6

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

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

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.