← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1333134] Re: wrong gateway_ip setting in subnet constantly resyncs dhcp-agent, causing DHCP NAK dropping connection in guests

 

** Changed in: neutron
       Status: Fix Committed => Fix Released

** Changed in: neutron
    Milestone: None => juno-3

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

Title:
  wrong gateway_ip setting in subnet constantly resyncs dhcp-agent,
  causing DHCP NAK dropping connection in guests

Status in OpenStack Neutron (virtual network service):
  Fix Released
Status in OpenStack Security Advisories:
  Won't Fix

Bug description:
  If any tenant creates a subnet with a wrong gateway ip (outside the subnet CIDR),
  ip route will fail to set the route into the qdhcp namespace, and that
  will cause constant resyncs and neutron-dhcp-agent malfunction.

  
  This needs a fix either in parameter acceptance in API, or/and before calling iproute
  into the neutron-dhcp-agent to avoid this problem.

  
  [root@controllerNN ~(keystone_admin)]# neutron subnet-create privnet2 192.168.126.0/24 --gateway 192.168.222.1 --name badsubnet
  Created a new subnet:
  +------------------+------------------------------------------------------+
  | Field            | Value                                                |
  +------------------+------------------------------------------------------+
  | allocation_pools | {"start": "192.168.126.1", "end": "192.168.126.254"} |
  | cidr             | 192.168.126.0/24                                     |
  | dns_nameservers  |                                                      |
  | enable_dhcp      | True                                                 |
  | gateway_ip       | 192.168.222.1                                        |
  | host_routes      |                                                      |
  | id               | 4f41041f-3035-43f1-9dbf-daa61a96fb7e                 |
  | ip_version       | 4                                                    |
  | name             | badsubnet                                            |
  | network_id       | 9ef49c17-6845-4e26-827c-bb2423317f67                 |
  | tenant_id        | 60b2f5dcf34542f7952216beb97793a1                     |
  +------------------+------------------------------------------------------+

  
  And this is the log of the dhcp server:

  [root@controllerNN ~(keystone_admin)]# tail -f /var/log/neutron/dhcp-agent.log 
  2014-06-22 08:41:08.107 3767 TRACE neutron.agent.dhcp_agent     root_helper=root_helper)
  2014-06-22 08:41:08.107 3767 TRACE neutron.agent.dhcp_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/utils.py", line 76, in execute
  2014-06-22 08:41:08.107 3767 TRACE neutron.agent.dhcp_agent     raise RuntimeError(m)
  2014-06-22 08:41:08.107 3767 TRACE neutron.agent.dhcp_agent RuntimeError: 
  2014-06-22 08:41:08.107 3767 TRACE neutron.agent.dhcp_agent Command: ['sudo', 'neutron-rootwrap', '/etc/neutron/rootwrap.conf', 'ip', 'netns', 'exec', 'qdhcp-9ef49c17-6845-4e26-827c-bb2423317f67', 'ip', 'route', 'replace', 'default', 'via', '192.168.222.1', 'dev', 'tap8ac47b9f-ea']
  2014-06-22 08:41:08.107 3767 TRACE neutron.agent.dhcp_agent Exit code: 2
  2014-06-22 08:41:08.107 3767 TRACE neutron.agent.dhcp_agent Stdout: ''
  2014-06-22 08:41:08.107 3767 TRACE neutron.agent.dhcp_agent Stderr: 'RTNETLINK answers: Network is unreachable\n'
  2014-06-22 08:41:08.107 3767 TRACE neutron.agent.dhcp_agent 
  2014-06-22 08:41:08.108 3767 INFO neutron.agent.dhcp_agent [-] Synchronizing state complete
  2014-06-22 08:41:38.109 3767 INFO neutron.agent.dhcp_agent [-] Synchronizing state
  2014-06-22 08:41:38.426 3767 ERROR neutron.agent.dhcp_agent [-] Unable to enable dhcp for 9ef49c17-6845-4e26-827c-bb2423317f67.
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent Traceback (most recent call last):
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/dhcp_agent.py", line 127, in call_driver
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent     getattr(driver, action)(**action_kwargs)
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/dhcp.py", line 166, in enable
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent     reuse_existing=True)
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/dhcp.py", line 854, in setup
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent     self._set_default_route(network, port)
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/dhcp.py", line 737, in _set_default_route
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent     device.route.add_gateway(subnet.gateway_ip)
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 368, in add_gateway
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent     self._as_root(*args)
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 217, in _as_root
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent     kwargs.get('use_root_namespace', False))
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 70, in _as_root
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent     namespace)
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 81, in _execute
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent     root_helper=root_helper)
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent   File "/usr/lib/python2.7/site-packages/neutron/agent/linux/utils.py", line 76, in execute
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent     raise RuntimeError(m)
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent RuntimeError: 
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent Command: ['sudo', 'neutron-rootwrap', '/etc/neutron/rootwrap.conf', 'ip', 'netns', 'exec', 'qdhcp-9ef49c17-6845-4e26-827c-bb2423317f67', 'ip', 'route', 'replace', 'default', 'via', '192.168.222.1', 'dev', 'tap8ac47b9f-ea']
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent Exit code: 2
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent Stdout: ''
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent Stderr: 'RTNETLINK answers: Network is unreachable\n'
  2014-06-22 08:41:38.426 3767 TRACE neutron.agent.dhcp_agent 
  2014-06-22 08:41:38.427 3767 INFO neutron.agent.dhcp_agent [-] Synchronizing state complete

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