L3HARouterVRIdAllocationDbObjectTestCase.test_delete_objects fails because of duplicate record

Bug #1717046 reported by Ihar Hrachyshka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Invalid
Medium
Unassigned

Bug Description

http://logs.openstack.org/94/503794/1/check/gate-neutron-python35/27f478d/testr_results.html.gz

Traceback (most recent call last):
  File "/home/jenkins/workspace/gate-neutron-python35/neutron/objects/base.py", line 633, in create
    self.modify_fields_to_db(fields))
  File "/home/jenkins/workspace/gate-neutron-python35/neutron/objects/db/api.py", line 61, in create_object
    context.session.add(db_obj)
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 567, in __exit__
    self.rollback()
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 187, in reraise
    raise value
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 564, in __exit__
    self.commit()
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 461, in commit
    self._prepare_impl()
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 441, in _prepare_impl
    self.session.flush()
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 2177, in flush
    self._flush(objects)
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 2297, in _flush
    transaction.rollback(_capture_exception=True)
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 187, in reraise
    raise value
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 2261, in _flush
    flush_context.execute()
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/unitofwork.py", line 389, in execute
    rec.execute(self)
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/unitofwork.py", line 548, in execute
    uow
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/persistence.py", line 181, in save_obj
    mapper, table, insert)
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/persistence.py", line 799, in _emit_insert_statements
    execute(statement, multiparams)
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 945, in execute
    return meth(self, multiparams, params)
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
    context)
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1398, in _handle_dbapi_exception
    util.raise_from_cause(newraise, exc_info)
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 186, in reraise
    raise value.with_traceback(tb)
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
    cursor.execute(statement, parameters)
oslo_db.exception.DBDuplicateEntry: (sqlite3.IntegrityError) UNIQUE constraint failed: ha_router_vrid_allocations.network_id, ha_router_vrid_allocations.vr_id [SQL: 'INSERT INTO ha_router_vrid_allocations (network_id, vr_id) VALUES (?, ?)'] [parameters: ('af5e7d3e-c0d4-4a82-8ef5-2d930cfdd5e6', 566)]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jenkins/workspace/gate-neutron-python35/neutron/tests/base.py", line 118, in func
    return f(self, *args, **kwargs)
  File "/home/jenkins/workspace/gate-neutron-python35/neutron/tests/unit/objects/test_base.py", line 1887, in test_delete_objects
    self._make_object(fields).create()
  File "/home/jenkins/workspace/gate-neutron-python35/neutron/objects/base.py", line 225, in decorator
    res = func(self, *args, **kwargs)
  File "/home/jenkins/workspace/gate-neutron-python35/neutron/objects/base.py", line 636, in create
    object_class=self.__class__, db_exception=db_exc)
neutron_lib.objects.exceptions.NeutronDbObjectDuplicateEntry: Failed to create a duplicate L3HARouterVRIdAllocation: for attribute(s) ['network_id', 'vr_id'] with value(s) None

Changed in neutron:
status: New → Confirmed
assignee: nobody → Ihar Hrachyshka (ihar-hrachyshka)
importance: Undecided → High
tags: added: gate-failure
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/503854

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/504498

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (master)

Reviewed: https://review.openstack.org/504498
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=c56a8c1b7ef554ea93a2def2c1ffab3e82f1592e
Submitter: Jenkins
Branch: master

commit c56a8c1b7ef554ea93a2def2c1ffab3e82f1592e
Author: Ihar Hrachyshka <email address hidden>
Date: Fri Sep 15 13:21:13 2017 -0600

    tests: generate unique network ids for L3HARouterVRIdAllocation

    There is a bug in base test class where self.db_objs may end up with
    non-unique values after update_obj_fields call. While we are looking at
    fixing the underlying issue in the base class, this patch merely makes
    L3HARouterVRIdAllocationDbObjectTestCase to not reuse the same network
    id for all test objects.

    Change-Id: Ib4e5ffa1df5adba5460d7e66d1c21b63745a7141
    Related-Bug: #1717046

Revision history for this message
Ihar Hrachyshka (ihar-hrachyshka) wrote :

Gate failure is fixed, removed the gate-failure tag, and lowered the importance to Medium.

Changed in neutron:
importance: High → Medium
tags: removed: gate-failure
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote : auto-abandon-script

This bug has had a related patch abandoned and has been automatically un-assigned due to inactivity. Please re-assign yourself if you are continuing work or adjust the state as appropriate if it is no longer valid.

Changed in neutron:
assignee: Ihar Hrachyshka (ihar-hrachyshka) → nobody
status: In Progress → New
tags: added: timeout-abandon
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Armando Migliaccio (<email address hidden>) on branch: master
Review: https://review.openstack.org/503854
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Revision history for this message
Ihar Hrachyshka (ihar-hrachyshka) wrote :
tags: removed: timeout-abandon
Changed in neutron:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.