Comment 0 for bug 1412965

Revision history for this message
Patrick Crews (patrick-crews) wrote : stack deletion error in logs if snapshot image was deleted via other means

Created a test stack.
Created snapshot of the stack.
Deleted the snapshot image via horizon / nova / glance vs. heat api.
On heat stack-delete, saw the error message below in the logs.

If the stack-delete action's goal is to eliminate all snapshots, then not finding it should perhaps throw a warning and inform the user, but this seems to not be handling this situation very well (even though it could be considered a win in terms of what the api call is trying to achieve)

2015-01-20 09:34:25.385 DEBUG heat.engine.scheduler [-] Task delete_snapshot from Server "wordpress_instance" [28aa750c-3c50-48f4-a9ab-e64a73051b68] Stack "test-stack-0" [e67708a9-ae6f-4335-bf41-ac1682319548] running from (pid=13179) step /opt/stack/heat/heat/engine/scheduler.py:219
2015-01-20 09:34:25.429 DEBUG heat.engine.stack_lock [-] Engine 43614879-f616-42f8-84fb-fd42a5d03ed7 released lock on stack e67708a9-ae6f-4335-bf41-ac1682319548 from (pid=13179) release /opt/stack/heat/heat/engine/stack_lock.py:123
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/eventlet/hubs/hub.py", line 455, in fire_timers
    timer()
  File "/usr/local/lib/python2.7/dist-packages/eventlet/hubs/timer.py", line 58, in __call__
    cb(*args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/eventlet/greenthread.py", line 212, in main
    result = function(*args, **kwargs)
  File "/opt/stack/heat/heat/engine/service.py", line 113, in _start_with_trace
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 105, in wrapper
    return f(*args, **kwargs)
  File "/opt/stack/heat/heat/engine/stack.py", line 982, in delete
    self.delete_snapshot(snapshot)
  File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 105, in wrapper
    return f(*args, **kwargs)
  File "/opt/stack/heat/heat/engine/stack.py", line 1087, in delete_snapshot
    scheduler.TaskRunner(rsrc.delete_snapshot, data)()
  File "/opt/stack/heat/heat/engine/scheduler.py", line 174, in __call__
    self.start(timeout=timeout)
  File "/opt/stack/heat/heat/engine/scheduler.py", line 199, in start
    self.step()
  File "/opt/stack/heat/heat/engine/scheduler.py", line 222, in step
    next(self._runner)
  File "/opt/stack/heat/heat/engine/scheduler.py", line 321, in wrapper
    subtask = parent.throw(*sys.exc_info())
  File "/opt/stack/heat/heat/engine/resource.py", line 798, in delete_snapshot
    yield self.action_handler_task('delete_snapshot', args=[data])
  File "/opt/stack/heat/heat/engine/scheduler.py", line 295, in wrapper
    step = next(subtask)
  File "/opt/stack/heat/heat/engine/resource.py", line 506, in action_handler_task
    handler_data = handler(*args)
  File "/opt/stack/heat/heat/engine/resources/server.py", line 1179, in handle_delete_snapshot
    image_id = snapshot['resource_data']['snapshot_image_id']
KeyError: 'snapshot_image_id'