BGPVPN client is post to the wrong endpoint

Bug #2064286 reported by Vinetos
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-neutronclient
Fix Released
Medium
Vinetos

Bug Description

Hello,
With the latest release of Openstack, the client and the plugin BGPVPN, running

openstack --debug bgpvpn network association create cl1-bgpvpn priv-net-1

shows that the client is posting to
v.2.0/bgpvpn/bgpvpns/{bgpvpn_id}/router_associations
instead of
v.2.0/bgpvpn/bgpvpns/{bgpvpn_id}/network_associations

REQ: curl -g -i --cacert "/etc/ssl/certs/oci-pki-oci-ca-chain.pem" -X POST https://cl1-api.vinetos.fr/network/v2.0/bgpvpn/bgpvpns/97844cd2-211d-47ab-a993-9f67c1202f85/router_associations -H "Content-Type: application/json" -H "User-Agent: openstacksdk/3.0.0 keystoneauth1/5.6.0 python-requests/2.31.0 CPython/3.11.2" -H "X-Auth-Token: {SHA256}8514c3537924fa6cd6a3525d0fbdcf29bdf7bf2ce3839d131bf12c9150657057" -d '{"router_association": {"network_id": "89a22d29-a4cd-4d87-8605-9791e3d833b7"}}'
Resetting dropped connection: cl1-api.vinetos.frnetwork_id
https://cl1-api.vinetos.fr:443 "POST /network/v2.0/bgpvpn/bgpvpns/97844cd2-211d-47ab-a993-9f67c1202f85/router_associations HTTP/1.1" 400 None
RESP: [400] connection: close content-type: application/json strict-transport-security: max-age=63072000 x-openstack-request-id: req-9c139d7b-4ac7-4552-95ff-43a627fa78a4
RESP BODY: {"NeutronError": {"type": "HTTPBadRequest", "message": "Unrecognized attribute(s) 'network_id'", "detail": ""}}

As excepted, Neutron does not recognized the body that should be for network_associations endpoint.

Step to reproduce : https://pastebin.com/SSPxD3DT

I am very new to Openstack but I am currently trying to identify with part of the client is handling this behavior in order to fix it.

You can see the raw output of the command here : https://pastebin.com/XN4jzadc

Important note: I have replaced the IDs in the command line by the resource name for reading purpose.

Cheers,
Valentin

Vinetos (vinetos)
description: updated
Vinetos (vinetos)
description: updated
Vinetos (vinetos)
description: updated
Revision history for this message
Vinetos (vinetos) wrote :

After some debugging, I found something interesting : In neutronclient/osc/v2/networking_bgpvpn/resource_association.py line 78 to 84 does invalid tests.

When running openstack bgpvpn network association create ...,
self._assoc_res_name is equal to 'network' and the constants.NETWORK_ASSOC is 'network_association'. This is why the command is failing.

I suppose there is the same problem for port association.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-neutronclient (master)
Changed in python-neutronclient:
status: New → In Progress
Changed in python-neutronclient:
assignee: nobody → Vinetos (vinetos)
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-neutronclient (master)

Reviewed: https://review.opendev.org/c/openstack/python-neutronclient/+/917835
Committed: https://opendev.org/openstack/python-neutronclient/commit/cb9aae55c83c2b79fdd5d15d93e5c12b35f0dd78
Submitter: "Zuul (22348)"
Branch: master

commit cb9aae55c83c2b79fdd5d15d93e5c12b35f0dd78
Author: Valentin Chassignol <email address hidden>
Date: Wed May 1 10:33:46 2024 +0200

    BGPVPN: Fix resource comparison

    This patch updates the resource comparison to accurately differentiate
    between the manipulation of networks, ports, and router associations.
    Introduced in I84fe4bb45d24c2f4a7a0246e2b9fb50354a715e0, the previous
    implementation contained incorrect variable names, leading to
    inconsistent results. This fix ensures that each resource type is
    properly identified during comparison.

    Closes-Bug: #2064286
    Change-Id: Ieb87174296240f8f76ec10b39007935545b1bd3f

Changed in python-neutronclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-neutronclient 11.3.0

This issue was fixed in the openstack/python-neutronclient 11.3.0 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.