running "heat event-show" returns "Stack not found" for existing stacks

Bug #1242947 reported by Chris Friesen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-heatclient
Fix Released
Low
Angus Salkeld

Bug Description

I'm testing with "master" branch of git devstack running on Ubuntu 12.04.

I started up a stack based on "WordPress_Single_Instance_With_HA.template", named "teststack2". I then shut down the httpd service several times in a row to test the HA behaviour.

At this point running "heat event-list teststack2" gave the following:

cfriesen@ubuntudevstack:~/devstack$ heat event-list teststack2
+------------------------+----+------------------------------+--------------------+----------------------+
| resource_name | id | resource_status_reason | resource_status | event_time |
+------------------------+----+------------------------------+--------------------+----------------------+
| CfnUser | 69 | state changed | CREATE_IN_PROGRESS | 2013-10-21T22:06:49Z |
| WaitHandle | 70 | state changed | CREATE_IN_PROGRESS | 2013-10-21T22:06:49Z |
| WaitHandle | 71 | state changed | CREATE_COMPLETE | 2013-10-21T22:06:49Z |
| CfnUser | 72 | state changed | CREATE_COMPLETE | 2013-10-21T22:06:49Z |
| WebServerKeys | 73 | state changed | CREATE_IN_PROGRESS | 2013-10-21T22:06:49Z |
| WebServerKeys | 74 | state changed | CREATE_COMPLETE | 2013-10-21T22:06:50Z |
| WikiDatabase | 75 | state changed | CREATE_IN_PROGRESS | 2013-10-21T22:06:50Z |
| WikiDatabase | 76 | state changed | CREATE_COMPLETE | 2013-10-21T22:06:55Z |
| WaitCondition | 77 | state changed | CREATE_IN_PROGRESS | 2013-10-21T22:06:55Z |
| WebServerRestartPolicy | 78 | state changed | CREATE_IN_PROGRESS | 2013-10-21T22:06:55Z |
| WebServerRestartPolicy | 79 | state changed | CREATE_COMPLETE | 2013-10-21T22:06:56Z |
| HttpFailureAlarm | 80 | state changed | CREATE_IN_PROGRESS | 2013-10-21T22:06:56Z |
| HttpFailureAlarm | 81 | state changed | CREATE_COMPLETE | 2013-10-21T22:06:57Z |
| WaitCondition | 82 | state changed | CREATE_COMPLETE | 2013-10-21T22:27:53Z |
| WebServerRestartPolicy | 83 | alarm state changed to ALARM | signal_COMPLETE | 2013-10-21T23:13:54Z |
| HttpFailureAlarm | 84 | state changed | DELETE_IN_PROGRESS | 2013-10-21T23:13:54Z |
| HttpFailureAlarm | 85 | state changed | DELETE_COMPLETE | 2013-10-21T23:13:54Z |
| WaitCondition | 86 | state changed | DELETE_IN_PROGRESS | 2013-10-21T23:13:54Z |
| WaitCondition | 87 | state changed | DELETE_COMPLETE | 2013-10-21T23:13:54Z |

I then tried to show the details for event 83, and was successful:

cfriesen@ubuntudevstack:~/devstack$ heat event-show teststack2 WebServerRestartPolicy 83
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Property | Value |
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| event_time | 2013-10-21T23:13:54Z |
| id | 83 |
| links | http://192.168.2.118:8004/v1/7b3a6ca58cb142e8b48cfc72aa64109d/stacks/teststack2/9a7f581c-3017-4aa0-b3fc-90266f303296/resources/WebServerRestartPolicy/events/83 |
| | http://192.168.2.118:8004/v1/7b3a6ca58cb142e8b48cfc72aa64109d/stacks/teststack2/9a7f581c-3017-4aa0-b3fc-90266f303296/resources/WebServerRestartPolicy |
| | http://192.168.2.118:8004/v1/7b3a6ca58cb142e8b48cfc72aa64109d/stacks/teststack2/9a7f581c-3017-4aa0-b3fc-90266f303296 |
| logical_resource_id | WebServerRestartPolicy |
| physical_resource_id | 3de87cf8273c41c8a9c49c491e6c8fc2 |
| resource_name | WebServerRestartPolicy |
| resource_properties | { |
| | "InstanceId": "e6c5a7f0-c1f0-4016-b84c-59f8694437c9" |
| | } |
| resource_status | signal_COMPLETE |
| resource_status_reason | alarm state changed to ALARM |
| resource_type | OS::Heat::HARestarter |
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+

But when I tried to see the details for event 81, I got a weird error:

cfriesen@ubuntudevstack:~/devstack$ heat event-show teststack2 WebServerRestartPolicy 81
Stack not found: teststack2

The stack is still there, other commands work, but for some reason trying to do event-show on some events gives this error.

Chris Friesen (cbf123)
description: updated
Revision history for this message
Steve Baker (steve-stevebaker) wrote :

What happens when you specify the stack id instead of the stack name?

Revision history for this message
Chris Friesen (cbf123) wrote :

I don't have the original stack around anymore, but I recreated something similar and it didn't make any difference if I used the stack ID or the stack name--both cases gave "Stack not found".

Revision history for this message
Angus Salkeld (asalkeld) wrote :

from the listing:

| HttpFailureAlarm | 81 | state changed | CREATE_COMPLETE | 2013-10-21T22:06:57Z |

heat event-show teststack2 WebServerRestartPolicy 81

Stack not found: teststack2

this should be event not found, as you have passed in the incorrect resource name.

Changed in heat:
status: New → Triaged
importance: Undecided → Low
milestone: none → icehouse-1
assignee: nobody → Angus Salkeld (asalkeld)
Revision history for this message
Angus Salkeld (asalkeld) wrote :

from the heat-api server:

2013-10-29 15:58:14.308 ERROR root [-] Returning 404 to user: The resource could not be found.
2013-10-29 15:58:14.309 DEBUG root [-] JSON response : {"explanation": "No event 11 found", "code": 404, "error": {"message": "No event 11 found", "traceback": " File \"/home/asalkeld/work/heat/heat/common/wsgi.py\", line 661, in __call__\n request, **action_args)\n File \"/home/asalkeld/work/heat/heat/common/wsgi.py\", line 729, in dispatch\n return method(*args, **kwargs)\n File \"/home/asalkeld/work/heat/heat/api/openstack/v1/util.py\", line 30, in handle_stack_method\n return handler(controller, req, **kwargs)\n File \"/home/asalkeld/work/heat/heat/api/openstack/v1/util.py\", line 46, in handle_stack_method\n return handler(controller, req, dict(stack_identity), **kwargs)\n File \"/home/asalkeld/work/heat/heat/api/openstack/v1/events.py\", line 121, in show\n raise exc.HTTPNotFound(_('No event %s found') % event_id)\n", "type": "HTTPNotFound"}, "title": "Not Found"} from (pid=18232) to_json /home/asalkeld/work/heat/heat/common/wsgi.py:562

seems to be returning the correct thing.
I'll move the bug to python-heatclient

affects: heat → python-heatclient
Changed in python-heatclient:
milestone: icehouse-1 → none
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-heatclient (master)

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

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

Reviewed: https://review.openstack.org/54231
Committed: http://github.com/openstack/python-heatclient/commit/fce6777081506361add28e8e403c0db222b5c836
Submitter: Jenkins
Branch: master

commit fce6777081506361add28e8e403c0db222b5c836
Author: Angus Salkeld <email address hidden>
Date: Tue Oct 29 16:11:44 2013 +1100

    Print a more correct error with event-show

    Just print out what the server sent us as the
    error could be wrong:
    - stack_name/id
    - resource name
    - event id

    Change-Id: Ie48a549538a9809c8433b115537394a791d60147
    Closes-bug: #1242947

Changed in python-heatclient:
status: In Progress → Fix Committed
Changed in python-heatclient:
milestone: none → v0.2.6
Changed in python-heatclient:
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.