TRACE: attribute error when trying to fetch the router.snat_namespace.name

Bug #1431077 reported by Swaminathan Vasudevan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Unassigned

Bug Description

TRACE seen in the vpn-agent log when configured with DVR router.
A recent refactoring to the agent have introduced this problem.

http://logs.openstack.org/71/130471/6/check/check-tempest-dsvm-neutron-dvr/10208dc/logs/screen-q-vpn.txt.gz?level=TRACE

2015-03-11 14:09:03.570 ERROR neutron.agent.l3.agent [req-1c27f913-7f3c-40ff-8b86-f915fdde4be9 None None] Failed to process compatible router '25160ab1-c55e-424a-b209-a98f6b2bf769'
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent Traceback (most recent call last):
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent File "/opt/stack/new/neutron/neutron/agent/l3/agent.py", line 895, in _process_router_update
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent self._process_router_if_compatible(router)
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent File "/opt/stack/new/neutron/neutron/agent/l3/agent.py", line 843, in _process_router_if_compatible
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent self._process_added_router(router)
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent File "/opt/stack/new/neutron/neutron/agent/l3/agent.py", line 854, in _process_added_router
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent adv_svc.AdvancedService.after_router_added, ri)
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent File "/opt/stack/new/neutron/neutron/agent/l3/event_observers.py", line 40, in notify
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent getattr(observer, method_name)(*args, **kwargs)
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent File "/opt/stack/new/neutron-vpnaas/neutron_vpnaas/services/vpn/vpn_service.py", line 61, in after_router_added
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent device.sync(self.context, [ri.router])
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent File "/usr/local/lib/python2.7/dist-packages/oslo_concurrency/lockutils.py", line 431, in inner
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent return f(*args, **kwargs)
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent File "/opt/stack/new/neutron-vpnaas/neutron_vpnaas/services/vpn/device_drivers/ipsec.py", line 773, in sync
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent self._delete_vpn_processes(sync_router_ids, router_ids)
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent File "/opt/stack/new/neutron-vpnaas/neutron_vpnaas/services/vpn/device_drivers/ipsec.py", line 795, in _delete_vpn_processes
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent self.ensure_process(process_id)
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent File "/opt/stack/new/neutron-vpnaas/neutron_vpnaas/services/vpn/device_drivers/ipsec.py", line 643, in ensure_process
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent namespace = self.get_namespace(process_id)
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent File "/opt/stack/new/neutron-vpnaas/neutron_vpnaas/services/vpn/device_drivers/ipsec.py", line 535, in get_namespace
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent return router.snat_namespace.name
2015-03-11 14:09:03.570 3909 TRACE neutron.agent.l3.agent AttributeError: 'NoneType' object has no attribute 'name

Tags: vpnaas
tags: added: vpnaas
removed: neutron-vpnaas
Revision history for this message
Paul Michali (pcm) wrote :

Can you point to what test case and suite being run, when this was seen? Wondering what the test setup is. In this case, VPN is trying to create a process manager, when the router is created (although it will later remove it, as there is no VPN service associated with it). As part of that, it tries to get the namespace of the router (via snat_namesapce.name, for DVR) and that is failing.

The question is, why is there not a namespace available for the DVR at this point in time?

In VPN code, this used to obtain the namespace by calling the L3 agent, getting the router, and then looking up the namespace. Changes on the VPN side, are that, instead of calling back to the L3 agent, to get the router, it uses the router passed into the after_router_added method.

Review 162840 may avert the issue (by not looking up the namespace), but it would like to know why this is failing, though.

Revision history for this message
Paul Michali (pcm) wrote :

The thought is that https://review.openstack.org/#/c/162840/ will fix this issue as well. Can you recheck and if problem is resolved close this out (and let us know, if it is not resolved)?

Thanks!

Revision history for this message
Swaminathan Vasudevan (swaminathan-vasudevan) wrote :

Paul I tested with your patch and the TRACE does not occur anymore.
So I think your patch would have fixed the problem.

We can go ahead and close teh bug.

Revision history for this message
Rossella Sblendido (rossella-o) wrote :

As per Swami's comment marking this as 'Fix committed'

Changed in neutron:
status: New → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → kilo-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: kilo-rc1 → 2015.1.0
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.