deleting heat stack outside magnum results in undeletedable bay

Bug #1412204 reported by Steven Dake
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magnum
Fix Released
High
Steven Dake

Bug Description

If you delete a heat stack using heat stack-delete of an existing bay, and then try to delete the bay:

[sdake@bigiron magnum]$ magnum bay-list
+--------------------------------------+------+------------+
| uuid | name | node_count |
+--------------------------------------+------+------------+
| e8fab2ce-73e9-472e-af8b-233c554eec25 | goof | 1 |
+--------------------------------------+------+------------+
[sdake@bigiron magnum]$ magnum bay-delete --id e8fab2ce-73e9-472e-af8b-233c554eec25
ERROR: Internal Server Error (HTTP 500)

The backtrace is as follows:

2015-01-18 09:54:47.229 25971 ERROR oslo.messaging._drivers.common [-] ['Traceback (most recent call last):\n', ' File "/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line 138, in _dispatch_and_reply\n incoming.message))\n', ' File "/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line 181, in _dispatch\n return self._do_dispatch(endpoint, method, ctxt, args)\n', ' File "/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line 127, in _do_dispatch\n result = getattr(endpoint, method)(ctxt, **new_args)\n', ' File "/usr/lib/python2.7/site-packages/magnum/conductor/handlers/bay_k8s_heat.py", line 153, in bay_delete\n osc.heat().stacks.delete(stack_id)\n', ' File "/usr/lib/python2.7/site-packages/heatclient/v1/stacks.py", line 131, in delete\n self._delete("/stacks/%s" % stack_id)\n', ' File "/usr/lib/python2.7/site-packages/heatclient/openstack/common/apiclient/base.py", line 202, in _delete\n return self.client.delete(url)\n', ' File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 289, in delete\n return self.raw_request("DELETE", url, **kwargs)\n', ' File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 270, in raw_request\n return self._http_request(url, method, **kwargs)\n', ' File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 216, in _http_request\n resp = self._http_request(path, method, **kwargs)\n', ' File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 209, in _http_request\n raise exc.from_response(resp)\n', 'HTTPNotFound: ERROR: The Stack (goof) could not be found.\n']

This prevents the bay from ever being deletable!

The correct behavior in this scenario is to delete the bay and all of its contained pods, services, rcs that are stored on the bay since the stack is long gone when the Heat client raises a HTTPNotFound exception.

Steven Dake (sdake)
Changed in magnum:
status: New → Triaged
importance: Undecided → High
Steven Dake (sdake)
Changed in magnum:
assignee: nobody → Steven Dake (sdake)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnum (master)

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

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

Reviewed: https://review.openstack.org/148142
Committed: https://git.openstack.org/cgit/stackforge/magnum/commit/?id=fd7cde87c99a3d89bfcd9de4ecc13927f3f4a5ad
Submitter: Jenkins
Branch: master

commit fd7cde87c99a3d89bfcd9de4ecc13927f3f4a5ad
Author: Steven Dake <email address hidden>
Date: Sun Jan 18 17:51:05 2015 -0700

    Allow deletion of rc/service/pod if stack has been deleted

    If the Heat stack has already been deleted by a different context,
    then there is no reason to check the results of the rc/pod/service
    deletion. They will always fail, resulting in an undeleteable object.

    Worse, the bay becomes undeletable.

    Change-Id: Ie98b9effaa15e8849aa66d8476838c293af80150
    Closes-bug: #1412204

Changed in magnum:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/148122
Committed: https://git.openstack.org/cgit/stackforge/magnum/commit/?id=cc085b4cf4c3ee5e06fa13856f30e3264d8652a7
Submitter: Jenkins
Branch: master

commit cc085b4cf4c3ee5e06fa13856f30e3264d8652a7
Author: Steven Dake <email address hidden>
Date: Sun Jan 18 11:33:38 2015 -0700

    Delete bay independent of presence of heat stack

    If the Heat stack has already been deleted by the user, it shouldn't
    block the bay from being deleted. Instead just ignore that Heat
    exception and continue on deleting the bay as if the Heat stack
    had already been deleted (because it has, or Heat has suffered data loss)

    Change-Id: I38da49044f155105502a7e1bcccff45cde29fa86
    Closes-Bug: 1412204

Changed in magnum:
status: Fix Committed → 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.