[NETCONF-446] Adding topology-netconf node via Restconf/XML fails Created: 07/Aug/17  Updated: 15/Mar/19  Resolved: 10/Aug/17

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

Type: Bug
Reporter: Marek Gradzki Assignee: Jakub Toth
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Text File karaf.log    
Issue Links:
Blocks
blocks OPNFLWPLUG-925 Reconciliation Framework: Implementat... Resolved
Duplicate
is duplicated by NETCONF-447 SchemaValidationFailedException for o... Resolved
is duplicated by OPNFLWPLUG-928 CSIT - openflowplugin suites broken Resolved
External issue ID: 8939
Priority: High

 Description   

I am trying to mount netconf device as explained on the wiki:

https://wiki.opendaylight.org/view/OpenDaylight_Controller:Config:Examples:Netconf#Spawning_netconf_connectors_via_topology_configuration

feature:install odl-netconf-topology odl-restconf-all

then

PUT http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/vpp

<node xmlns="urn:TBD:params:xml:ns:yang:network-topology">
<node-id>vpp</node-id>
<host xmlns="urn:opendaylight:netconf-node-topology">127.0.0.1</host>
<port xmlns="urn:opendaylight:netconf-node-topology">2831</port>
<username xmlns="urn:opendaylight:netconf-node-topology">admin</username>
<password xmlns="urn:opendaylight:netconf-node-topology">admin</password>
<tcp-only xmlns="urn:opendaylight:netconf-node-topology">false</tcp-only>
<keepalive-delay xmlns="urn:opendaylight:netconf-node-topology">0</keepalive-delay>
</node>

I got following exception:

2017-08-07 12:28:46,751 | ERROR | tp1414323362-290 | SnapshotBackedWriteTransaction | 258 - org.opendaylight.controller.sal-core-spi - 1.6.0.SNAPSHOT | Tx: member-1-datastore-config-fe-0-txn-10-0, failed to write /(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)network-topology/topology/topology[

{(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)topology-id=topology-netconf}

]/node/node[

{(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)node-id=vpp}

]/node[

{(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)node-id=vpp}

]:ImmutableMapEntryNode{nodeIdentifier=(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)node[

{(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)node-id=vpp}

], value=[ImmutableLeafNode{nodeIdentifier=(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)node-id, value=vpp, attributes={}}, ImmutableAugmentationNode{nodeIdentifier=AugmentationIdentifier

{childNames=[(urn:opendaylight:netconf-node-topology?revision=2015-01-14)connection-status, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)clustered-connection-status, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)connected-message, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)available-capabilities, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)unavailable-capabilities, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)pass-through, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)credentials, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)schema-cache-directory, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)yang-library, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)host, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)port, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)tcp-only, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)schemaless, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)yang-module-capabilities, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)non-module-capabilities, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)reconnect-on-changed-schema, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)connection-timeout-millis, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)default-request-timeout-millis, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)max-connection-attempts, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)between-attempts-timeout-millis, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)sleep-factor, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)keepalive-delay, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)concurrent-rpc-limit, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)actor-response-wait-time]}

, value=[ImmutableLeafNode{nodeIdentifier=(urn:opendaylight:netconf-node-topology?revision=2015-01-14)tcp-only, value=false, attributes={}}, ImmutableLeafNode{nodeIdentifier=(urn:opendaylight:netconf-node-topology?revision=2015-01-14)host, value=127.0.0.1, attributes={}}, ImmutableLeafNode{nodeIdentifier=(urn:opendaylight:netconf-node-topology?revision=2015-01-14)keepalive-delay, value=0, attributes={}}, ImmutableLeafNode{nodeIdentifier=(urn:opendaylight:netconf-node-topology?revision=2015-01-14)port, value=2831, attributes={}}, ImmutableChoiceNode{nodeIdentifier=(urn:opendaylight:netconf-node-topology?revision=2015-01-14)credentials, value=[ImmutableLeafNode{nodeIdentifier=(urn:opendaylight:netconf-node-topology?revision=2015-01-14)username, value=admin, attributes={}}, ImmutableLeafNode{nodeIdentifier=(urn:opendaylight:netconf-node-topology?revision=2015-01-14)password, value=admin, attributes={}}]}]}], attributes={}} in MutableDataTree [modification=NodeModification [identifier=(urn:ietf:params:xml:ns:netconf:base:1.0)data, modificationType=TOUCH, childModification={(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)network-topology=NodeModification [identifier=(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)network-topology, modificationType=MERGE, childModification={(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)topology=NodeModification [identifier=(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)topology, modificationType=MERGE, childModification={(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)topology[

{(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)topology-id=topology-netconf}

]=NodeModification [identifier=(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)topology[

{(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)topology-id=topology-netconf}

], modificationType=MERGE, childModification={(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)topology-id=NodeModification [identifier=(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)topology-id, modificationType=MERGE, childModification={}], (urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)node=NodeModification [identifier=(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)node, modificationType=MERGE, childModification={(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)node[

{(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)node-id=vpp}

]=NodeModification [identifier=(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)node[

{(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)node-id=vpp}

], modificationType=MERGE, childModification={}]}]}]}]}]}]]
org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaValidationFailedException: Child /(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)network-topology/topology/topology[

{(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)topology-id=topology-netconf}

]/node/node[

{(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)node-id=vpp}

]/node[

{(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)node-id=vpp}

] is not present in schema tree.
at org.opendaylight.yangtools.yang.data.impl.schema.tree.InMemoryDataTreeModification.resolveModificationFor(InMemoryDataTreeModification.java:155)
at org.opendaylight.yangtools.yang.data.impl.schema.tree.InMemoryDataTreeModification.write(InMemoryDataTreeModification.java:70)
at org.opendaylight.controller.sal.core.spi.data.SnapshotBackedWriteTransaction.write(SnapshotBackedWriteTransaction.java:62)
at org.opendaylight.controller.cluster.datastore.modification.WriteModification.apply(WriteModification.java:45)
at org.opendaylight.controller.cluster.datastore.LocalTransactionContext.executeModification(LocalTransactionContext.java:52)
at org.opendaylight.controller.cluster.datastore.TransactionProxy$2.invoke(TransactionProxy.java:173)
at org.opendaylight.controller.cluster.datastore.TransactionContextWrapper.maybeExecuteTransactionOperation(TransactionContextWrapper.java:93)
at org.opendaylight.controller.cluster.datastore.TransactionProxy.executeModification(TransactionProxy.java:170)
at org.opendaylight.controller.cluster.datastore.TransactionProxy.write(TransactionProxy.java:160)
at org.opendaylight.controller.cluster.databroker.AbstractDOMBrokerWriteTransaction.put(AbstractDOMBrokerWriteTransaction.java:80)
at org.opendaylight.netconf.sal.restconf.impl.BrokerFacade.makePut(BrokerFacade.java:1173)[303:org.opendaylight.netconf.sal-rest-connector:1.6.0.SNAPSHOT]

Any idea what I am doing wrong?

More detailed log attached. I tried karaf-0.7.0-20170807.063951-1585.zip and netconf/caraf from local build (033e972eaf0d009ed0c0f54a109b6046fae80c99)



 Comments   
Comment by Marek Gradzki [ 07/Aug/17 ]

Attachment karaf.log has been added with description: karaf4 log

Comment by Marek Gradzki [ 07/Aug/17 ]

Issue relates only to XML (JSON fails with different error, message)

Comment by Vratko Polak [ 08/Aug/17 ]

This is also happening in CSIT [2], and looking into karaf.log I believe this is just a consequence of ODLPARENT-110. Possibly this is already fixed by [3].

[2] https://logs.opendaylight.org/releng/jenkins092/netconf-csit-1node-userfeatures-only-nitrogen/103/log.html.gz#s1-s4-s1-t3-k2-k2-k1-k4-k7-k1
[3] https://git.opendaylight.org/gerrit/61273

Comment by Vratko Polak [ 08/Aug/17 ]

> I believe this is just a consequence of ODLPARENT-110.

I do not believe that anymore, because BGP tests show a very similar NETCONF-447 without refreshes of critical bundles.

Comment by Jakub Morvay [ 10/Aug/17 ]

Moving this to restconf component as this is more related to restconf than to netconf. The actual problem is that restconf cannot properly process requests with XML payload containing a root list element.

This is related to migration to the new yangtools XML parser and its slightly changed parsing behavior.

Working fix:
https://git.opendaylight.org/gerrit/#/c/61333/

We just need to add UT to capture this scenario and it's good to go.

Comment by Igor Foltin [ 10/Aug/17 ]

Fix: https://git.opendaylight.org/gerrit/#/c/61333/

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