Failure when deleting a stack with a nested stack already deleted

Bug #1261436 reported by Simon Pasquier
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Pablo Andres Fuente

Bug Description

If I delete a nested stack manually (eg heat resource-show <parent stack> <nested stack name> to get its id then heat stack-delete <nested stack id>), the Heat engine won't be able to delete the parent stack.

Logs:

2013-12-16 15:57:13.614 DEBUG heat.engine.scheduler [-] Task delete from Stack "stack1-GettingStarted-zga32e5jz4t2" starting from (pid=2314) start /opt/stack/heat/heat/engine/scheduler.py:131
2013-12-16 15:57:13.616 ERROR heat.engine.resource [-] Delete NestedStack "GettingStarted"
2013-12-16 15:57:13.616 TRACE heat.engine.resource Traceback (most recent call last):
2013-12-16 15:57:13.616 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 628, in delete
2013-12-16 15:57:13.616 TRACE heat.engine.resource handle_data = self.handle_delete()
2013-12-16 15:57:13.616 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/stack.py", line 80, in handle_delete
2013-12-16 15:57:13.616 TRACE heat.engine.resource return self.delete_nested()
2013-12-16 15:57:13.616 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/stack_resource.py", line 189, in delete_nested
2013-12-16 15:57:13.616 TRACE heat.engine.resource delete_task.start()
2013-12-16 15:57:13.616 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/scheduler.py", line 136, in start
2013-12-16 15:57:13.616 TRACE heat.engine.resource result = self._task(*self._args, **self._kwargs)
2013-12-16 15:57:13.616 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/parser.py", line 552, in delete
2013-12-16 15:57:13.616 TRACE heat.engine.resource self.state_set(action, self.IN_PROGRESS, 'Stack %s started' % action)
2013-12-16 15:57:13.616 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/parser.py", line 352, in state_set
2013-12-16 15:57:13.616 TRACE heat.engine.resource stack.update_and_save({'action': action,
2013-12-16 15:57:13.616 TRACE heat.engine.resource AttributeError: 'NoneType' object has no attribute 'update_and_save'
2013-12-16 15:57:13.616 TRACE heat.engine.resource
2013-12-16 15:57:13.989 DEBUG heat.engine.scheduler [-] Task destroy from None cancelled from (pid=2314) cancel /opt/stack/heat/heat/engine/scheduler.py:187

Changed in heat:
assignee: nobody → Pablo Andres Fuente (pablo-a-fuente)
Changed in heat:
importance: Undecided → High
milestone: none → icehouse-2
status: New → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

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

Reviewed: https://review.openstack.org/62752
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=7233ba1b14417d62b05034105fde17d9c7cdc5cf
Submitter: Jenkins
Branch: master

commit 7233ba1b14417d62b05034105fde17d9c7cdc5cf
Author: Pablo Andres Fuente <email address hidden>
Date: Tue Dec 17 17:01:04 2013 -0300

    Avoid error on double-delete of nested stack

    When deleting a stack that has a nested stack previously deleted, the
    process fails because the nested stack cannot be retrieved from the
    database.
    To solve the bug, the nested stack is now retrieved from the database
    ignoring the deleted stacks before the deletion process begins. Then
    a NotFound exception is raised, and then when it's catched the nested
    stack will be ignored.

    Change-Id: Ib863527dbfb0200b833a4e90b5a4fd50f469c1ce
    Closes-Bug: #1261436

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: icehouse-2 → 2014.1
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.