[CONTROLLER-1368] Restconf drops namespace for target-rib type (BGP application peer config) Created: 11/Jun/15  Updated: 16/Jun/15  Resolved: 16/Jun/15

Status: Verified
Project: controller
Component/s: config
Affects Version/s: Lithium
Fix Version/s: None

Type: Bug
Reporter: Vratko Polak Assignee: Maros Marsalek
Resolution: Done 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: 3675

 Description   

Here is the link describing how to configure application RIB: https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Application_Peer

When the data is added to 41-example-bgp.xml config file, module is created correctly. But if restconf PUT is used to create (or update) the module, using the following command:
curl -v -X PUT -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-application-peer</type>
<name>example-bgp-peer-app</name>
<bgp-peer-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">22.22.22.22</bgp-peer-id>
<target-rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:rib-instance</type>
<name>example-bgp-rib</name>
</target-rib>
<application-rib-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">example-app-rib</application-rib-id>
<data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
<type xmlns:sal="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">sal:dom-async-data-broker</type>
<name>pingpong-broker</name>
</data-broker>
</module>' 127.0.0.1:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-bgp-rib-impl-cfg:bgp-application-peer/example-bgp-peer-app

it returns http status 500. Here is segment of karaf.log:

2015-06-11 13:39:39,719 | WARN | oupCloseable-6-1 | NetconfDeviceCommunicator | 240 - org.opendaylight.controller.sal-netconf-connector - 1.2.0.SNAPSHOT | RemoteDevice

{controller-config}

: Error reply from remote device, request: <rpc message-id="m-2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target>
<candidate/>
</target>
<default-operation>none</default-operation>
<config>
<modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
<module xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0" a:operation="replace">
<type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-application-peer</type>
<name>example-bgp-peer-app</name>
<application-rib-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">example-app-rib</application-rib-id>
<data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
<type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">x:dom-async-data-broker</type>
<name>pingpong-broker</name>
</data-broker>
<bgp-peer-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">22.22.22.22</bgp-peer-id>
<target-rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
<type>rib-instance</type>
<name>example-bgp-rib</name>
</target-rib>
</module>
</modules>
</config>
</edit-config>
</rpc>
, response: <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-2">
<rpc-error>
<error-type>application</error-type>
<error-tag>operation-failed</error-tag>
<error-severity>error</error-severity>
<error-message>Unexpected error</error-message>
<error-info>
<error>java.lang.IllegalStateException: Service type value not prefixed with namespace</error>
</error-info>
</rpc-error>
</rpc-reply>

The log shows <type>rib-instance</type>, which would explain which value was not prefixed, but the curl command did have prefix there: <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:rib-instance</type>
It seems the prefix was dropped somewhere in restconf (maybe because target-rib has the same prefix?) but netconf (or config) subsystem still requires it.



 Comments   
Comment by Maros Marsalek [ 11/Jun/15 ]

Looks like config fails to extract default namespace for identityrefs after recent update to identityref serialization (prefix is left out if possible).

Comment by Maros Marsalek [ 11/Jun/15 ]

https://git.opendaylight.org/gerrit/#/c/22374/

Comment by Vratko Polak [ 16/Jun/15 ]

Verified to be fixed on Lithium RC1 2015-06-16 build.

The PUT curl from description does replace config as expected.
It returns no text response with HTTP status code 200 (as opposed to 204), but that is not an issue within description of this bug.

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