Update of LB Pool's HealthMonitors in broken

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

Bug Description

Issuing stack-update that updates the list of associated health monitors of the LB Pool fails the update with the following message logged in heat-engine:

DEBUG neutronclient.client [-] RESP:{'status': '200'} <head>
<title>Error response</title>
</head>
<body>
<h1>Error response</h1>
<p>Error code 400.
<p>Message: Bad request syntax ("DELETE //v2.0/lb/pools/efef67e5-9fb3-41d8-b191-97ea9971ea06/health_monitors/{'health_monitor': {'id': u'545d4464-f5f8-48e3-9e72-bb8765b359bc'}}.json HTTP/1.1").
<p>Error code explanation: 400 = Bad request syntax or unsupported method.
</body>

 from (pid=26728) http_log_resp /opt/stack/python-neutronclient/neutronclient/common/utils.py:179
2014-03-13 15:21:04.905 ERROR heat.engine.resource [-] update Pool "Pool" [efef67e5-9fb3-41d8-b191-97ea9971ea06] Stack "pool" [3675f073-72a1-4c6f-aa39-2c8f338a9797] : Malformed request body: Cannot understand JSON
2014-03-13 15:21:04.905 TRACE heat.engine.resource Traceback (most recent call last):
2014-03-13 15:21:04.905 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 553, in update
2014-03-13 15:21:04.905 TRACE heat.engine.resource handle_data = self.handle_update(after, tmpl_diff, prop_diff)
2014-03-13 15:21:04.905 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/neutron/loadbalancer.py", line 389, in handle_update
2014-03-13 15:21:04.905 TRACE heat.engine.resource self.resource_id, {'health_monitor': {'id': monitor}})
2014-03-13 15:21:04.905 TRACE heat.engine.resource File "/opt/stack/python-neutronclient/neutronclient/v2_0/client.py", line 111, in with_params
2014-03-13 15:21:04.905 TRACE heat.engine.resource ret = self.function(instance, *args, **kwargs)
2014-03-13 15:21:04.905 TRACE heat.engine.resource File "/opt/stack/python-neutronclient/neutronclient/v2_0/client.py", line 748, in disassociate_health_monitor
2014-03-13 15:21:04.905 TRACE heat.engine.resource return self.delete(path)
2014-03-13 15:21:04.905 TRACE heat.engine.resource File "/opt/stack/python-neutronclient/neutronclient/v2_0/client.py", line 1232, in delete
2014-03-13 15:21:04.905 TRACE heat.engine.resource headers=headers, params=params)
2014-03-13 15:21:04.905 TRACE heat.engine.resource File "/opt/stack/python-neutronclient/neutronclient/v2_0/client.py", line 1221, in retry_request
2014-03-13 15:21:04.905 TRACE heat.engine.resource headers=headers, params=params)
2014-03-13 15:21:04.905 TRACE heat.engine.resource File "/opt/stack/python-neutronclient/neutronclient/v2_0/client.py", line 1162, in do_request
2014-03-13 15:21:04.905 TRACE heat.engine.resource return self.deserialize(replybody, status_code)
2014-03-13 15:21:04.905 TRACE heat.engine.resource File "/opt/stack/python-neutronclient/neutronclient/v2_0/client.py", line 1200, in deserialize
2014-03-13 15:21:04.905 TRACE heat.engine.resource data, self.content_type())['body']
2014-03-13 15:21:04.905 TRACE heat.engine.resource File "/opt/stack/python-neutronclient/neutronclient/common/serializer.py", line 398, in deserialize
2014-03-13 15:21:04.905 TRACE heat.engine.resource datastring)
2014-03-13 15:21:04.905 TRACE heat.engine.resource File "/opt/stack/python-neutronclient/neutronclient/common/serializer.py", line 214, in deserialize
2014-03-13 15:21:04.905 TRACE heat.engine.resource return self.dispatch(datastring, action=action)
2014-03-13 15:21:04.905 TRACE heat.engine.resource File "/opt/stack/python-neutronclient/neutronclient/common/serializer.py", line 40, in dispatch
2014-03-13 15:21:04.905 TRACE heat.engine.resource return action_method(*args, **kwargs)
2014-03-13 15:21:04.905 TRACE heat.engine.resource File "/opt/stack/python-neutronclient/neutronclient/common/serializer.py", line 230, in default
2014-03-13 15:21:04.905 TRACE heat.engine.resource return {'body': self._from_json(datastring)}
2014-03-13 15:21:04.905 TRACE heat.engine.resource File "/opt/stack/python-neutronclient/neutronclient/common/serializer.py", line 227, in _from_json
2014-03-13 15:21:04.905 TRACE heat.engine.resource raise exception.MalformedRequestBody(reason=msg)
2014-03-13 15:21:04.905 TRACE heat.engine.resource MalformedRequestBody: Malformed request body: Cannot understand JSON

Revision history for this message
Pavlo Shchelokovskyy (pshchelo) wrote :

the reason seems that disassociate_health_monitor() takes the monitor id as the second argument [1] and not the json request body as associate_health_monitor() does (and that is what the code currently does)

[1] https://github.com/openstack/python-neutronclient/blob/master/neutronclient/v2_0/client.py#L744

Changed in heat:
assignee: nobody → Pavlo Shchelokovskyy (pshchelo)
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/80318

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/80318
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=1427ae027c346a6e7578e3f12f0ddc4bcd0139ff
Submitter: Jenkins
Branch: master

commit 1427ae027c346a6e7578e3f12f0ddc4bcd0139ff
Author: Pavlo Shchelokovskyy <email address hidden>
Date: Thu Mar 13 15:31:15 2014 +0000

    Fix update of Pool's list of HealthMonitors

    It was broken as it was calling disassociate_health_monitor() with wrong
    arguments (json request body instead of monitor id).

    Change-Id: I5dd1175fa41256cf27b565d2429d099524204a9d
    Closes-Bug: #1292058

Changed in heat:
status: In Progress → Fix Committed
Thomas Herve (therve)
Changed in heat:
milestone: none → icehouse-rc1
importance: Undecided → Medium
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: icehouse-rc1 → 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.