← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1398768] [NEW] If we set a gateway outside subnet neutron-l3-agent fails when trying to set the route in the virtual router.

 

Public bug reported:

014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent Traceback (most recent call last):
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/common/utils.py", line 341, in call
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     return func(*args, **kwargs)
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/l3_agent.py", line 938, in process_router
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     self.external_gateway_added(ri, ex_gw_port, interface_name)
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/l3_agent.py", line 1318, in external_gateway_added
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     ri.ns_name, preserve_ips)
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/l3_agent.py", line 1362, in _external_gateway_added
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     preserve_ips=preserve_ips)
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/interface.py", line 120, in init_l3
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     device.route.add_gateway(gateway)
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 395, in add_gateway
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     self._as_root(*args)
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 242, in _as_root
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     kwargs.get('use_root_namespace', False))
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 74, in _as_root
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     log_fail_as_error=self.log_fail_as_error)
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 86, in _execute
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     log_fail_as_error=log_fail_as_error)
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/utils.py", line 84, in execute
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     raise RuntimeError(m)
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent RuntimeError:
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent Command: ['sudo', 'neutron-rootwrap', '/etc/neutron/rootwrap.conf', 'ip', 'netns', 'exec', 'qrouter-bcfe22ff-049c-4eb9-9b57-235d903ee52f', 'ip', 'route', 'replace', 'default', 'via', '37.187.128.254', 'dev', 'qg-eaa2de59-95']
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent Exit code: 2
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent Stdout: ''
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent Stderr: 'RTNETLINK answers: Network is unreachable\n'
2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent


This happens because we should set an on-link route to the gateway IP
on the external network interface first.

Once this works, we can remove the "force_gateway_on_subnet" deprecation,
to allow this not to be enforced, as it's a valid use case in many data centers.

** Affects: neutron
     Importance: Undecided
     Assignee: Miguel Angel Ajo (mangelajo)
         Status: New

** Changed in: neutron
     Assignee: (unassigned) => Miguel Angel Ajo (mangelajo)

** Description changed:

+ 014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent Traceback (most recent call last):
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/common/utils.py", line 341, in call
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     return func(*args, **kwargs)
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/l3_agent.py", line 938, in process_router
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     self.external_gateway_added(ri, ex_gw_port, interface_name)
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/l3_agent.py", line 1318, in external_gateway_added
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     ri.ns_name, preserve_ips)
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/l3_agent.py", line 1362, in _external_gateway_added
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     preserve_ips=preserve_ips)
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/interface.py", line 120, in init_l3
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     device.route.add_gateway(gateway)
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 395, in add_gateway
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     self._as_root(*args)
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 242, in _as_root
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     kwargs.get('use_root_namespace', False))
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 74, in _as_root
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     log_fail_as_error=self.log_fail_as_error)
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 86, in _execute
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     log_fail_as_error=log_fail_as_error)
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/utils.py", line 84, in execute
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     raise RuntimeError(m)
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent RuntimeError:
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent Command: ['sudo', 'neutron-rootwrap', '/etc/neutron/rootwrap.conf', 'ip', 'netns', 'exec', 'qrouter-bcfe22ff-049c-4eb9-9b57-235d903ee52f', 'ip', 'route', 'replace', 'default', 'via', '37.187.128.254', 'dev', 'qg-eaa2de59-95']
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent Exit code: 2
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent Stdout: ''
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent Stderr: 'RTNETLINK answers: Network is unreachable\n'
+ 2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent
+ 
+ 
  This happens because we should set an on-link route to the gateway IP
  on the external network interface first.
  
- Once this works, we can remove the "force_gateway_on_subnet" deprecation, 
+ Once this works, we can remove the "force_gateway_on_subnet" deprecation,
  to allow this not to be enforced, as it's a valid use case in many data centers.

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

Title:
  If we set a gateway outside subnet neutron-l3-agent fails when trying
  to set the route in the virtual router.

Status in OpenStack Neutron (virtual network service):
  New

Bug description:
  014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent Traceback (most recent call last):
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/common/utils.py", line 341, in call
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     return func(*args, **kwargs)
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/l3_agent.py", line 938, in process_router
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     self.external_gateway_added(ri, ex_gw_port, interface_name)
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/l3_agent.py", line 1318, in external_gateway_added
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     ri.ns_name, preserve_ips)
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/l3_agent.py", line 1362, in _external_gateway_added
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     preserve_ips=preserve_ips)
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/interface.py", line 120, in init_l3
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     device.route.add_gateway(gateway)
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 395, in add_gateway
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     self._as_root(*args)
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 242, in _as_root
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     kwargs.get('use_root_namespace', False))
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 74, in _as_root
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     log_fail_as_error=self.log_fail_as_error)
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 86, in _execute
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     log_fail_as_error=log_fail_as_error)
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/utils.py", line 84, in execute
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent     raise RuntimeError(m)
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent RuntimeError:
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent Command: ['sudo', 'neutron-rootwrap', '/etc/neutron/rootwrap.conf', 'ip', 'netns', 'exec', 'qrouter-bcfe22ff-049c-4eb9-9b57-235d903ee52f', 'ip', 'route', 'replace', 'default', 'via', '37.187.128.254', 'dev', 'qg-eaa2de59-95']
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent Exit code: 2
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent Stdout: ''
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent Stderr: 'RTNETLINK answers: Network is unreachable\n'
  2014-11-30 16:25:10.113 8086 TRACE neutron.agent.l3_agent

  
  This happens because we should set an on-link route to the gateway IP
  on the external network interface first.

  Once this works, we can remove the "force_gateway_on_subnet" deprecation,
  to allow this not to be enforced, as it's a valid use case in many data centers.

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


Follow ups

References