← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1452458] [NEW] Server returns error 500 when setting a DVR router as a gateway on a network with no subnet, and then adding an interface

 

Public bug reported:

Steps to reproduce:
1) Create DVR router
2) Set it as a gateway on an external network with no subnet (Note: I have no idea what this means or why would someone do this). The operation succeeds as it does with legacy routers.
3) Add a router interface on an internal subnet. This will return error 500. The internal port and its SNAT port will be created successfully, with DOWN status. (Note: This step would succeed / not return error 500 on legacy routers).

Trace from server log:
2015-05-07 00:16:37.421 25776 ERROR neutron.api.v2.resource [req-de30ab02-3867-4772-9c1b-55c2f0a864bf ] add_router_interface failed
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource Traceback (most recent call last):
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/api/v2/resource.py", line 83, in resource
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     result = method(request=request, **args)
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/api/v2/base.py", line 207, in _handle_action
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     return getattr(self._plugin, name)(*arg_list, **kwargs)
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_dvr_db.py", line 309, in add_router_interface
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     context, router_interface_info, 'add')
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_db.py", line 1304, in notify_router_interface_action
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     {'subnet_id': router_interface_info['subnet_id']})
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_db.py", line 1280, in notify_routers_updated
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     context, router_ids, operation, data)
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/api/rpc/agentnotifiers/l3_rpc_agent_api.py", line 144, in router
s_updated
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     operation, shuffle_agents)
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/api/rpc/agentnotifiers/l3_rpc_agent_api.py", line 115, in _notif
ication
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     plugin.schedule_routers(adminContext, router_ids)
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_agentschedulers_db.py", line 497, in schedule_routers
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     self.schedule_router(context, router, candidates=None)
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_agentschedulers_db.py", line 492, in schedule_router
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     self, context, router, candidates=candidates)
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/scheduler/l3_agent_scheduler.py", line 359, in schedule
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     plugin, context, router_id, candidates=candidates)
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/scheduler/l3_agent_scheduler.py", line 253, in _schedule_router
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     plugin, context, sync_router)
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/scheduler/l3_agent_scheduler.py", line 185, in get_candidates
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     active_l3_agents)
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_agentschedulers_db.py", line 480, in get_l3_agent_candidat
es
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     context, l3_agent, sync_router['id'])):
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_agentschedulers_db.py", line 377, in check_ports_exist_on_
l3agent
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     subnet_ids = self.get_subnet_ids_on_router(context, router_id)
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_dvrscheduler_db.py", line 143, in get_subnet_ids_on_router
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     int_subnet = int_ips[0]['subnet_id']
2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource IndexError: list index out of range

** Affects: neutron
     Importance: Low
         Status: New


** Tags: l3-dvr-backlog

** Description changed:

  Steps to reproduce:
  1) Create DVR router
  2) Set it as a gateway on an external network with no subnet (Note: I have no idea what this means or why would someone do this). The operation succeeds as it does with legacy routers.
- 3) Add a router interface on an internal subnet. This will return error 500. The internal port and its SNAT port will be created successfully, with DOWN status.
+ 3) Add a router interface on an internal subnet. This will return error 500. The internal port and its SNAT port will be created successfully, with DOWN status. (Note: This step would succeed / not return error 500 on legacy routers).
  
  Trace from server log:
  2015-05-07 00:16:37.421 25776 ERROR neutron.api.v2.resource [req-de30ab02-3867-4772-9c1b-55c2f0a864bf ] add_router_interface failed
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource Traceback (most recent call last):
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/api/v2/resource.py", line 83, in resource
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     result = method(request=request, **args)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/api/v2/base.py", line 207, in _handle_action
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     return getattr(self._plugin, name)(*arg_list, **kwargs)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_dvr_db.py", line 309, in add_router_interface
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     context, router_interface_info, 'add')
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_db.py", line 1304, in notify_router_interface_action
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     {'subnet_id': router_interface_info['subnet_id']})
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_db.py", line 1280, in notify_routers_updated
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     context, router_ids, operation, data)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/api/rpc/agentnotifiers/l3_rpc_agent_api.py", line 144, in router
  s_updated
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     operation, shuffle_agents)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/api/rpc/agentnotifiers/l3_rpc_agent_api.py", line 115, in _notif
  ication
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     plugin.schedule_routers(adminContext, router_ids)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_agentschedulers_db.py", line 497, in schedule_routers
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     self.schedule_router(context, router, candidates=None)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_agentschedulers_db.py", line 492, in schedule_router
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     self, context, router, candidates=candidates)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/scheduler/l3_agent_scheduler.py", line 359, in schedule
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     plugin, context, router_id, candidates=candidates)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/scheduler/l3_agent_scheduler.py", line 253, in _schedule_router
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     plugin, context, sync_router)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/scheduler/l3_agent_scheduler.py", line 185, in get_candidates
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     active_l3_agents)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_agentschedulers_db.py", line 480, in get_l3_agent_candidat
  es
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     context, l3_agent, sync_router['id'])):
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_agentschedulers_db.py", line 377, in check_ports_exist_on_
  l3agent
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     subnet_ids = self.get_subnet_ids_on_router(context, router_id)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_dvrscheduler_db.py", line 143, in get_subnet_ids_on_router
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     int_subnet = int_ips[0]['subnet_id']
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource IndexError: list index out of range

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

Title:
  Server returns error 500 when setting a DVR router as a gateway on a
  network with no subnet, and then adding an interface

Status in OpenStack Neutron (virtual network service):
  New

Bug description:
  Steps to reproduce:
  1) Create DVR router
  2) Set it as a gateway on an external network with no subnet (Note: I have no idea what this means or why would someone do this). The operation succeeds as it does with legacy routers.
  3) Add a router interface on an internal subnet. This will return error 500. The internal port and its SNAT port will be created successfully, with DOWN status. (Note: This step would succeed / not return error 500 on legacy routers).

  Trace from server log:
  2015-05-07 00:16:37.421 25776 ERROR neutron.api.v2.resource [req-de30ab02-3867-4772-9c1b-55c2f0a864bf ] add_router_interface failed
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource Traceback (most recent call last):
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/api/v2/resource.py", line 83, in resource
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     result = method(request=request, **args)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/api/v2/base.py", line 207, in _handle_action
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     return getattr(self._plugin, name)(*arg_list, **kwargs)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_dvr_db.py", line 309, in add_router_interface
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     context, router_interface_info, 'add')
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_db.py", line 1304, in notify_router_interface_action
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     {'subnet_id': router_interface_info['subnet_id']})
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_db.py", line 1280, in notify_routers_updated
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     context, router_ids, operation, data)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/api/rpc/agentnotifiers/l3_rpc_agent_api.py", line 144, in router
  s_updated
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     operation, shuffle_agents)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/api/rpc/agentnotifiers/l3_rpc_agent_api.py", line 115, in _notif
  ication
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     plugin.schedule_routers(adminContext, router_ids)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_agentschedulers_db.py", line 497, in schedule_routers
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     self.schedule_router(context, router, candidates=None)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_agentschedulers_db.py", line 492, in schedule_router
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     self, context, router, candidates=candidates)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/scheduler/l3_agent_scheduler.py", line 359, in schedule
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     plugin, context, router_id, candidates=candidates)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/scheduler/l3_agent_scheduler.py", line 253, in _schedule_router
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     plugin, context, sync_router)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/scheduler/l3_agent_scheduler.py", line 185, in get_candidates
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     active_l3_agents)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_agentschedulers_db.py", line 480, in get_l3_agent_candidat
  es
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     context, l3_agent, sync_router['id'])):
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_agentschedulers_db.py", line 377, in check_ports_exist_on_
  l3agent
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     subnet_ids = self.get_subnet_ids_on_router(context, router_id)
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/l3_dvrscheduler_db.py", line 143, in get_subnet_ids_on_router
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource     int_subnet = int_ips[0]['subnet_id']
  2015-05-07 00:16:37.421 25776 TRACE neutron.api.v2.resource IndexError: list index out of range

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


Follow ups

References