Flavor create and update with service_profiles is not working properly

Bug #1606431 reported by Rahmad Ade Putra
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Won't Fix
Undecided
Rahmad Ade Putra

Bug Description

1. When creating a new Flavor with service_profiles, is not working properly due the it showing empty service_profiles, I entered the correct UUID of service_profiles, however the UUID of service_profiles is empty.

2. And another happened when I try to update the existing of Flavor by inserting the UUID of service_profiles, the 500 Internal Server Error occured.

Here are my log from the first one (Creating new Falvor with service_profiles) and then the second one (Update Existing Flavor by Inserting service_profiles)

----------------------------

Creating a new Flavor with service_profiles

vagrant@ubuntu:~$ curl -g -i -X POST http://192.168.122.139:9696/v2.0/flavors -H "X-Auth-Token: $TOKEN" -d '{"flavor": {"service_type":"LOADBALANCER","enabled":"true"name":"flavor-test","service_profiles":["8e843ed6-cbd0-4ede-b765-d98e765f1135"]}}'
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 173
X-Openstack-Request-Id: req-6f3047a4-07e9-4dbe-b22a-b61ba167f705
Date: Mon, 25 Jul 2016 16:12:41 GMT

{"flavor": {"description": "", "enabled": true, "service_profiles": [], "service_type": "LOADBALANCER", "id": "79eaa203-5913-41b0-92c5-d6c2a0211a9c", "name": "flavor-test"}}

-----------------------------
Update Existing Flavor By Inserting service_profiles

vagrant@ubuntu:~$ curl -g -i -X PUT http://192.168.122.139:9696/v2.0/flavors/79eaa203-5913-41b0-92c5-d6c2a0211a9c -H "X-Auth-Token: $TOKEN" -d '{"flavor": {"enabled":"false","service_profiles":["8e843ed6-cbd0-4ede-b765-d98e765f1135"]}}'
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
Content-Length: 150
X-Openstack-Request-Id: req-d8581b95-a798-4d83-9980-414892553cd3
Date: Mon, 25 Jul 2016 17:18:56 GMT

2016-07-25 17:18:54.470 24209 DEBUG oslo_messaging._drivers.amqpdriver [-] received message msg_id: 6cc709305c994ebb8cdb5dfaf4c834de reply to reply_723cd8289b3c4bee83fce502f5443d1f __call__ /usr/local/lib/python2.7/dist-packages/oslo_messaging/_drivers/amqpdriver.py:194
2016-07-25 17:18:54.504 24209 DEBUG neutron.callbacks.manager [req-b891a9a7-e059-41f9-8989-c7f8e1d05696 - - - - -] Notify callbacks for agent, after_update _notify_loop /opt/stack/neutron/neutron/callbacks/manager.py:140
2016-07-25 17:18:54.505 24209 DEBUG neutron.callbacks.manager [req-b891a9a7-e059-41f9-8989-c7f8e1d05696 - - - - -] Calling callback neutron.services.segments.db._update_segment_host_mapping_for_agent _notify_loop /opt/stack/neutron/neutron/callbacks/manager.py:147
2016-07-25 17:18:54.507 24209 DEBUG oslo_messaging._drivers.amqpdriver [req-b891a9a7-e059-41f9-8989-c7f8e1d05696 - - - - -] sending reply msg_id: 6cc709305c994ebb8cdb5dfaf4c834de reply queue: reply_723cd8289b3c4bee83fce502f5443d1f time elapsed: 0.0361202930799s _send_reply /usr/local/lib/python2.7/dist-packages/oslo_messaging/_drivers/amqpdriver.py:73
2016-07-25 17:18:56.457 24207 DEBUG neutron.wsgi [-] (24207) accepted ('192.168.122.139', 56619) server /usr/local/lib/python2.7/dist-packages/eventlet/wsgi.py:868
2016-07-25 17:18:56.650 24207 DEBUG neutron.api.v2.base [req-b42a4171-1c3d-4e67-a375-c5ce7c08546b e01bc3eadeb045edb02fc6b2af4b5d49 867929bfedca4a719e17a7f3293845de - - -] Request body: {u'flavor': {u'service_profiles': [u'8e843ed6-cbd0-4ede-b765-d98e765f1135'], u'enabled': u'false'}} prepare_request_body /opt/stack/neutron/neutron/api/v2/base.py:649
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource [req-b42a4171-1c3d-4e67-a375-c5ce7c08546b e01bc3eadeb045edb02fc6b2af4b5d49 867929bfedca4a719e17a7f3293845de - - -] update failed: No details.
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource Traceback (most recent call last):
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/resource.py", line 79, in resource
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource result = method(request=request, **args)
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/base.py", line 571, in update
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource return self._update(request, id, body, **kwargs)
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 148, in wrapper
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource ectxt.value = e.inner_exc
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource self.force_reraise()
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 138, in wrapper
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource return f(*args, **kwargs)
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/base.py", line 617, in _update
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource obj = obj_updater(request.context, id, **kwargs)
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/flavors_db.py", line 142, in update_flavor
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource fl_db.update(fl)
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/sqlalchemy/models.py", line 94, in update
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource setattr(self, k, v)
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/attributes.py", line 224, in __set__
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource instance_dict(instance), value, None)
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/attributes.py", line 1027, in set
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource lambda adapter, i: adapter.adapt_like_to_iterable(i))
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/attributes.py", line 1062, in _set_iterable
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource collections.bulk_replace(new_values, old_collection, new_collection)
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/collections.py", line 791, in bulk_replace
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource new_adapter.append_with_event(member)
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/collections.py", line 654, in append_with_event
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource self._data()._sa_appender(item, _sa_initiator=initiator)
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/collections.py", line 1073, in append
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource item = __set(self, item, _sa_initiator)
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/collections.py", line 1045, in __set
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource item = executor.fire_append_event(item, _sa_initiator)
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/collections.py", line 717, in fire_append_event
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource item, initiator)
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/attributes.py", line 941, in fire_append_event
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource initiator or self._append_token or self._init_append_token())
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 42, in append
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource item_state = attributes.instance_state(item)
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource AttributeError: 'unicode' object has no attribute '_sa_instance_state'
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource
2016-07-25 17:18:56.685 24207 INFO neutron.wsgi [req-b42a4171-1c3d-4e67-a375-c5ce7c08546b e01bc3eadeb045edb02fc6b2af4b5d49 867929bfedca4a719e17a7f3293845de - - -] 192.168.122.139 - - [25/Jul/2016 17:18:56] "PUT /v2.0/flavors/79eaa203-5913-41b0-92c5-d6c2a0211a9c HTTP/1.1" 500 344 0.225392

tags: removed: flavor
Changed in neutron:
assignee: nobody → Rahmad Ade Putra (leksokmy)
Revision history for this message
Jakub Libosvar (libosvar) wrote :

Can you please attach a full traceback and full body of what was sent to API when updating service_profiles?

Changed in neutron:
status: New → Incomplete
description: updated
Revision history for this message
Rahmad Ade Putra (leksokmy) wrote :

Hi Jakub,

I have already updated traceback and also my request parameters which already sent to the API when updating service_profiles

Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

Bug closed due to lack of activity, please feel free to reopen if needed.

Changed in neutron:
status: Incomplete → Won't Fix
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.