self.properties not resolved by translate_rules while resource update

Bug #1586378 reported by Dmitriy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Dmitriy

Bug Description

I need self.properties to be resolved when I'm doing resource update.
For example, pool from lbaas2-neutron fails on update if listener property was stated by name, not by id.
Traceback:
2016-05-26 18:55:09.434 INFO heat.engine.resource [req-f1f71a20-8771-4148-87b3-5ef3311f4c4e None demo] updating Pool "l7rule" [34070e75-f786-4595-a6a2-9a3d37ca48fb] Stack "test_pool_1" [f19ded57-b4b7-431c-
88d7-d9f6ad737ca3]
2016-05-26 18:55:09.541 DEBUG heat.engine.scheduler [req-f1f71a20-8771-4148-87b3-5ef3311f4c4e None demo] Task update_task from Stack "test_pool_1" [f19ded57-b4b7-431c-88d7-d9f6ad737ca3] sleeping from (pid=
10751) _sleep /opt/stack/heat/heat/engine/scheduler.py:168
2016-05-26 18:55:10.541 DEBUG heat.engine.scheduler [req-f1f71a20-8771-4148-87b3-5ef3311f4c4e None demo] Task update_task from Stack "test_pool_1" [f19ded57-b4b7-431c-88d7-d9f6ad737ca3] running from (pid=1
0751) step /opt/stack/heat/heat/engine/scheduler.py:226
2016-05-26 18:55:10.542 DEBUG heat.engine.scheduler [req-f1f71a20-8771-4148-87b3-5ef3311f4c4e None demo] Task Stack "test_pool_1" [f19ded57-b4b7-431c-88d7-d9f6ad737ca3] Update running from (pid=10751) step
 /opt/stack/heat/heat/engine/scheduler.py:226
2016-05-26 18:55:10.542 DEBUG heat.engine.scheduler [req-f1f71a20-8771-4148-87b3-5ef3311f4c4e None demo] Task _resource_update from Stack "test_pool_1" [f19ded57-b4b7-431c-88d7-d9f6ad737ca3] Update running
 from (pid=10751) step /opt/stack/heat/heat/engine/scheduler.py:226
2016-05-26 18:55:10.544 DEBUG neutronclient.client [req-f1f71a20-8771-4148-87b3-5ef3311f4c4e None demo] REQ: curl -i http://192.168.122.166:9696//v2.0/lbaas/pools/34070e75-f786-4595-a6a2-9a3d37ca48fb.json
-X PUT -H "User-Agent: python-neutronclient" -H "X-Auth-Token: {SHA1}24f9464d8ca76e5c5c002148f0ed56078050a22c" -d '{"pool": {"lb_algorithm": "LEAST_CONNECTIONS"}}' from (pid=10751) http_log_req /usr/local/
lib/python2.7/dist-packages/neutronclient/common/utils.py:185
2016-05-26 18:55:11.777 DEBUG neutronclient.client [req-f1f71a20-8771-4148-87b3-5ef3311f4c4e None demo] RESP: 200 {'Date': 'Thu, 26 May 2016 15:55:11 GMT', 'Content-Length': '448', 'Connection': 'keep-aliv
e', 'Content-Type': 'application/json', 'X-Openstack-Request-Id': 'req-5c91e84c-3ed7-4ef5-bd36-d98ae1b2f69b'} {"pool": {"lb_algorithm": "LEAST_CONNECTIONS", "protocol": "HTTP", "description": "", "admin_st
ate_up": true, "loadbalancers": [{"id": "799e2a53-6c96-4773-a6b9-7dc90810da84"}], "tenant_id": "1b6e6f8994184d8080ec0a3c0f0bf815", "session_persistence": null, "healthmonitor_id": null, "listeners": [{"id"
: "03b3b29e-84bc-4c97-860f-849a93acfd9d"}], "members": [], "id": "34070e75-f786-4595-a6a2-9a3d37ca48fb", "name": "test_pool_1-l7rule-tabj2lcd4fzh"}} from (pid=10751) http_log_resp /usr/local/lib/python2.7/
dist-packages/neutronclient/common/utils.py:194
2016-05-26 18:55:11.779 DEBUG neutronclient.client [req-f1f71a20-8771-4148-87b3-5ef3311f4c4e None demo] REQ: curl -i http://192.168.122.166:9696//v2.0/lbaas/listeners/test_listener.json -X GET -H "User-Age
nt: python-neutronclient" -H "X-Auth-Token: {SHA1}24f9464d8ca76e5c5c002148f0ed56078050a22c" from (pid=10751) http_log_req /usr/local/lib/python2.7/dist-packages/neutronclient/common/utils.py:185
2016-05-26 18:55:12.005 DEBUG neutronclient.client [req-f1f71a20-8771-4148-87b3-5ef3311f4c4e None demo] RESP: 404 {'Date': 'Thu, 26 May 2016 15:55:12 GMT', 'Content-Length': '114', 'Connection': 'keep-aliv
e', 'Content-Type': 'application/json', 'X-Openstack-Request-Id': 'req-e83826e2-38d1-4f9f-99df-6bd90aebc0de'} {"NeutronError": {"message": "listener test_listener could not be found", "type": "EntityNotFou
nd", "detail": ""}} from (pid=10751) http_log_resp /usr/local/lib/python2.7/dist-packages/neutronclient/common/utils.py:194
2016-05-26 18:55:12.005 DEBUG neutronclient.v2_0.client [req-f1f71a20-8771-4148-87b3-5ef3311f4c4e None demo] Error message: {"NeutronError": {"message": "listener test_listener could not be found", "type":
 "EntityNotFound", "detail": ""}} from (pid=10751) _handle_fault_response /usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py:247
2016-05-26 18:55:12.006 INFO heat.engine.resource [req-f1f71a20-8771-4148-87b3-5ef3311f4c4e None demo] UPDATE: Pool "l7rule" [34070e75-f786-4595-a6a2-9a3d37ca48fb] Stack "test_pool_1" [f19ded57-b4b7-431c-8
8d7-d9f6ad737ca3]
2016-05-26 18:55:12.006 TRACE heat.engine.resource Traceback (most recent call last):
2016-05-26 18:55:12.006 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 716, in _action_recorder
2016-05-26 18:55:12.006 TRACE heat.engine.resource yield
2016-05-26 18:55:12.006 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 1170, in update
2016-05-26 18:55:12.006 TRACE heat.engine.resource prop_diff])
2016-05-26 18:55:12.006 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/scheduler.py", line 329, in wrapper
2016-05-26 18:55:12.006 TRACE heat.engine.resource step = next(subtask)
2016-05-26 18:55:12.006 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 764, in action_handler_task
2016-05-26 18:55:12.006 TRACE heat.engine.resource done = check(handler_data)
2016-05-26 18:55:12.006 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/openstack/neutron/lbaas/pool.py", line 242, in check_update_complete
2016-05-26 18:55:12.006 TRACE heat.engine.resource return self._check_lb_status()
2016-05-26 18:55:12.006 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/openstack/neutron/lbaas/pool.py", line 193, in _check_lb_status
2016-05-26 18:55:12.006 TRACE heat.engine.resource return self.client_plugin().check_lb_status(self.lb_id)
2016-05-26 18:55:12.006 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/openstack/neutron/lbaas/pool.py", line 163, in lb_id
2016-05-26 18:55:12.006 TRACE heat.engine.resource listener = self.client().show_listener(listener_id)['listener']
2016-05-26 18:55:12.006 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 986, in show_listener
2016-05-26 18:55:12.006 TRACE heat.engine.resource params=_params)
2016-05-26 18:55:12.006 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 343, in get
2016-05-26 18:55:12.006 TRACE heat.engine.resource headers=headers, params=params)
2016-05-26 18:55:12.006 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 320, in retry_request
2016-05-26 18:55:12.006 TRACE heat.engine.resource headers=headers, params=params)
2016-05-26 18:55:12.006 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 283, in do_request
2016-05-26 18:55:12.006 TRACE heat.engine.resource self._handle_fault_response(status_code, replybody, resp)
2016-05-26 18:55:12.006 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 257, in _handle_fault_response
2016-05-26 18:55:12.006 TRACE heat.engine.resource exception_handler_v20(status_code, error_body)
2016-05-26 18:55:12.006 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 84, in exception_handler_v20
2016-05-26 18:55:12.006 TRACE heat.engine.resource request_ids=request_ids)
2016-05-26 18:55:12.006 TRACE heat.engine.resource NotFound: listener test_listener could not be found
2016-05-26 18:55:12.006 TRACE heat.engine.resource Neutron server returns request_ids: ['req-e83826e2-38d1-4f9f-99df-6bd90aebc0de']

Dmitriy (duvarenkov)
Changed in heat:
assignee: nobody → Dmitriy (duvarenkov)
Revision history for this message
Rabi Mishra (rabi) wrote :

As the lb_id property uses self.properties, doing the following in handle_update would probably solve the issue.

self.properties = json_snippet.properties(self.properties_schema,
self.context)

Changed in heat:
importance: Undecided → Medium
Revision history for this message
Dmitriy (duvarenkov) wrote :

I also have such solution:
add `self.translate_properties(self.properties)`
before line yield `self.action_handler_task(action, args=[after, tmpl_diff, prop_diff])`
in resource.py update method.

Don't know which solution is better.

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/323461

Changed in heat:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on heat (master)

Change abandoned by Dmitriy Uvarenkov (<email address hidden>) on branch: master
Review: https://review.openstack.org/323461

Revision history for this message
Dmitriy (duvarenkov) wrote :

Looks like this patch https://review.openstack.org/#/c/325784/ fixes described problem. At least, I don't stumble in error described in bug with this patch.

Revision history for this message
Zane Bitter (zaneb) wrote :

Resolved by fix for bug 1584623.

Changed in heat:
status: In Progress → Fix Released
milestone: none → newton-3
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.