Some ports assigned to routers don't have the correspondent routerport register

Bug #1842937 reported by Rodolfo Alonso
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Rodolfo Alonso

Bug Description

When running a few subnet detaching from router and deletion, some subnets are not possible to be deleted with this error:

$ openstack subnet delete e81929f6-25ea-45c2-89b5-ff94afd7136a
Failed to delete subnet with name or ID 'e81929f6-25ea-45c2-89b5-ff94afd7136a': ConflictException: 409: Client Error for url: http://10.0.0.104:9696/v2.0/subnets/e81929f6-25ea-45c2-89b5-ff94afd7136a, {"NeutronError": {"message": "Unable to complete operation on subnet e81929f6-25ea-45c2-89b5-ff94afd7136a: One or more ports have an IP allocation from this subnet.", "type": "SubnetInUse", "detail": ""}}
1 of 1 subnets failed to delete.

After checking the ports in that subnet, only the router_interface port is left behing (but in DOWN status):
$ openstack subnet show e81929f6-25ea-45c2-89b5-ff94afd7136a
+-------------------+--------------------------------------+
| Field | Value |
+-------------------+--------------------------------------+
| allocation_pools | 10.128.8.2-10.128.8.254 |
| cidr | 10.128.8.0/24 |
| created_at | 2019-08-29T17:09:03Z |
| description | |
| dns_nameservers | |
| enable_dhcp | False |
| gateway_ip | 10.128.8.1 |
| host_routes | |
| id | e81929f6-25ea-45c2-89b5-ff94afd7136a |
| ip_version | 4 |
| ipv6_address_mode | None |
| ipv6_ra_mode | None |
| name | ns/openshift-kube-scheduler-subnet |
| network_id | af217883-9f09-44ab-9cd4-cd99f829f412 |
| project_id | dcb34bf98dea46928294ff6762d9c167 |
| revision_number | 1 |
| segment_id | None |
| service_types | |
| subnetpool_id | c87c9254-7c81-43e2-ac1f-af92b35b11a4 |
| tags | openshiftClusterID=ostest-mkp6s |
| updated_at | 2019-08-29T17:09:22Z |
+-------------------+--------------------------------------+

$ openstack port list | grep 10.128.8
| 15c52021-372c-4217-8232-e5be7ed25828 | | fa:16:3e:8a:73:12 | ip_address='10.128.8.1', subnet_id='e81929f6-25ea-45c2-89b5-ff94afd7136a' | DOWN |

Trying to detach that subnet from router does not return any error, but if run with '-vvv' the next appears:
$ openstack -vvv router remove subnet 33114251-4771-490a-bd7b-10a51e017719 e81929f6-25ea-45c2-89b5-ff94afd7136a 2>&1 | grep "has no interface"
RESP BODY: {"NeutronError": {"message": "Router 33114251-4771-490a-bd7b-10a51e017719 has no interface on subnet e81929f6-25ea-45c2-89b5-ff94afd7136a", "type": "RouterInterfaceNotFoundForSubnet", "detail": ""}}

And checking the database it is true that it is NOT there:
MariaDB [ovs_neutron]> select * from routerports;
+--------------------------------------+--------------------------------------+--------------------------+
| router_id | port_id | port_type |
+--------------------------------------+--------------------------------------+--------------------------+
| 33114251-4771-490a-bd7b-10a51e017719 | 65de9a4b-1630-4597-a347-037e094c79d5 | network:router_interface |
| 33114251-4771-490a-bd7b-10a51e017719 | e769fb4f-cf39-4199-b354-df91912374de | network:router_interface |
+--------------------------------------+--------------------------------------+--------------------------+

However, by checking the router we get it is there:
$ openstack router show 33114251-4771-490a-bd7b-10a51e017719 -c interfaces_info -f value | jq '.' | grep -C 3 10.128.8
[
  {
    "port_id": "15c52021-372c-4217-8232-e5be7ed25828",
    "ip_address": "10.128.8.1",
    "subnet_id": "e81929f6-25ea-45c2-89b5-ff94afd7136a"
  },
  {

Changed in neutron:
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)
Changed in neutron:
status: New → In Progress
Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/680413
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=c952b5960001faf98186b630fde75deafe5a7b8f
Submitter: Zuul
Branch: master

commit c952b5960001faf98186b630fde75deafe5a7b8f
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Thu Sep 5 10:34:26 2019 +0000

    Handle ports assigned to routers without routerports

    In the case of having a port attached to a router but the routerport
    register is missing (as seen in the bug reported), this patch retrieves
    the full list of ports attached to a router, filtering by router ID
    and network ID or port ID. In case of having a port attached to this
    router with missing routerport register, a warning message is logged.

    Closes-Bug: #1842937

    Change-Id: I93f35eade6aa081160902d9d47278123815c04d1

Changed in neutron:
status: In Progress → Fix Released
tags: added: neutron-proactive-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/688657

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/688659

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/688674

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/stein)

Reviewed: https://review.opendev.org/688659
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=626eca984f08b0c073d7a1be29f5075e0324dabe
Submitter: Zuul
Branch: stable/stein

commit 626eca984f08b0c073d7a1be29f5075e0324dabe
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Thu Sep 5 10:34:26 2019 +0000

    Handle ports assigned to routers without routerports

    In the case of having a port attached to a router but the routerport
    register is missing (as seen in the bug reported), this patch retrieves
    the full list of ports attached to a router, filtering by router ID
    and network ID or port ID. In case of having a port attached to this
    router with missing routerport register, a warning message is logged.

    Closes-Bug: #1842937

    Change-Id: I93f35eade6aa081160902d9d47278123815c04d1
    (cherry picked from commit c952b5960001faf98186b630fde75deafe5a7b8f)
    (cherry picked from commit e5650d19bf6ccb87dd7a4c67153a23cca70b3ab3)

tags: added: in-stable-stein
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/rocky)

Reviewed: https://review.opendev.org/688674
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=f57e0e6029da3efefd71941d6163a9e03919472a
Submitter: Zuul
Branch: stable/rocky

commit f57e0e6029da3efefd71941d6163a9e03919472a
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Thu Sep 5 10:34:26 2019 +0000

    Handle ports assigned to routers without routerports

    In the case of having a port attached to a router but the routerport
    register is missing (as seen in the bug reported), this patch retrieves
    the full list of ports attached to a router, filtering by router ID
    and network ID or port ID. In case of having a port attached to this
    router with missing routerport register, a warning message is logged.

    Closes-Bug: #1842937

    Change-Id: I93f35eade6aa081160902d9d47278123815c04d1
    (cherry picked from commit c952b5960001faf98186b630fde75deafe5a7b8f)
    (cherry picked from commit e5650d19bf6ccb87dd7a4c67153a23cca70b3ab3)
    (cherry picked from commit 626eca984f08b0c073d7a1be29f5075e0324dabe)

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/train)

Reviewed: https://review.opendev.org/688657
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=e5650d19bf6ccb87dd7a4c67153a23cca70b3ab3
Submitter: Zuul
Branch: stable/train

commit e5650d19bf6ccb87dd7a4c67153a23cca70b3ab3
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Thu Sep 5 10:34:26 2019 +0000

    Handle ports assigned to routers without routerports

    In the case of having a port attached to a router but the routerport
    register is missing (as seen in the bug reported), this patch retrieves
    the full list of ports attached to a router, filtering by router ID
    and network ID or port ID. In case of having a port attached to this
    router with missing routerport register, a warning message is logged.

    Closes-Bug: #1842937

    Change-Id: I93f35eade6aa081160902d9d47278123815c04d1
    (cherry picked from commit c952b5960001faf98186b630fde75deafe5a7b8f)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 14.0.3

This issue was fixed in the openstack/neutron 14.0.3 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 13.0.5

This issue was fixed in the openstack/neutron 13.0.5 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 15.0.1

This issue was fixed in the openstack/neutron 15.0.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 16.0.0.0b1

This issue was fixed in the openstack/neutron 16.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.opendev.org/718216

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/queens)

Reviewed: https://review.opendev.org/718216
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=667f33cb25bb438258cb08c6f96fa027f828af3b
Submitter: Zuul
Branch: stable/queens

commit 667f33cb25bb438258cb08c6f96fa027f828af3b
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Thu Sep 5 10:34:26 2019 +0000

    Handle ports assigned to routers without routerports

    In the case of having a port attached to a router but the routerport
    register is missing (as seen in the bug reported), this patch retrieves
    the full list of ports attached to a router, filtering by router ID
    and network ID or port ID. In case of having a port attached to this
    router with missing routerport register, a warning message is logged.

    Closes-Bug: #1842937

    Change-Id: I93f35eade6aa081160902d9d47278123815c04d1
    (cherry picked from commit c952b5960001faf98186b630fde75deafe5a7b8f)
    (cherry picked from commit e5650d19bf6ccb87dd7a4c67153a23cca70b3ab3)
    (cherry picked from commit 626eca984f08b0c073d7a1be29f5075e0324dabe)
    (cherry picked from commit f57e0e6029da3efefd71941d6163a9e03919472a)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron queens-eol

This issue was fixed in the openstack/neutron queens-eol release.

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.