ImageNotFound should not trace exception in delete_image_on_error decorator

Bug #1648574 reported by Matt Riedemann
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Matt Riedemann
Newton
Fix Committed
Low
Lee Yarwood

Bug Description

As seen here:

http://logs.openstack.org/69/405969/4/check/gate-tempest-dsvm-neutron-src-neutron-lib-ubuntu-xenial/04c26f3/logs/screen-n-cpu.txt?level=TRACE#_2016-12-07_06_42_10_616

2016-12-07 06:42:10.616 32194 ERROR nova.compute.manager [req-fdc419c6-edf0-4b3c-89ac-1e376a5b64e5 tempest-ImagesTestJSON-2099199377 tempest-ImagesTestJSON-2099199377] [instance: a2e32d10-4374-45c5-a732-af3459f2950d] Error while trying to clean up image dd2d2646-16a5-4135-8ff7-a3b255e01cd9
2016-12-07 06:42:10.616 32194 ERROR nova.compute.manager [instance: a2e32d10-4374-45c5-a732-af3459f2950d] Traceback (most recent call last):
2016-12-07 06:42:10.616 32194 ERROR nova.compute.manager [instance: a2e32d10-4374-45c5-a732-af3459f2950d] File "/opt/stack/new/nova/nova/compute/manager.py", line 238, in decorated_function
2016-12-07 06:42:10.616 32194 ERROR nova.compute.manager [instance: a2e32d10-4374-45c5-a732-af3459f2950d] self.image_api.delete(context, image_id)
2016-12-07 06:42:10.616 32194 ERROR nova.compute.manager [instance: a2e32d10-4374-45c5-a732-af3459f2950d] File "/opt/stack/new/nova/nova/image/api.py", line 141, in delete
2016-12-07 06:42:10.616 32194 ERROR nova.compute.manager [instance: a2e32d10-4374-45c5-a732-af3459f2950d] return session.delete(context, image_id)
2016-12-07 06:42:10.616 32194 ERROR nova.compute.manager [instance: a2e32d10-4374-45c5-a732-af3459f2950d] File "/opt/stack/new/nova/nova/image/glance.py", line 765, in delete
2016-12-07 06:42:10.616 32194 ERROR nova.compute.manager [instance: a2e32d10-4374-45c5-a732-af3459f2950d] raise exception.ImageNotFound(image_id=image_id)
2016-12-07 06:42:10.616 32194 ERROR nova.compute.manager [instance: a2e32d10-4374-45c5-a732-af3459f2950d] ImageNotFound: Image dd2d2646-16a5-4135-8ff7-a3b255e01cd9 could not be found.
2016-12-07 06:42:10.616 32194 ERROR nova.compute.manager [instance: a2e32d10-4374-45c5-a732-af3459f2950d]

The snapshot_instance method in the nova compute manager is decorated with the delete_image_on_error method which is meant to delete an image snapshot in glance if something fails during the snapshot/image upload process. The thing is it's a cleanup decorator, and if glance raises ImageNotFound, then we don't care, we shouldn't emit a stacktrace in that case.

Matt Riedemann (mriedem)
summary: - ImageNotFound exception traced in delete_image_on_error decorator
+ ImageNotFound should not trace exception in delete_image_on_error
+ decorator
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/408826

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

Reviewed: https://review.openstack.org/408771
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=2bb70e7b15e6cfef4652e2e49c4e02d151d2dbdf
Submitter: Jenkins
Branch: master

commit 2bb70e7b15e6cfef4652e2e49c4e02d151d2dbdf
Author: Matt Riedemann <email address hidden>
Date: Thu Dec 8 13:44:54 2016 -0500

    Don't trace on ImageNotFound in delete_image_on_error

    The point of the delete_image_on_error decorator is to
    cleanup an image used during snapshot operations, so it
    makes little sense to log an exception trace if the image
    delete fails because the image no longer exists, which it
    might not since _snapshot_instance method will proactively
    delete non-active images in certain situations.

    So let's just handle the ImageNotFound and ignore it.

    Change-Id: I14e061a28678ad28e38bd185e3d0a35cae41a9cf
    Closes-Bug: #1648574

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

This issue was fixed in the openstack/nova 15.0.0.0b2 development milestone.

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

Reviewed: https://review.openstack.org/408826
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=89bc79a49911fefd5d0dfc6bcb3085dbcfd06750
Submitter: Jenkins
Branch: stable/newton

commit 89bc79a49911fefd5d0dfc6bcb3085dbcfd06750
Author: Matt Riedemann <email address hidden>
Date: Thu Dec 8 13:44:54 2016 -0500

    Don't trace on ImageNotFound in delete_image_on_error

    The point of the delete_image_on_error decorator is to
    cleanup an image used during snapshot operations, so it
    makes little sense to log an exception trace if the image
    delete fails because the image no longer exists, which it
    might not since _snapshot_instance method will proactively
    delete non-active images in certain situations.

    So let's just handle the ImageNotFound and ignore it.

    Change-Id: I14e061a28678ad28e38bd185e3d0a35cae41a9cf
    Closes-Bug: #1648574
    (cherry picked from commit 2bb70e7b15e6cfef4652e2e49c4e02d151d2dbdf)

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

This issue was fixed in the openstack/nova 14.0.4 release.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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