Rbd driver can't delete image with unprotected snapshot

Bug #1686063 reported by Slawek Kaplonski
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Cloud Archive
Fix Released
Undecided
Unassigned
glance_store
Fix Released
Undecided
Slawek Kaplonski
python-glance-store (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Rbd driver from glance_store is always trying to unprotect and then remove snapshot if there is any snapshot made on image.
If, for some reason, snapshot is unprotected already, Rbd.image() will raise exception InvalidArgument which glance_store don't handle. Because of that image is not deleted and glance returns error 500 to user.

Tags: cpe-onsite rbd
Changed in glance-store:
assignee: nobody → Slawek Kaplonski (slaweq)
Revision history for this message
Slawek Kaplonski (slaweq) wrote :
Download full text (4.3 KiB)

Error stacktrace:

2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi [req-8ec61501-fe65-4b1b-a8af-ab71bbc15393 0d671b302f6a4aa29dd605881a9ac7e7 88bccf10385a45d0a8cd0733e5db8734 - 1e1b967db9714f78a63a26eabccc312d 1e1b967db9714f78a63a26eabccc312d] Caught error: error unprotecting snapshot 56d1c793-2d91-4aae-bc77-37f4fc0f38b5@snap
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi Traceback (most recent call last):
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi File "/usr/lib/python2.7/dist-packages/glance/common/wsgi.py", line 1113, in __call__
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi request, **action_args)
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi File "/usr/lib/python2.7/dist-packages/glance/common/wsgi.py", line 1152, in dispatch
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi return method(*args, **kwargs)
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi File "/usr/lib/python2.7/dist-packages/glance/common/utils.py", line 363, in wrapped
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi return func(self, req, *args, **kwargs)
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi File "/usr/lib/python2.7/dist-packages/glance/api/v2/images.py", line 235, in delete
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi image.delete()
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi File "/usr/lib/python2.7/dist-packages/glance/domain/proxy.py", line 186, in delete
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi self.base.delete()
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi File "/usr/lib/python2.7/dist-packages/glance/domain/proxy.py", line 186, in delete
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi self.base.delete()
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi File "/usr/lib/python2.7/dist-packages/glance/api/policy.py", line 163, in delete
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi return self.image.delete()
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi File "/usr/lib/python2.7/dist-packages/glance/domain/proxy.py", line 186, in delete
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi self.base.delete()
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi File "/usr/lib/python2.7/dist-packages/glance/location.py", line 407, in delete
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi location)
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi File "/usr/lib/python2.7/dist-packages/glance/common/store_utils.py", line 114, in delete_image_location_from_backend
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi safe_delete_from_backend(context, image_id, location)
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi File "/usr/lib/python2.7/dist-packages/glance/common/store_utils.py", line 48, in safe_delete_from_backend
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi ret = store_api.delete_from_backend(location['url'], context=context)
2017-04-25 10:15:26.646 11926 ERROR glance.common.wsgi File "/usr/lib/python2.7/dist-packages/glance_store/backend.py", line 372, in delete_from_backend
2017-04-25...

Read more...

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

Fix proposed to branch: master
Review: https://review.openstack.org/459640

Changed in glance-store:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance_store (master)

Reviewed: https://review.openstack.org/459640
Committed: https://git.openstack.org/cgit/openstack/glance_store/commit/?id=a783a7442b6034d22773410bf296ee3952c9d51a
Submitter: Jenkins
Branch: master

commit a783a7442b6034d22773410bf296ee3952c9d51a
Author: Sławek Kapłoński <email address hidden>
Date: Tue Apr 25 11:30:49 2017 +0000

    Don't fail when trying to unprotect unprotected snapshot on RBD

    If rbd driver tries to unprotect snapshot which is already
    unprotected, rbd lib raise InvalidArgument exception.
    Rbd driver in glance_store will now handle such exception
    and will continue deleting snapshot and image in such case.

    Change-Id: I612b4421d5065dde002e3c0e0cb22537d2467adb
    Closes-Bug: #1686063

Changed in glance-store:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance_store 0.21.0

This issue was fixed in the openstack/glance_store 0.21.0 release.

Ante Karamatić (ivoks)
tags: added: cpe-onsite
Revision history for this message
Corey Bryant (corey.bryant) wrote :

This is fixed in Artful/Pike and above for Ubuntu and the Cloud Archive.

Changed in cloud-archive:
status: New → Fix Released
Changed in python-glance-store (Ubuntu):
status: New → 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.