ignore_not_found not working on ceilometer client

Bug #1361128 reported by Qiming Teng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Undecided
Qiming Teng
python-ceilometerclient
New
Undecided
Unassigned

Bug Description

For some reason, ceilometer alarms created in a stack disappeared before I tried to delete the stack. When I tried, I got the following errors and trace from Heat engine:

  $ heat stack-list
  +--------------------------------------+------------+---------------+----------------------+
  | id | stack_name | stack_status | creation_time |
  +--------------------------------------+------------+---------------+----------------------+
  | 25a4ea04-52b1-49a8-b323-b796b91faa09 | asg-aws | DELETE_FAILED | 2014-08-25T08:31:31Z |
  +--------------------------------------+------------+---------------+----------------------+

  $ heat event-list asg-aws

  +--------------------------+--------------------------------------+--------------------------------+--------------------+----------------------+
  | resource_name | id | resource_status_reason | resource_status | event_time |
  +--------------------------+--------------------------------------+--------------------------------+--------------------+----------------------+
  | CPUAlarmLow | acc49bdd-cef4-4d22-a713-a99323ff9eda | NotFound: Not Found (HTTP 404) | DELETE_FAILED | 2014-08-25T08:45:06Z |
  | CPUAlarmLow | c612c835-bf25-4e54-a62e-490d6c4fb483 | state changed | DELETE_IN_PROGRESS | 2014-08-25T08:45:06Z |
  ...

<h-eng log>

2014-08-25 16:45:06.558 INFO heat.engine.resource [-] DELETE: CeilometerAlarm "CPUAlarmLow" [03a45e9c-5098-40e2-b5b5-b5228b3fe8d9] Stack "asg-aws" [25a4ea04-52b1-49a8-b323-b796b91faa09]
2014-08-25 16:45:06.558 TRACE heat.engine.resource Traceback (most recent call last):
2014-08-25 16:45:06.558 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 423, in _action_recorder
2014-08-25 16:45:06.558 TRACE heat.engine.resource yield
2014-08-25 16:45:06.558 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 813, in delete
2014-08-25 16:45:06.558 TRACE heat.engine.resource yield self.action_handler_task(action, *action_args)
2014-08-25 16:45:06.558 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/scheduler.py", line 262, in wrapper
2014-08-25 16:45:06.558 TRACE heat.engine.resource step = next(subtask)
2014-08-25 16:45:06.558 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 464, in action_handler_task
2014-08-25 16:45:06.558 TRACE heat.engine.resource handler_data = handler(*args)
2014-08-25 16:45:06.558 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/ceilometer/alarm.py", line 200, in handle_delete
2014-08-25 16:45:06.558 TRACE heat.engine.resource self.client_plugin().ignore_not_found(ex)
2014-08-25 16:45:06.558 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/clients/client_plugin.py", line 79, in ignore_not_found
2014-08-25 16:45:06.558 TRACE heat.engine.resource raise ex
2014-08-25 16:45:06.558 TRACE heat.engine.resource NotFound: Not Found (HTTP 404)
2014-08-25 16:45:06.558 TRACE heat.engine.resource

This means that the expected 'ignore_not_found()' logic didn't work as expected, and the exception is blocking me from deleting the stack.

Revision history for this message
Qiming Teng (tengqim) wrote :

After digging into this, I found that ceilometer client cannot recognize a NotFound exception from (ceilometerclient.openstack.common.apiclient.exceptions.NotFound module), because it can only recognize HTTPNotFound (from ceilometerclient.exc module).

Qiming Teng (tengqim)
Changed in heat:
assignee: nobody → Qiming Teng (tengqim)
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/116896

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

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

commit f620834132a16647e62b2a78419fe30d579ca669
Author: tengqm <email address hidden>
Date: Tue Aug 26 09:32:13 2014 +0800

    Additional exception type check for ceilo-client

    This adds additional exception type checking for ceilometer client.
    In addition to previous HTTPNotFound exception, ceilometer client lib
    may throw an apiclient.NotFound exception directly. Both cases should
    be treated as 'valid' results from HTTP 404, so that the
    ignore-not-found logic in Heat can work using either version of
    ceilometer client.

    Change-Id: Iedd061afe0cf039d5070257caf0d5a726213a8af
    Closes-Bug: 1361128

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: none → juno-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: juno-3 → 2014.2
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.