[CONTROLLER-1281] Unable to configure a BGP peer through RESTCONF Created: 27/Apr/15  Updated: 19/Oct/17  Resolved: 29/Apr/15

Status: Resolved
Project: controller
Component/s: netconf
Affects Version/s: Post-Helium
Fix Version/s: None

Type: Bug
Reporter: Jozef Behran Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 3070
Priority: Normal

 Description   

Any attempt to add a BGP peer through RESTCONF will be rejected.

Steps to reproduce:

1. ODL_ROOT=<where_yourODL_installation_lives>
2. Boot ODL.
3. Install features "odl-restconf", "odl-bgppcep-bgp-all" and "odl-netconf-connector-all".
4. Wait for ODL to fully load (run "top" in another console and wait until CPU usage of the massive Java process stays below 5%).
5. curl -u 'admin:admin' -X POST -H "Content-Type:application/xml" -d '
<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
<name>example-bgp-peer</name>
<peer-role>Ibgp</peer-role>
<host>127.0.0.201</host>
<holdtimer>180</holdtimer>
</module>
' 127.0.0.1:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules

You will get the following error from the command in step 5:

{
"errors": {
"error": [

{ "error-type": "protocol", "error-tag":"malformed-message", "error-message":"Error parsing input: Unknown child(ren) node(s) detected, identified by: (urn:opendaylight:params:xml:ns:yang:controller:config)peer-role, in: list module" }

]
}
}

No errors will be logged into the logs.

Note also that I suspect this might be just a different symptom of CONTROLLER-1280 but I am not sure. The two paths to the breakage and the two symptoms are quite different, the only thing that these two have in common is than in both a BGP peer configuration is involved. To increase clarity and prevent confusion I logged these two symptoms as 2 separate bugs.



 Comments   
Comment by Jozef Behran [ 27/Apr/15 ]

This bug prevents the test scenario described at https://wiki.opendaylight.org/view/BGP_LS_PCEP:Lithium_Feature_Tests#How_to_test_2. This blocks completion of M5 as described here: https://wiki.opendaylight.org/view/Simultaneous_Release:Lithium_Release_Plan (section "Schedule", the row labelled "M5" in the big table). Setting to "Highest" importance as the deadline is in just a few days.

Comment by Maros Marsalek [ 28/Apr/15 ]

The input is incorrect. All the xml elements (except type and name) are missing correct namespace from bgp model. Try with correct namespaces.

Comment by RichardHill [ 28/Apr/15 ]

The namespaces are described here:

https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#Configuration_through_RESTCONF

There is also a directive "It is vital that you respect the order of steps described in user guide." which requires configuring RIB first.

Comment by Vratko Polak [ 28/Apr/15 ]

> The namespaces are described here:

I can tentatively confirm that using bgp-peer configuration data as presented in https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_listener
(that is, without any peer-role element)
the POST is successful, after which CONTROLLER-1280 appears, karaf.log confirming that "Ibgp" value was applied (it is the default).
I will leave it to Jozef to verify the bgp-peer configured this way functions as expected.
In the meantime, I am decreasing Importance to Normal, as work on testing deliverables is (hopefully) not blocked anymore.
I am leaving Status as CONFIRMED, as this bug still applies to peer-roles other than Ibgp.

For example this curl:
curl -u 'admin:admin' -X POST -H "Content-Type:application/xml" -d '<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
<type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-peer</type>
<name>example-bgp-peer</name>
<host xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">192.0.2.1</host>
<holdtimer xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">180</holdtimer><peer-role xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">Ebgp</peer-role>
<rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
<type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:cfg">x:rib</type>
<name>example-bgp-rib</name>
</rib>
<peer-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
<type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-peer-registry</type>
<name>global-bgp-peer-registry</name>
</peer-registry>
<advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
<type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
<name>ipv4-unicast</name>
</advertized-table>
<advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
<type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
<name>ipv6-unicast</name>
</advertized-table>
<advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
<type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
<name>linkstate</name>
</advertized-table>
</module>' 127.0.0.1:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules

Leads to this response (code 400):
{"errors":{"error":[

{"error-type":"protocol","error-tag":"malformed-message","error-message":"Error parsing input: Invalid value 'Ebgp' for enum type. Allowed values are: [ebgp, ibgp, rr-client]"}

]}}

Replacing "Ebgp" with "ebgp" leads to another response (code 500):
{"errors":{"error":[

{"error-type":"application","error-tag":"operation-failed","error-message":"Error creating data"}

]}}

Neither POST generates anything in karaf.log, which is itself a minor bug.

Comment by Maros Marsalek [ 28/Apr/15 ]

This bug was opened due to following error when posting config without namespaces:

{
"errors": {
"error": [

{ "error-type": "protocol", "error-tag":"malformed-message", "error-message":"Error parsing input: Unknown child(ren) node(s) detected, identified by: (urn:opendaylight:params:xml:ns:yang:controller:config)peer-role, in: list module" }

]
}
}

Which is correct error response to invalid input.

I believe this should be closed as its unrelated to 3069 (enum leaves parse/serialize)

Comment by Vratko Polak [ 28/Apr/15 ]

> This bug was opened due to following error when posting config without
> namespaces:

Fair enough. CONTROLLER-1283 opened, this bug set to INVALID.

Comment by Jozef Behran [ 29/Apr/15 ]

Fixed wiki to make this point crystal clear so I won't get confused anymore. The "correct namespace for every element" version works, now the remaining thing to confirm is to see whether the (re)configured peer also works.

Generated at Wed Feb 07 19:55:08 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.