← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1938910] Re: Duplicate default SG error when new system scopes are used

 

Reviewed:  https://review.opendev.org/c/openstack/neutron/+/803489
Committed: https://opendev.org/openstack/neutron/commit/e6c3686cd8f863c49b363504dacdb7641604a102
Submitter: "Zuul (22348)"
Branch:    master

commit e6c3686cd8f863c49b363504dacdb7641604a102
Author: Slawek Kaplonski <skaplons@xxxxxxxxxx>
Date:   Wed Aug 4 17:02:14 2021 +0200

    Use elevated context when getting default SG for tenant
    
    With new scopes, when e.g. project admin context is used to ensure
    default SG for different tenant, elevated context needs to be used
    to make db query. Otherwise default SG will not be found and attempt to
    create it in DB may fail with DuplicateDbEntry error.
    
    Closes-Bug: #1938910
    Change-Id: Ib884be6aa12bd0d3faf83f3e753f8e7aad503b68


** Changed in: neutron
       Status: In Progress => Fix Released

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

Title:
  Duplicate default SG error when new system scopes are used

Status in neutron:
  Fix Released

Bug description:
  When new system scopes are enforced, after fix for
  https://bugs.launchpad.net/neutron/+bug/1934115 is merged, there is
  another problem. When project admin creates SG for some tenant it
  tries to get default SG for that tenant to ensure that there is such
  default SG. But as project admin can't get resources which belongs to
  other tenant default SG is not found even if it actually is in DB. So
  that ends up with error like:

  Aug 04 16:11:26 devstack-ubuntu-ovs neutron-server[308908]: ERROR oslo_db.api oslo_db.exception.DBDuplicateEntry: (pymysql.err.IntegrityError) (1062, "Duplicate entry 'c8b4c762cac744da9b442bf12140c70a' for key 'default_security_group.PRIM>
  Aug 04 16:11:26 devstack-ubuntu-ovs neutron-server[308908]: ERROR oslo_db.api [SQL: INSERT INTO default_security_group (project_id, security_group_id) VALUES (%(project_id)s, %(security_group_id)s)]
  Aug 04 16:11:26 devstack-ubuntu-ovs neutron-server[308908]: ERROR oslo_db.api [parameters: {'project_id': 'c8b4c762cac744da9b442bf12140c70a', 'security_group_id': 'b88530f8-46a8-4190-96f1-bbfd9ddac83c'}]
  Aug 04 16:11:26 devstack-ubuntu-ovs neutron-server[308908]: ERROR oslo_db.api (Background on this error at: http://sqlalche.me/e/14/gkpj)

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



References