openstack router remove/add command out without error, when it fails

Bug #1821311 reported by Candido Campos Rivas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
New
Undecided
Unassigned

Bug Description

the command fails but the failure is not shown if you don't use --debug option:

(overcloud) [stack@undercloud-0 ~]$ openstack router remove subnet router selfservice ; echo $?
0
(overcloud) [stack@undercloud-0 ~]$
(overcloud) [stack@undercloud-0 ~]$
(overcloud) [stack@undercloud-0 ~]$ openstack router add subnet router selfservice ; echo $?
0

(overcloud) [stack@undercloud-0 ~]$ openstack router remove subnet router selfservice --debug
START with options: [u'router', u'remove', u'subnet', u'router', u'selfservice', u'--debug']
...

RESP: [409] Content-Length: 268 Content-Type: application/json Date: Fri, 22 Mar 2019 09:29:10 GMT X-Openstack-Request-Id: req-e46e3e8b-76d3-4535-8cad-e14eed2c9190
RESP BODY: {"NeutronError": {"message": "Router interface for subnet ca7de33b-98c7-4ff4-9fae-cc2fcb7c41cc on router daa62d34-037d-4188-a37c-ab5d058d5489 cannot be deleted, as it is required by one or more floating IPs.", "type": "RouterInterfaceInUseByFloatingIP", "detail": ""}}
PUT call to network for http://10.0.0.107:9696/v2.0/routers/daa62d34-037d-4188-a37c-ab5d058d5489/remove_router_interface used request id req-e46e3e8b-76d3-4535-8cad-e14eed2c9190
Manager unknown ran task network.PUT.routers.remove_router_interface in 1.10061788559s
clean_up RemoveSubnetFromRouter:
END return value: 0
(overcloud) [stack@undercloud-0 ~]$

Reproduction example:

 -create a router:

(overcloud) [stack@undercloud-0 ~]$ history | grep router
   18 openstack router create router
   19 openstack router add subnet router selfservice
   20 openstack router set router --external-gateway public

 -associate a floating ip to a vm:
   56 openstack server add floating ip provider-instance 10.0.0.216

 -try to add/remove the subnet

   61 openstack router remove subnet router selfservice --debug
   62 openstack router add subnet router selfservice --debug

Logs and versio:

(overcloud) [stack@undercloud-0 ~]$ yum info openstack-neutron
Loaded plugins: search-disabled-repos
Available Packages
Name : openstack-neutron
Arch : noarch
Epoch : 1
Version : 13.0.3
Release : 0.20190119134915.886782c.el7ost
Size : 28 k
Repo : rhelosp-14.0-puddle/x86_64
Summary : OpenStack Networking Service
URL : http://launchpad.net/neutron/
License : ASL 2.0
Description :
            : Neutron is a virtual network service for Openstack. Just like
            : OpenStack Nova provides an API to dynamically request and configure
            : virtual servers, Neutron provides an API to dynamically request and
            : configure virtual networks. These networks connect "interfaces" from
            : other OpenStack services (e.g., virtual NICs from Nova VMs). The
            : Neutron API supports extensions to provide advanced network
            : capabilities (e.g., QoS, ACLs, network monitoring, etc.)

(overcloud) [stack@undercloud-0 ~]$ cat /etc/rhosp-release
Red Hat OpenStack Platform release 14.0.1 RC (Rocky)

(overcloud) [stack@undercloud-0 ~]$ openstack server add floating ip provider-instance 10.0.0.216
(overcloud) [stack@undercloud-0 ~]$ openstack router remove subnet router selfservice
(overcloud) [stack@undercloud-0 ~]$
(overcloud) [stack@undercloud-0 ~]$
(overcloud) [stack@undercloud-0 ~]$
(overcloud) [stack@undercloud-0 ~]$ openstack router show router
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| admin_state_up | UP |
| availability_zone_hints | |
| availability_zones | nova |
| created_at | 2019-03-22T08:54:12Z |
| description | |
| distributed | None |
| external_gateway_info | {"network_id": "ef3db5e4-8e6e-4e40-8575-c8f3400e21aa", "enable_snat": true, "external_fixed_ips": [{"subnet_id": "e74f8ff3-cf78-47a9-8fea-ef6612749988", "ip_address": "10.0.0.213"}]} |
| flavor_id | None |
| ha | None |
| id | daa62d34-037d-4188-a37c-ab5d058d5489 |
| interfaces_info | [{"subnet_id": "ca7de33b-98c7-4ff4-9fae-cc2fcb7c41cc", "ip_address": "10.1.0.1", "port_id": "b2872491-a430-4560-ada3-1e02695fa74f"}, {"subnet_id": "ca7de33b-98c7-4ff4-9fae-cc2fcb7c41cc", "ip_address": "10.1.0.26", "port_id": "be992a1f-de15-473e-bc52-2e79faa2b0e0"}] |
| name | router |
| project_id | c4b7aee7b6404c24aa7b33428e9ad271 |
| revision_number | 4 |
| routes | |
| status | ACTIVE |
| tags | |
| updated_at | 2019-03-22T08:54:45Z |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
(overcloud) [stack@undercloud-0 ~]$
(overcloud) [stack@undercloud-0 ~]$
(overcloud) [stack@undercloud-0 ~]$ openstack router remove subnet router selfservice ; echo $?
0
(overcloud) [stack@undercloud-0 ~]$
(overcloud) [stack@undercloud-0 ~]$
(overcloud) [stack@undercloud-0 ~]$ openstack router add subnet router selfservice ; echo $?
0
(overcloud) [stack@undercloud-0 ~]$ openstack router remove subnet router selfservice --debug
START with options: [u'router', u'remove', u'subnet', u'router', u'selfservice', u'--debug']
...
....
489/remove_router_interface HTTP/1.1" 409 268
RESP: [409] Content-Length: 268 Content-Type: application/json Date: Fri, 22 Mar 2019 09:29:10 GMT X-Openstack-Request-Id: req-e46e3e8b-76d3-4535-8cad-e14eed2c9190
RESP BODY: {"NeutronError": {"message": "Router interface for subnet ca7de33b-98c7-4ff4-9fae-cc2fcb7c41cc on router daa62d34-037d-4188-a37c-ab5d058d5489 cannot be deleted, as it is required by one or more floating IPs.", "type": "RouterInterfaceInUseByFloatingIP", "detail": ""}}
PUT call to network for http://10.0.0.107:9696/v2.0/routers/daa62d34-037d-4188-a37c-ab5d058d5489/remove_router_interface used request id req-e46e3e8b-76d3-4535-8cad-e14eed2c9190
Manager unknown ran task network.PUT.routers.remove_router_interface in 1.10061788559s
clean_up RemoveSubnetFromRouter:
END return value: 0
(overcloud) [stack@undercloud-0 ~]$
(overcloud) [stack@undercloud-0 ~]$
(overcloud) [stack@undercloud-0 ~]$ openstack router add subnet router selfservice --debug
START with options: [u'router', u'add', u'subnet', u'router', u'selfservice', u'--debug']

...............................

/10.0.0.107:9696/v2.0/routers used request id req-a0cc03ac-41ab-4778-9d34-c0cb09ed7c1b
Manager unknown ran task network.GET.routers in 0.708297967911s
Manager unknown running task network.PUT.routers.add_router_interface
REQ: curl -g -i -X PUT http://10.0.0.107:9696/v2.0/routers/daa62d34-037d-4188-a37c-ab5d058d5489/add_router_interface -H "Content-Type: application/json" -H "User-Agent: openstacksdk/0.17.2 keystoneauth1/3.10.0 python-requests/2.19.1 CPython/2.7.5" -H "X-Auth-Token: {SHA1}9a5402393205c1bd2bf71649ed6b08c29893541a" -d '{"subnet_id": "ca7de33b-98c7-4ff4-9fae-cc2fcb7c41cc"}'
http://10.0.0.107:9696 "PUT /v2.0/routers/daa62d34-037d-4188-a37c-ab5d058d5489/add_router_interface HTTP/1.1" 400 162
RESP: [400] Content-Length: 162 Content-Type: application/json Date: Fri, 22 Mar 2019 09:29:40 GMT X-Openstack-Request-Id: req-4480dc18-562c-4abc-ad29-1b09f38d479d
RESP BODY: {"NeutronError": {"message": "Bad router request: Router already has a port on subnet ca7de33b-98c7-4ff4-9fae-cc2fcb7c41cc.", "type": "BadRequest", "detail": ""}}
PUT call to network for http://10.0.0.107:9696/v2.0/routers/daa62d34-037d-4188-a37c-ab5d058d5489/add_router_interface used request id req-4480dc18-562c-4abc-ad29-1b09f38d479d
Manager unknown ran task network.PUT.routers.add_router_interface in 0.781075954437s
clean_up AddSubnetToRouter:
END return value: 0
(overcloud) [stack@undercloud-0 ~]$

(overcloud) [stack@undercloud-0 ~]$ openstack router show router
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| admin_state_up | UP |
| availability_zone_hints | |
| availability_zones | nova |
| created_at | 2019-03-22T08:54:12Z |
| description | |
| distributed | None |
| external_gateway_info | {"network_id": "ef3db5e4-8e6e-4e40-8575-c8f3400e21aa", "enable_snat": true, "external_fixed_ips": [{"subnet_id": "e74f8ff3-cf78-47a9-8fea-ef6612749988", "ip_address": "10.0.0.213"}]} |
| flavor_id | None |
| ha | None |
| id | daa62d34-037d-4188-a37c-ab5d058d5489 |
| interfaces_info | [{"subnet_id": "ca7de33b-98c7-4ff4-9fae-cc2fcb7c41cc", "ip_address": "10.1.0.1", "port_id": "b2872491-a430-4560-ada3-1e02695fa74f"}, {"subnet_id": "ca7de33b-98c7-4ff4-9fae-cc2fcb7c41cc", "ip_address": "10.1.0.26", "port_id": "be992a1f-de15-473e-bc52-2e79faa2b0e0"}] |
| name | router |
| project_id | c4b7aee7b6404c24aa7b33428e9ad271 |
| revision_number | 4 |
| routes | |
| status | ACTIVE |
| tags | |
| updated_at | 2019-03-22T08:54:45Z |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Revision history for this message
Miguel Lavalle (minsel) wrote :

This bug should be filed against python-openstackclient

affects: neutron → python-openstackclient
Revision history for this message
Slawek Kaplonski (slaweq) wrote :
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.