← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1358731] [NEW] SLAAC IP address is not checked for duplicates

 

Public bug reported:

SLAAC IPv6 address should be checked for duplicates before applying.

Create network and IPv6 subnet.
$ neutron net-create net123
$ neutron subnet-create net123 --name=sub1 --ip-version 6 --ipv6-ra-mode slaac --ipv6-address-mode slaac 2014::/64

Then create port with fixed IP address that matches SLAAC address for MAC "11:22:33:44:55:66":  2014::1322:33ff:fe44:5566
$ neutron port-create net123 --fixed-ip subnet_id=1d6fcc3d-0c55-4bdf-9e7f-5173df8d5fda,ip_address=2014::1322:33ff:fe44:5566

Now create port with MAC "11:22:33:44:55:66" which should get the same addresss we set before:
$ neutron port-create net123 --mac-address 11:22:33:44:55:66

There is reply to client:
'unicode' object has no attribute 'get' (it's a separate bug about unclear error message in client)

And the traceback in neutron:

2014-08-18 10:12:49.755 ERROR neutron.api.v2.resource [req-ca20ca88-3dec-4445-9e9c-6eb73c343474 demo 834b2e7732cb4ad4b3df81fe0b0ea906] create failed
2014-08-18 10:12:49.755 TRACE neutron.api.v2.resource Traceback (most recent call last):
File "/opt/stack/neutron/neutron/api/v2/resource.py", line 87, in resource
  result = method(request=request, **args)
File "/opt/stack/neutron/neutron/api/v2/base.py", line 448, in create
  obj = obj_creator(request.context, **kwargs)
File "/opt/stack/neutron/neutron/plugins/ml2/plugin.py", line 805, in create_port
  result = super(Ml2Plugin, self).create_port(context, port)
File "/opt/stack/neutron/neutron/db/db_base_plugin_v2.py", line 1301, in create_port
  context.session.add(allocated)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 447, in __exit__
  self.rollback()
File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py", line 58, in __exit__
  compat.reraise(exc_type, exc_value, exc_tb)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 444, in __exit__
  self.commit()
File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 354, in commit
  self._prepare_impl()
File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 334, in _prepare_impl
  self.session.flush()
File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1818, in flush
  self._flush(objects)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1936, in _flush
  transaction.rollback(_capture_exception=True)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py", line 58, in __exit__
  compat.reraise(exc_type, exc_value, exc_tb)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1900, in _flush
  flush_context.execute()  
File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 372, in execute
  rec.execute(self)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 525, in execute
  uow
File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 64, in save_obj
  table, insert)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 541, in _emit_insert_statements
  execute(statement, multiparams)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 662, in execute
  params)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 761, in _execute_clauseelement
  compiled_sql, distilled_params
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 874, in _execute_context
  context)
File "/usr/local/lib/python2.7/dist-packages/oslo/db/sqlalchemy/compat/handle_error.py", line 125, in _handle_dbapi_exception
  six.reraise(type(newraise), newraise, sys.exc_info()[2])
File "/usr/local/lib/python2.7/dist-packages/oslo/db/sqlalchemy/compat/handle_error.py", line 102, in _handle_dbapi_exception
  per_fn = fn(ctx)
File "/usr/local/lib/python2.7/dist-packages/oslo/db/sqlalchemy/exc_filters.py", line 323, in handler
  context.is_disconnect)
File "/usr/local/lib/python2.7/dist-packages/oslo/db/sqlalchemy/exc_filters.py", line 145, in _default_dupe_key_error
  raise exception.DBDuplicateEntry(columns, integrity_error, value)
 
 neutron.api.v2.resource DBDuplicateEntry: (IntegrityError) (1062, "Duplicate entry '2014::1322:33ff:fe44:5566-1d6fcc3d-0c55-4bdf-9e7f-5173df8d5fda-4' for key 'PRIMARY'") 'INSERT INTO ipallocations (port_id, ip_address, subnet_id, network_id) VALUES (%s, %s, %s, %s)' ('acc56c30-b685-4826-b169-cb0e3cdbc3cd', '2014::1322:33ff:fe44:5566', '1d6fcc3d-0c55-4bdf-9e7f-5173df8d5fda', '42d6d00e-697f-4d28-8c74-678e30034490')

** Affects: neutron
     Importance: Undecided
         Status: New


** Tags: ipv6

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

Title:
  SLAAC IP address is not checked for duplicates

Status in OpenStack Neutron (virtual network service):
  New

Bug description:
  SLAAC IPv6 address should be checked for duplicates before applying.

  Create network and IPv6 subnet.
  $ neutron net-create net123
  $ neutron subnet-create net123 --name=sub1 --ip-version 6 --ipv6-ra-mode slaac --ipv6-address-mode slaac 2014::/64

  Then create port with fixed IP address that matches SLAAC address for MAC "11:22:33:44:55:66":  2014::1322:33ff:fe44:5566
  $ neutron port-create net123 --fixed-ip subnet_id=1d6fcc3d-0c55-4bdf-9e7f-5173df8d5fda,ip_address=2014::1322:33ff:fe44:5566

  Now create port with MAC "11:22:33:44:55:66" which should get the same addresss we set before:
  $ neutron port-create net123 --mac-address 11:22:33:44:55:66

  There is reply to client:
  'unicode' object has no attribute 'get' (it's a separate bug about unclear error message in client)

  And the traceback in neutron:

  2014-08-18 10:12:49.755 ERROR neutron.api.v2.resource [req-ca20ca88-3dec-4445-9e9c-6eb73c343474 demo 834b2e7732cb4ad4b3df81fe0b0ea906] create failed
  2014-08-18 10:12:49.755 TRACE neutron.api.v2.resource Traceback (most recent call last):
  File "/opt/stack/neutron/neutron/api/v2/resource.py", line 87, in resource
    result = method(request=request, **args)
  File "/opt/stack/neutron/neutron/api/v2/base.py", line 448, in create
    obj = obj_creator(request.context, **kwargs)
  File "/opt/stack/neutron/neutron/plugins/ml2/plugin.py", line 805, in create_port
    result = super(Ml2Plugin, self).create_port(context, port)
  File "/opt/stack/neutron/neutron/db/db_base_plugin_v2.py", line 1301, in create_port
    context.session.add(allocated)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 447, in __exit__
    self.rollback()
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py", line 58, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 444, in __exit__
    self.commit()
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 354, in commit
    self._prepare_impl()
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 334, in _prepare_impl
    self.session.flush()
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1818, in flush
    self._flush(objects)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1936, in _flush
    transaction.rollback(_capture_exception=True)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py", line 58, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1900, in _flush
    flush_context.execute()  
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 372, in execute
    rec.execute(self)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 525, in execute
    uow
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 64, in save_obj
    table, insert)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 541, in _emit_insert_statements
    execute(statement, multiparams)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 662, in execute
    params)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 761, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 874, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/oslo/db/sqlalchemy/compat/handle_error.py", line 125, in _handle_dbapi_exception
    six.reraise(type(newraise), newraise, sys.exc_info()[2])
  File "/usr/local/lib/python2.7/dist-packages/oslo/db/sqlalchemy/compat/handle_error.py", line 102, in _handle_dbapi_exception
    per_fn = fn(ctx)
  File "/usr/local/lib/python2.7/dist-packages/oslo/db/sqlalchemy/exc_filters.py", line 323, in handler
    context.is_disconnect)
  File "/usr/local/lib/python2.7/dist-packages/oslo/db/sqlalchemy/exc_filters.py", line 145, in _default_dupe_key_error
    raise exception.DBDuplicateEntry(columns, integrity_error, value)
   
   neutron.api.v2.resource DBDuplicateEntry: (IntegrityError) (1062, "Duplicate entry '2014::1322:33ff:fe44:5566-1d6fcc3d-0c55-4bdf-9e7f-5173df8d5fda-4' for key 'PRIMARY'") 'INSERT INTO ipallocations (port_id, ip_address, subnet_id, network_id) VALUES (%s, %s, %s, %s)' ('acc56c30-b685-4826-b169-cb0e3cdbc3cd', '2014::1322:33ff:fe44:5566', '1d6fcc3d-0c55-4bdf-9e7f-5173df8d5fda', '42d6d00e-697f-4d28-8c74-678e30034490')

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


Follow ups

References