Cannot delete objects with '#' in their name

Bug #1831753 reported by Yves-Gwenael Bourhis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ospurge
Fix Released
Undecided
Yves-Gwenael Bourhis

Bug Description

If someone creates a file called 'foo#1.txt' (e.g. via horizon) ospurge can not delete it because of:
https://storyboard.openstack.org/#!/story/2005828

Revision history for this message
Yves-Gwenael Bourhis (yves-gwenael-bourhis) wrote :

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

Changed in ospurge:
assignee: nobody → Yves-Gwenael Bourhis (yves-gwenael-bourhis)
status: New → In Progress
summary: - Cannot delete objects with '#' in there name
+ Cannot delete objects with '#' in their name
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ospurge (master)

Reviewed: https://review.opendev.org/663352
Committed: https://git.openstack.org/cgit/x/ospurge/commit/?id=fc73a2e881c09a073c7e247d816ff1eaadbe0e90
Submitter: Zuul
Branch: master

commit fc73a2e881c09a073c7e247d816ff1eaadbe0e90
Author: Yves-Gwenael Bourhis <email address hidden>
Date: Wed Jun 5 16:48:18 2019 +0200

    Url quoting of swift object names when deleting

    shade sends the swift object or container name unquoted as an url and in
    shade.openstackcloud.py in get_object_metadata where OpenStackCloudException
    errors with 404 status_code are silently ignored.
    If the name contains special characters such as a '#' we therefore get no
    metadata without errors.
    The same thing happens after in shade.openstackcloud.py in delete_object when
    calling self._object_store_client.delete : an OpenStackCloudHTTPError is
    caught and the delete method returns False.
    This resulted in ospurge not deleting such objects without even getting
    an exception.
    After investigation, the issue would be the same in openstacksdk which
    copies the same code as shade.
    Since nor shade nor openstacksdks perform url encoding of the name, we url
    encode it ourselves before calling shade, since shade makes an http
    request by calling the swift api with the object name as an url.

    Closes-Bug: #1831753

    Change-Id: Ie7aea2a14d920ca11012ff26d7f74017704765f5

Changed in ospurge:
status: In Progress → Fix Released
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.