← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1849976] [NEW] "networkdhcpagentbindings.binding_index" autoincrement parameter is not working

 

Public bug reported:

Bug related to:
- https://bugs.launchpad.net/neutron/+bug/1535554
- https://review.opendev.org/#/c/288271/


As commented in [1], the "autoincrement" parameter in a non-primary key column does not work. This will lead to problems when creating objects without specifying explicitly the "binding_index" column. We can see some errors in UTs [2][3].

Error log (http://paste.openstack.org/show/785596/):
oslo_db.exception.DBDuplicateEntry: (sqlite3.IntegrityError) UNIQUE constraint failed: networkdhcpagentbindings.network_id, networkdhcpagentbindings.binding_index
[SQL: INSERT INTO networkdhcpagentbindings (network_id, dhcp_agent_id, binding_index) VALUES (?, ?, ?)]
[parameters: ('d87f9ef1-e892-4d32-b3fa-5b7d07fd1107', '5a909c22-3a34-4e16-b129-07e3ea1807a8', 783)]
(Background on this error at: http://sqlalche.me/e/gkpj)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/zuul/src/opendev.org/openstack/neutron/neutron/tests/base.py", line 181, in func
    return f(self, *args, **kwargs)
  File "/home/zuul/src/opendev.org/openstack/neutron/neutron/tests/unit/objects/test_base.py", line 2014, in test_objects_exist_validate_filters_false
    self._make_object(fields).create()
  File "/home/zuul/src/opendev.org/openstack/neutron/neutron/objects/base.py", line 337, in decorator
    return func(self, *args, **kwargs)
  File "/home/zuul/src/opendev.org/openstack/neutron/neutron/objects/base.py", line 870, in create
    object_class=self.__class__, db_exception=db_exc)
neutron_lib.objects.exceptions.NeutronDbObjectDuplicateEntry: Failed to create a duplicate NetworkDhcpAgentBinding: for attribute(s) ['network_id', 'binding_index'] with value(s) None

[1] https://review.opendev.org/#/c/288271/28/neutron/db/migration/alembic_migrations/versions/train/expand/c3e9d13c4367_add_binding_index_to_.py
[2] https://storage.gra1.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/zuul_opendev_logs_2aa/690514/4/check/openstack-tox-py36/2aadb9c/testr_results.html.gz
[3] https://cb9c7313dea10c2758bb-cbf7b900962d6b77d5144bf757270132.ssl.cf2.rackcdn.com/690514/4/gate/openstack-tox-py36/a9064c9/testr_results.html.gz

** Affects: neutron
     Importance: Undecided
         Status: New

** Description changed:

- As commented in [1], the "autoincrement" parameter in a non-primary key
- column does not work. This will lead to problems when creating objects
- without specifying explicitly the "binding_index" column. We can see
- some errors in UTs [2][3].
+ Bug related to:
+ - https://bugs.launchpad.net/neutron/+bug/1535554
+ - https://review.opendev.org/#/c/288271/
  
+ 
+ As commented in [1], the "autoincrement" parameter in a non-primary key column does not work. This will lead to problems when creating objects without specifying explicitly the "binding_index" column. We can see some errors in UTs [2][3].
  
  Error log (http://paste.openstack.org/show/785596/):
  oslo_db.exception.DBDuplicateEntry: (sqlite3.IntegrityError) UNIQUE constraint failed: networkdhcpagentbindings.network_id, networkdhcpagentbindings.binding_index
  [SQL: INSERT INTO networkdhcpagentbindings (network_id, dhcp_agent_id, binding_index) VALUES (?, ?, ?)]
  [parameters: ('d87f9ef1-e892-4d32-b3fa-5b7d07fd1107', '5a909c22-3a34-4e16-b129-07e3ea1807a8', 783)]
  (Background on this error at: http://sqlalche.me/e/gkpj)
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
-   File "/home/zuul/src/opendev.org/openstack/neutron/neutron/tests/base.py", line 181, in func
-     return f(self, *args, **kwargs)
-   File "/home/zuul/src/opendev.org/openstack/neutron/neutron/tests/unit/objects/test_base.py", line 2014, in test_objects_exist_validate_filters_false
-     self._make_object(fields).create()
-   File "/home/zuul/src/opendev.org/openstack/neutron/neutron/objects/base.py", line 337, in decorator
-     return func(self, *args, **kwargs)
-   File "/home/zuul/src/opendev.org/openstack/neutron/neutron/objects/base.py", line 870, in create
-     object_class=self.__class__, db_exception=db_exc)
+   File "/home/zuul/src/opendev.org/openstack/neutron/neutron/tests/base.py", line 181, in func
+     return f(self, *args, **kwargs)
+   File "/home/zuul/src/opendev.org/openstack/neutron/neutron/tests/unit/objects/test_base.py", line 2014, in test_objects_exist_validate_filters_false
+     self._make_object(fields).create()
+   File "/home/zuul/src/opendev.org/openstack/neutron/neutron/objects/base.py", line 337, in decorator
+     return func(self, *args, **kwargs)
+   File "/home/zuul/src/opendev.org/openstack/neutron/neutron/objects/base.py", line 870, in create
+     object_class=self.__class__, db_exception=db_exc)
  neutron_lib.objects.exceptions.NeutronDbObjectDuplicateEntry: Failed to create a duplicate NetworkDhcpAgentBinding: for attribute(s) ['network_id', 'binding_index'] with value(s) None
- 
  
  [1] https://review.opendev.org/#/c/288271/28/neutron/db/migration/alembic_migrations/versions/train/expand/c3e9d13c4367_add_binding_index_to_.py
  [2] https://storage.gra1.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/zuul_opendev_logs_2aa/690514/4/check/openstack-tox-py36/2aadb9c/testr_results.html.gz
  [3] https://cb9c7313dea10c2758bb-cbf7b900962d6b77d5144bf757270132.ssl.cf2.rackcdn.com/690514/4/gate/openstack-tox-py36/a9064c9/testr_results.html.gz

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

Title:
  "networkdhcpagentbindings.binding_index" autoincrement parameter is
  not working

Status in neutron:
  New

Bug description:
  Bug related to:
  - https://bugs.launchpad.net/neutron/+bug/1535554
  - https://review.opendev.org/#/c/288271/

  
  As commented in [1], the "autoincrement" parameter in a non-primary key column does not work. This will lead to problems when creating objects without specifying explicitly the "binding_index" column. We can see some errors in UTs [2][3].

  Error log (http://paste.openstack.org/show/785596/):
  oslo_db.exception.DBDuplicateEntry: (sqlite3.IntegrityError) UNIQUE constraint failed: networkdhcpagentbindings.network_id, networkdhcpagentbindings.binding_index
  [SQL: INSERT INTO networkdhcpagentbindings (network_id, dhcp_agent_id, binding_index) VALUES (?, ?, ?)]
  [parameters: ('d87f9ef1-e892-4d32-b3fa-5b7d07fd1107', '5a909c22-3a34-4e16-b129-07e3ea1807a8', 783)]
  (Background on this error at: http://sqlalche.me/e/gkpj)

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/home/zuul/src/opendev.org/openstack/neutron/neutron/tests/base.py", line 181, in func
      return f(self, *args, **kwargs)
    File "/home/zuul/src/opendev.org/openstack/neutron/neutron/tests/unit/objects/test_base.py", line 2014, in test_objects_exist_validate_filters_false
      self._make_object(fields).create()
    File "/home/zuul/src/opendev.org/openstack/neutron/neutron/objects/base.py", line 337, in decorator
      return func(self, *args, **kwargs)
    File "/home/zuul/src/opendev.org/openstack/neutron/neutron/objects/base.py", line 870, in create
      object_class=self.__class__, db_exception=db_exc)
  neutron_lib.objects.exceptions.NeutronDbObjectDuplicateEntry: Failed to create a duplicate NetworkDhcpAgentBinding: for attribute(s) ['network_id', 'binding_index'] with value(s) None

  [1] https://review.opendev.org/#/c/288271/28/neutron/db/migration/alembic_migrations/versions/train/expand/c3e9d13c4367_add_binding_index_to_.py
  [2] https://storage.gra1.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/zuul_opendev_logs_2aa/690514/4/check/openstack-tox-py36/2aadb9c/testr_results.html.gz
  [3] https://cb9c7313dea10c2758bb-cbf7b900962d6b77d5144bf757270132.ssl.cf2.rackcdn.com/690514/4/gate/openstack-tox-py36/a9064c9/testr_results.html.gz

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


Follow ups