If qos service_plugin is enabled, but ml2 extension driver is not, api requests attaching policies to ports or nets will fail with an ugly exception

Bug #1496787 reported by Miguel Angel Ajo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Slawek Kaplonski

Bug Description

$ neutron port-update b0885ae1-487b-40bc-8fc0-32432a21e39d --qos-policy bw-limiter
Request Failed: internal server error while processing your request.

Neutron Exception:

DEBUG neutron.api.v2.base [req-218cddfd-2b7d-4050-91db-251c139029b2 admin 85b859134de2428d94f6ee910dc545d8] Request body: {u'port': {u'qos_policy_id': u'0ee1c673-5671-40ca-b55f-4cd4bbd999c7'}} from (pid=18237) prepare_request_body /opt/stack/neutron/neutron/api/v2/base.py:645
2015-09-15 01:05:26.022 ERROR neutron.api.v2.resource [req-218cddfd-2b7d-4050-91db-251c139029b2 admin 85b859134de2428d94f6ee910dc545d8] update failed
2015-09-15 01:05:26.022 TRACE neutron.api.v2.resource Traceback (most recent call last):
2015-09-15 01:05:26.022 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/resource.py", line 83, in resource
2015-09-15 01:05:26.022 TRACE neutron.api.v2.resource result = method(request=request, **args)
2015-09-15 01:05:26.022 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 146, in wrapper
2015-09-15 01:05:26.022 TRACE neutron.api.v2.resource ectxt.value = e.inner_exc
2015-09-15 01:05:26.022 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 195, in __exit__
2015-09-15 01:05:26.022 TRACE neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2015-09-15 01:05:26.022 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 136, in wrapper
2015-09-15 01:05:26.022 TRACE neutron.api.v2.resource return f(*args, **kwargs)
2015-09-15 01:05:26.022 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/base.py", line 613, in update
2015-09-15 01:05:26.022 TRACE neutron.api.v2.resource obj = obj_updater(request.context, id, **kwargs)
2015-09-15 01:05:26.022 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/plugins/ml2/plugin.py", line 1158, in update_port
2015-09-15 01:05:26.022 TRACE neutron.api.v2.resource original_port[qos_consts.QOS_POLICY_ID] !=
2015-09-15 01:05:26.022 TRACE neutron.api.v2.resource KeyError: 'qos_policy_id'
2015-09-15 01:05:26.022 TRACE neutron.api.v2.resource
2015-09-15 01:05:26.026 INFO neutron.wsgi [req-218cddfd-2b7d-4050-91db-251c139029b2 admin 85b859134de2428d94f6ee910dc545d8] 172.16.175.128 - - [15/Sep/2015 01:05:26] "PUT /v2.0/ports/b0885ae1-487b-40bc-8fc0-32432a21e39d.json HTTP/1.1" 500 383 0.084317

Tags: qos
Revision history for this message
Miguel Angel Ajo (mangelajo) wrote :

bug report details received from Edgar Magana, confirmed by me.

Changed in neutron:
assignee: nobody → Miguel Angel Ajo (mangelajo)
status: New → Confirmed
tags: added: qos
Revision history for this message
Miguel Angel Ajo (mangelajo) wrote :

We need to provide a better exception, this issue will go away when we have core resource extensions in core neutron (not only ml2)

Revision history for this message
Assaf Muller (amuller) wrote :

Is it possible for QoS service plugin to check if the ML2 extension is enabled, and if not, print an error and shut down the server?

Changed in neutron:
importance: Undecided → Low
Revision history for this message
Miguel Angel Ajo (mangelajo) wrote :

@assaf, that makes sense as a short-term solution, I'd remove it in the future when we have core resource extension in
neutron core: the service would declare itself the provider of the such extension (otherwise without the service plugin installed it doesn't make sense).

If that wasn't the case I'd say: we're coupling qos too much into Ml2, but that's what we have now, so we can check

1) if ml2 is the installed plugin:
    b) check if qos extension driver is enabled.

Changed in neutron:
assignee: Miguel Angel Ajo (mangelajo) → nobody
Changed in neutron:
assignee: nobody → Slawek Kaplonski (slaweq)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

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

Reviewed: https://review.openstack.org/253853
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=c615c6f3a7a05dac8684366dde78080f347964dd
Submitter: Jenkins
Branch: master

commit c615c6f3a7a05dac8684366dde78080f347964dd
Author: Sławek Kapłoński <email address hidden>
Date: Sun Dec 6 00:11:46 2015 +0100

    ML2: verify if required extension drivers are loaded

    This change ensures extension drivers required by service plugins are loaded
    when using ML2 plugin: we check that ML2 loads QoS extension driver when QoS
    service plugin is enabled.

    Change-Id: Ibf19e77b88ce34c58519ae157c852c9e2b30e31f
    Closes-bug: #1496787

Changed in neutron:
status: In Progress → 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.