[NETCONF-110] unable to configure ODL BGP via RESTCONF PUT to config:modules in latest 0.4.0 releases Created: 10/Dec/15  Updated: 15/Mar/19  Resolved: 15/Dec/15

Status: Resolved
Project: netconf
Component/s: netconf
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Giles Heron 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


Attachments: Zip Archive karaf.zip    
External issue ID: 4755

 Description   

recent 0.4.0 releases (at least since the beginning of December, and possibly older - the last one I have that worked is mid-Oct) fail when trying to configure e.g. the BGP RIB using a PUT to /restconf/config/network-topology:network-topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-bgp-rib-impl-cfg:rib-impl/example-bgp-rib.

the error I get ends with:

------
Caused by: NetconfDocumentedException{message=RemoteDevice

{controller-config}

: Edit candidate failed: [RpcError [message=Unexpected error, severity=ERROR, errorType=APPLICATION, tag=operation-failed, applicationTag=null, info=<error>java.lang.IllegalStateException: Unable to resolve value AttributeConfigElement [defaultValue=null, value=[MappedDependency

{namespace='urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl', serviceName='bgp-table-type', refName='ipv4-unicast'}

, MappedDependency

{namespace='urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl', serviceName='bgp-table-type', refName='ipv6-unicast'}

, MappedDependency

{namespace='urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl', serviceName='bgp-table-type', refName='linkstate'}

, MappedDependency

{namespace='urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl', serviceName='bgp-table-type', refName='flowspec'}

]] to attribute local-table</error>, cause=null]], errorType=application, errorTag=operation_failed, errorSeverity=warning, errorInfo={}}\n\tat org.opendaylight.netconf.sal.connect.netconf.sal.tx.AbstractWriteTx.invokeBlocking(AbstractWriteTx.java:69)\n\tat org.opendaylight.netconf.sal.connect.netconf.sal.tx.WriteCandidateTx.editConfig(WriteCandidateTx.java:188)\n\tat org.opendaylight.netconf.sal.connect.netconf.sal.tx.AbstractWriteTx.put(AbstractWriteTx.java:112)\n\t... 59 more\n"
}
]
}
}
------

Logs attached.



 Comments   
Comment by Giles Heron [ 10/Dec/15 ]

Attachment karaf.zip has been added with description: zipped logs

Comment by Vratko Polak [ 14/Dec/15 ]

I have tried to reproduce, but it seems to work for me. Is is just because your URL is missing /topology/ just before /topology-netconf/ (probably not, error is different).
Feel free to re-open if you have specific data that trigger your symptom.

Here is an example curl command (really long because all the data needed).

curl -H "Content-type:application/xml" -H "Accept:application/xml" -X PUT -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:rib-impl</type><name>example-bgp-rib</name><session-reconnect-strategy xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl"><type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:protocol:framework">x:reconnect-strategy-factory</type><name>example-reconnect-strategy-factory</name></session-reconnect-strategy><rib-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">example-bgp-rib</rib-id><extensions xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl"><type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:spi">x:extensions</type><name>global-rib-extensions</name></extensions><codec-tree-factory xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl"><type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">x:binding-codec-tree-factory</type><name>runtime-mapping-singleton</name></codec-tree-factory><openconfig-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl"><type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp-openconfig-spi">x:bgp-openconfig-provider</type><name>openconfig-bgp</name></openconfig-provider><tcp-reconnect-strategy xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl"><type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:protocol:framework">x:reconnect-strategy-factory</type><name>example-reconnect-strategy-factory</name></tcp-reconnect-strategy><local-as xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">64496</local-as><data-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl"><type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">x:binding-async-data-broker</type><name>pingpong-binding-data-broker</name></data-provider><bgp-dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl"><type>bgp-dispatcher</type><name>global-bgp-dispatcher</name></bgp-dispatcher><dom-data-provider 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>inmemory-data-broker</name></dom-data-provider><local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl"><type>bgp-table-type</type><name>ipv4-unicast</name></local-table><local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl"><type>bgp-table-type</type><name>ipv6-unicast</name></local-table><local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl"><type>bgp-table-type</type><name>linkstate</name></local-table><local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl"><type>bgp-table-type</type><name>ipv4-flowspec</name></local-table><local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl"><type>bgp-table-type</type><name>ipv6-flowspec</name></local-table><local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl"><type>bgp-table-type</type><name>labeled-unicast</name></local-table><bgp-rib-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">192.0.2.3</bgp-rib-id></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:rib-impl/example-bgp-rib

GET curl to confirm the change (in bgp-rib-id) was applied:
curl -H "Accept:application/xml" 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:rib-impl/example-bgp-rib

Comment by Giles Heron [ 14/Dec/15 ]

Of course that was a typo in the URL I gave. The correct URL is:

/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-bgp-rib-impl-cfg:rib-impl/example-bgp-rib

the data I PUT is:

{ "module" : [
{
"type": "odl-bgp-rib-impl-cfg:rib-impl",
"name": "example-bgp-rib",
"odl-bgp-rib-impl-cfg:bgp-rib-id": "172.23.29.120",
"odl-bgp-rib-impl-cfg:bgp-dispatcher":

{ "type": "odl-bgp-rib-impl-cfg:bgp-dispatcher", "name": "global-bgp-dispatcher" }

,
"odl-bgp-rib-impl-cfg:extensions":

{ "type": "odl-bgp-rib-spi-cfg:extensions", "name": "global-rib-extensions" }

,
"odl-bgp-rib-impl-cfg:tcp-reconnect-strategy":

{ "type": "protocol-framework:reconnect-strategy-factory", "name": "example-reconnect-strategy-factory" }

,
"odl-bgp-rib-impl-cfg:rib-id": "example-bgp-rib",
"odl-bgp-rib-impl-cfg:session-reconnect-strategy":

{ "type": "protocol-framework:reconnect-strategy-factory", "name": "example-reconnect-strategy-factory" }

,
"odl-bgp-rib-impl-cfg:local-table": [

{ "type": "odl-bgp-rib-impl-cfg:bgp-table-type", "name": "ipv4-unicast" }

,

{ "type": "odl-bgp-rib-impl-cfg:bgp-table-type", "name": "ipv6-unicast" }

,

{ "type": "odl-bgp-rib-impl-cfg:bgp-table-type", "name": "linkstate" }

,

{ "type": "odl-bgp-rib-impl-cfg:bgp-table-type", "name": "flowspec" }

],
"odl-bgp-rib-impl-cfg:data-provider":

{ "type": "opendaylight-md-sal-binding:binding-async-data-broker", "name": "pingpong-binding-data-broker" }

,
"odl-bgp-rib-impl-cfg:dom-data-provider":

{ "type": "opendaylight-md-sal-dom:dom-async-data-broker", "name": "pingpong-broker" }

,
"odl-bgp-rib-impl-cfg:codec-tree-factory":

{ "type": "opendaylight-md-sal-binding:binding-codec-tree-factory", "name": "runtime-mapping-singleton" }

,
"odl-bgp-rib-impl-cfg:local-as": 65504
}
]
}

this all works fine with lithium/stable, and with "older" releases of master (from October).

is this related to the fact that /restconf/config/network-topology:network-topology no longer works?

Comment by Giles Heron [ 14/Dec/15 ]

Of course that was a typo in the URL I gave. The correct URL is:

/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-bgp-rib-impl-cfg:rib-impl/example-bgp-rib

the data I PUT is:

{ "module" : [
{
"type": "odl-bgp-rib-impl-cfg:rib-impl",
"name": "example-bgp-rib",
"odl-bgp-rib-impl-cfg:bgp-rib-id": "172.23.29.120",
"odl-bgp-rib-impl-cfg:bgp-dispatcher":

{ "type": "odl-bgp-rib-impl-cfg:bgp-dispatcher", "name": "global-bgp-dispatcher" }

,
"odl-bgp-rib-impl-cfg:extensions":

{ "type": "odl-bgp-rib-spi-cfg:extensions", "name": "global-rib-extensions" }

,
"odl-bgp-rib-impl-cfg:tcp-reconnect-strategy":

{ "type": "protocol-framework:reconnect-strategy-factory", "name": "example-reconnect-strategy-factory" }

,
"odl-bgp-rib-impl-cfg:rib-id": "example-bgp-rib",
"odl-bgp-rib-impl-cfg:session-reconnect-strategy":

{ "type": "protocol-framework:reconnect-strategy-factory", "name": "example-reconnect-strategy-factory" }

,
"odl-bgp-rib-impl-cfg:local-table": [

{ "type": "odl-bgp-rib-impl-cfg:bgp-table-type", "name": "ipv4-unicast" }

,

{ "type": "odl-bgp-rib-impl-cfg:bgp-table-type", "name": "ipv6-unicast" }

,

{ "type": "odl-bgp-rib-impl-cfg:bgp-table-type", "name": "linkstate" }

,

{ "type": "odl-bgp-rib-impl-cfg:bgp-table-type", "name": "flowspec" }

],
"odl-bgp-rib-impl-cfg:data-provider":

{ "type": "opendaylight-md-sal-binding:binding-async-data-broker", "name": "pingpong-binding-data-broker" }

,
"odl-bgp-rib-impl-cfg:dom-data-provider":

{ "type": "opendaylight-md-sal-dom:dom-async-data-broker", "name": "pingpong-broker" }

,
"odl-bgp-rib-impl-cfg:codec-tree-factory":

{ "type": "opendaylight-md-sal-binding:binding-codec-tree-factory", "name": "runtime-mapping-singleton" }

,
"odl-bgp-rib-impl-cfg:local-as": 65504
}
]
}

this all works fine with lithium/stable, and with "older" releases of master (from October).

is this related to the fact that /restconf/config/network-topology:network-topology no longer works?

Comment by Vratko Polak [ 15/Dec/15 ]

> serviceName='bgp-table-type', refName='flowspec'

This seem to be the issue, in Beryllium the service got renamed (to distinguish from ipv6-based one):
https://git.opendaylight.org/gerrit/#/c/28947/1/bgp/controller-config/src/main/resources/initial/31-bgp.xml

That was the user error part.
The Bug part is that Restconf should report only this table type, not together with the other 3 correct ones.
I am not sure whether it is better to reassign this Bug or create new one.

Comparing with result of Json GET I see more changes, so you may want to do more changes than just rename to 'ipv4-flowspec' when on Beryllium.

Comment by Giles Heron [ 15/Dec/15 ]

ah yes - should have tried a GET on the existing config and used that as a template for my PUT

Generated at Wed Feb 07 20:14:12 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.