"PathFilter" can raise exception when executing "os.path.realpath()"

Bug #1864090 reported by Rodolfo Alonso on 2020-02-20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.rootwrap
Undecided
Rodolfo Alonso

Bug Description

"PathFilter" can raise exception when executing "os.path.realpath()". As seen in the CI log [1], "os.path.realpath()" calls "os.getcwd()". This method can return the reported exception if the [2] current directory has been deleted by other process. We should catch and unset this exception.

Log snippet: http://paste.openstack.org/show/789807/

Log: [1] https://164b3e6c67f8dffddea7-f89a5ef8d1bd221399a14347eddacf71.ssl.cf2.rackcdn.com/701733/41/check/neutron-functional/a3fabf6/testr_results.html

[2] https://stackoverflow.com/questions/3210902/python-why-does-os-getcwd-sometimes-crash-with-oserror

Changed in oslo.rootwrap:
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)

Fix proposed to branch: master
Review: https://review.opendev.org/708936

Changed in oslo.rootwrap:
status: New → In Progress
summary: - "PathFilter" can raise exception when executing "os.path.isabs(arg)"
+ "PathFilter" can raise exception when executing "os.path.realpath()"
description: updated

Reviewed: https://review.opendev.org/708936
Committed: https://git.openstack.org/cgit/openstack/oslo.rootwrap/commit/?id=23a534b9f5f5aad2a95349f809e05cb9b6429f3c
Submitter: Zuul
Branch: master

commit 23a534b9f5f5aad2a95349f809e05cb9b6429f3c
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Fri Feb 21 15:28:23 2020 +0000

    Implement "realpath" to retrieve the real absolute path

    This function will call "os.path.realpth" and this in turn could call
    "os.getcwd". If the current path has been deleted by other application,
    this method will raise FileNotFoundError exception. This new function
    catches and unsets this exception, returning an empty string.

    Change-Id: If70411d8d189de4a020e528cd54412a5678cfab9
    Closes-Bug: #1864090

Changed in oslo.rootwrap:
status: In Progress → Fix Released

This issue was fixed in the openstack/oslo.rootwrap 6.0.1 release.

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

Other bug subscribers