← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1622574] [NEW] Metering-agent failed with TypeError to add/remove rule on router without gateway

 

Public bug reported:

Assuming that, there are routers that don't have gateway in tenant.
When we try to add/remove meter label rule for the tenant,
process in metering-agent failed with Type Error.
Meter rules among other routers in the tenant won't be updated because of error above.

Part of this bug is reported and fixed in following bug report.
https://bugs.launchpad.net/neutron/+bug/1527274

How to reproduce
=================
1.neutron router-create test
2.neutron net-create test
3.neutron subnet-create test 192.168.1.0/24
4.neutron meter-label-create test
5.neutron meter-label-create <UUID of meter label in 4.>

After procedure 5, following error trace can be outputted.


trace in metering-agent
=======================
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server [req-5265cc49-4c97-4996-af45-2cacba64de84 da7194b4e98b4c8badc5912bbcd7aea4 9384ef06bc9d4af08a384692c92761ce
 - - -] Exception during message handling
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server Traceback (most recent call last):
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/server.py", line 133, in _process_incomin
g
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     res = self.dispatcher.dispatch(message)
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 150, in dispatch
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     return self._do_dispatch(endpoint, method, ctxt, args)
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 121, in _do_dispatch
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     result = func(ctxt, **new_args)
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 154, in wrapper
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     return f(*args, **kwargs)
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/opt/stack/neutron/neutron/services/metering/agents/metering_agent.py", line 212, in add_metering_l
abel_rule
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     'add_metering_label_rule')
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python2.7/dist-packages/oslo_concurrency/lockutils.py", line 271, in inner
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     return f(*args, **kwargs)
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/opt/stack/neutron/neutron/services/metering/agents/metering_agent.py", line 166, in _invoke_driver
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     return getattr(self.metering_driver, func_name)(context, meterings)
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python2.7/dist-packages/oslo_log/helpers.py", line 48, in wrapper
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     return method(*args, **kwargs)
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/opt/stack/neutron/neutron/services/metering/drivers/iptables/iptables_driver.py", line 264, in add
_metering_label_rule
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     self._add_metering_label_rule(router)
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/opt/stack/neutron/neutron/services/metering/drivers/iptables/iptables_driver.py", line 277, in _ad
d_metering_label_rule
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     self._process_metering_rule_action(router, 'create')
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/opt/stack/neutron/neutron/services/metering/drivers/iptables/iptables_driver.py", line 286, in _process_metering_rule_action
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     ext_dev = self.get_external_device_name(rm.router['gw_port_id'])
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/opt/stack/neutron/neutron/services/metering/drivers/iptables/iptables_driver.py", line 133, in get_external_device_name
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     return (EXTERNAL_DEV_PREFIX + port_id)[:self.driver.DEV_NAME_LEN]
2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server TypeError: cannot concatenate 'str' and 'NoneType' objects

** Affects: neutron
     Importance: Undecided
     Assignee: Kengo Hobo (hobo-kengo)
         Status: New


** Tags: metering

** Changed in: neutron
     Assignee: (unassigned) => Kengo Hobo (hobo-kengo)

** Tags added: metering

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1622574

Title:
  Metering-agent failed with TypeError to add/remove rule on router
  without gateway

Status in neutron:
  New

Bug description:
  Assuming that, there are routers that don't have gateway in tenant.
  When we try to add/remove meter label rule for the tenant,
  process in metering-agent failed with Type Error.
  Meter rules among other routers in the tenant won't be updated because of error above.

  Part of this bug is reported and fixed in following bug report.
  https://bugs.launchpad.net/neutron/+bug/1527274

  How to reproduce
  =================
  1.neutron router-create test
  2.neutron net-create test
  3.neutron subnet-create test 192.168.1.0/24
  4.neutron meter-label-create test
  5.neutron meter-label-create <UUID of meter label in 4.>

  After procedure 5, following error trace can be outputted.

  
  trace in metering-agent
  =======================
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server [req-5265cc49-4c97-4996-af45-2cacba64de84 da7194b4e98b4c8badc5912bbcd7aea4 9384ef06bc9d4af08a384692c92761ce
   - - -] Exception during message handling
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server Traceback (most recent call last):
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/server.py", line 133, in _process_incomin
  g
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     res = self.dispatcher.dispatch(message)
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 150, in dispatch
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     return self._do_dispatch(endpoint, method, ctxt, args)
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 121, in _do_dispatch
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     result = func(ctxt, **new_args)
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 154, in wrapper
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     return f(*args, **kwargs)
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/opt/stack/neutron/neutron/services/metering/agents/metering_agent.py", line 212, in add_metering_l
  abel_rule
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     'add_metering_label_rule')
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python2.7/dist-packages/oslo_concurrency/lockutils.py", line 271, in inner
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     return f(*args, **kwargs)
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/opt/stack/neutron/neutron/services/metering/agents/metering_agent.py", line 166, in _invoke_driver
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     return getattr(self.metering_driver, func_name)(context, meterings)
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python2.7/dist-packages/oslo_log/helpers.py", line 48, in wrapper
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     return method(*args, **kwargs)
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/opt/stack/neutron/neutron/services/metering/drivers/iptables/iptables_driver.py", line 264, in add
  _metering_label_rule
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     self._add_metering_label_rule(router)
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/opt/stack/neutron/neutron/services/metering/drivers/iptables/iptables_driver.py", line 277, in _ad
  d_metering_label_rule
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     self._process_metering_rule_action(router, 'create')
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/opt/stack/neutron/neutron/services/metering/drivers/iptables/iptables_driver.py", line 286, in _process_metering_rule_action
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     ext_dev = self.get_external_device_name(rm.router['gw_port_id'])
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server   File "/opt/stack/neutron/neutron/services/metering/drivers/iptables/iptables_driver.py", line 133, in get_external_device_name
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server     return (EXTERNAL_DEV_PREFIX + port_id)[:self.driver.DEV_NAME_LEN]
  2016-09-12 11:09:12.629 4205 ERROR oslo_messaging.rpc.server TypeError: cannot concatenate 'str' and 'NoneType' objects

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1622574/+subscriptions


Follow ups