Neutron-metering-agent failed to add metering label rule on router without gateway

Bug #1522429 reported by Sergey Belous
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Invalid
Low
Sergey Belous
9.x
Won't Fix
Low
Sergey Belous

Bug Description

Upstream bug: https://bugs.launchpad.net/neutron/+bug/1527274

MOS 8.0 env, 1 compute, 3 controllers.

Step to reproduce:
1. Create internal net, subnet, router. Add interface to router for created net. Boot vm in created net.
2. Create neutron-meter-label
3. Try to create meter-label-rule
4. Rule not appear in iptables on router-namespace and after that we can see traces in neutron-meter-agent logs:

2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher [req-2913e1ae-87d3-404e-8897-94aa25338a67 baf05c2230204f19a700b2516b7c2786 fcab0b76df20485193be7853a28ee929 - - -] Exception during message handling: cannot concatenate 'str' and 'NoneType' objects
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher executor_callback))
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher executor_callback)
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 129, in _do_dispatch
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args)
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/neutron/services/metering/agents/metering_agent.py", line 222, in add_metering_label_rule
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher 'add_metering_label_rule')
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_concurrency/lockutils.py", line 254, in inner
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher return f(*args, **kwargs)
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/neutron/services/metering/agents/metering_agent.py", line 176, in _invoke_driver
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher return getattr(self.metering_driver, func_name)(context, meterings)
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_log/helpers.py", line 46, in wrapper
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher return method(*args, **kwargs)
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/neutron/services/metering/drivers/iptables/iptables_driver.py", line 259, in add_metering_label_rule
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher self._add_metering_label_rule(router)
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/neutron/services/metering/drivers/iptables/iptables_driver.py", line 272, in _add_metering_label_rule
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher self._process_metering_rule_action(router, 'create')
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/neutron/services/metering/drivers/iptables/iptables_driver.py", line 281, in _process_metering_rule_action
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher ext_dev = self.get_external_device_name(rm.router['gw_port_id'])
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/neutron/services/metering/drivers/iptables/iptables_driver.py", line 132, in get_external_device_name
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher return (EXTERNAL_DEV_PREFIX + port_id)[:self.driver.DEV_NAME_LEN]
2015-12-03 14:03:59.805 21341 ERROR oslo_messaging.rpc.dispatcher TypeError: cannot concatenate 'str' and 'NoneType' objects

5. If we try to remove that meter-label-rule, we can see following traces from neutron-meter-agent:
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher [req-0bf3d3ab-ab66-4aac-a77d-95d82c3dd588 baf05c2230204f19a700b2516b7c2786 fcab0b76df20485193be7853a28ee929 - - -] Exception during message handling: cannot concatenate 'str' and 'NoneType' objects
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher executor_callback))
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher executor_callback)
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 129, in _do_dispatch
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args)
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/neutron/services/metering/agents/metering_agent.py", line 226, in remove_metering_label_rule
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher 'remove_metering_label_rule')
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_concurrency/lockutils.py", line 254, in inner
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher return f(*args, **kwargs)
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/neutron/services/metering/agents/metering_agent.py", line 176, in _invoke_driver
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher return getattr(self.metering_driver, func_name)(context, meterings)
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_log/helpers.py", line 46, in wrapper
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher return method(*args, **kwargs)
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/neutron/services/metering/drivers/iptables/iptables_driver.py", line 264, in remove_metering_label_rule
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher self._remove_metering_label_rule(router)
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/neutron/services/metering/drivers/iptables/iptables_driver.py", line 275, in _remove_metering_label_rule
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher self._process_metering_rule_action(router, 'delete')
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/neutron/services/metering/drivers/iptables/iptables_driver.py", line 281, in _process_metering_rule_action
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher ext_dev = self.get_external_device_name(rm.router['gw_port_id'])
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/neutron/services/metering/drivers/iptables/iptables_driver.py", line 132, in get_external_device_name
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher return (EXTERNAL_DEV_PREFIX + port_id)[:self.driver.DEV_NAME_LEN]
2015-12-03 14:07:21.595 21341 ERROR oslo_messaging.rpc.dispatcher TypeError: cannot concatenate 'str' and 'NoneType' objects

tags: added: neutron
Changed in mos:
importance: Undecided → Medium
status: New → Confirmed
Sergey Belous (sbelous)
Changed in mos:
milestone: 8.0 → 9.0
Changed in mos:
importance: Medium → Low
tags: added: area-neutron
removed: neutron
Revision history for this message
Bug Checker Bot (bug-checker) wrote : Autochecker

(This check performed automatically)
Please, make sure that bug description contains the following sections filled in with the appropriate data related to the bug you are describing:

actual result

expected result

steps to reproduce

For more detailed information on the contents of each of the listed sections see https://wiki.openstack.org/wiki/Fuel/How_to_contribute#Here_is_how_you_file_a_bug

tags: added: need-info
Revision history for this message
Alexander Ignatov (aignatov) wrote :

Low bug is going to next release

Changed in mos:
milestone: 9.0 → 10.0
tags: added: move-to-10.0
Sergey Belous (sbelous)
description: updated
Revision history for this message
Sergey Belous (sbelous) wrote :

Fix merged into master https://review.openstack.org/#/c/307122/ in upstream

Changed in mos:
status: Confirmed → Invalid
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.