[NETCONF-848] Netconf notifications processing failing for odl-leaf-nodes-only Created: 12/Jan/22  Updated: 28/Mar/22  Resolved: 24/Mar/22

Status: Resolved
Project: netconf
Component/s: restconf-nb
Affects Version/s: 2.0.11
Fix Version/s: 3.0.0, 2.0.15

Type: Bug Priority: Medium
Reporter: Peter Puškár Assignee: Peter Puškár
Resolution: Done Votes: 0
Labels: regression
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Phosphorus SR-1

https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/opendaylight/15.1.0/opendaylight-15.1.0.zip

 

 


Attachments: File [NETCONF-848] Steps to reproduce.odt     File karaf.log    

 Description   

In Phosphorus SR-1, after creating all streams via 

http://127.0.0.1:8181/rests/data/ietf-restconf-monitoring:restconf-state/streams

and then subscribing to the data-changed-notification stream and changing any data,

the notification is not sent due to the following error:

15:07:31.222 ERROR [opendaylight-cluster-data-notification-dispatcher-56] Failed to process notification DefaultDataTreeCandidate{rootPath=/(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)network-topology, rootNode=ChildNode{mod = ModifiedNode{identifier=(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)network-topology, operation=MERGE, modificationType=SUBTREE_MODIFIED, childModification={(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)topology=ModifiedNode{identifier=(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)topology, operation=TOUCH, modificationType=SUBTREE_MODIFIED, 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}]=ModifiedNode{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}], operation=MERGE, modificationType=SUBTREE_MODIFIED, childModification={(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)topology-id=ModifiedNode{identifier=(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)topology-id, operation=MERGE, modificationType=WRITE}, (urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)node=ModifiedNode{identifier=(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)node, operation=TOUCH, modificationType=APPEARED, 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=testtool}]=ModifiedNode{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=testtool}], operation=WRITE, modificationType=WRITE}}}}}}}}}, oldMeta = MaterializedContainerNode{version=org.opendaylight.yangtools.yang.data.spi.tree.Version@71beb194, subtreeVersion=org.opendaylight.yangtools.yang.data.spi.tree.Version@7c9ef6d2, children={(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)topology=MaterializedContainerNode{version=org.opendaylight.yangtools.yang.data.spi.tree.Version@71beb194, subtreeVersion=org.opendaylight.yangtools.yang.data.spi.tree.Version@7c9ef6d2, children={(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}]=MaterializedContainerNode{version=org.opendaylight.yangtools.yang.data.spi.tree.Version@71beb194, subtreeVersion=org.opendaylight.yangtools.yang.data.spi.tree.Version@7c9ef6d2, children={(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)topology-id=ValueNode{version=org.opendaylight.yangtools.yang.data.spi.tree.Version@3a2b9b18, value=ImmutableLeafNode{identifier=(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)topology-id, body=topology-netconf}}}}}}}}, newMeta = MaterializedContainerNode{version=org.opendaylight.yangtools.yang.data.spi.tree.Version@71beb194, subtreeVersion=org.opendaylight.yangtools.yang.data.spi.tree.Version@1b04de39, children={(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)topology=MaterializedContainerNode{version=org.opendaylight.yangtools.yang.data.spi.tree.Version@71beb194, subtreeVersion=org.opendaylight.yangtools.yang.data.spi.tree.Version@1b04de39, children={(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}]=MaterializedContainerNode{version=org.opendaylight.yangtools.yang.data.spi.tree.Version@71beb194, subtreeVersion=org.opendaylight.yangtools.yang.data.spi.tree.Version@1b04de39, children={(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)topology-id=ValueNode{version=org.opendaylight.yangtools.yang.data.spi.tree.Version@1b04de39, value=ImmutableLeafNode{identifier=(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)topology-id, body=topology-netconf}}, (urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)node=SimpleContainerNode{version=org.opendaylight.yangtools.yang.data.spi.tree.Version@1b04de39, data=ImmutableMapNode{identifier=(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)node, body=[ImmutableMapEntryNode{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=testtool}], body=[ImmutableLeafNode{identifier=(urn:TBD:params:xml:ns:yang:network-topology?revision=2013-10-21)node-id, body=testtool}, ImmutableAugmentationNode{identifier=AugmentationIdentifier{childNames=[(urn:opendaylight:netconf-node-topology?revision=2015-01-14)sleep-factor, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)default-request-timeout-millis, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)ignore-missing-schema-sources, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)yang-module-capabilities, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)host, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)yang-library, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)schemaless, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)reconnect-on-changed-schema, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)clustered-connection-status, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)odl-hello-message-capabilities, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)schema-cache-directory, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)credentials, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)concurrent-rpc-limit, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)unavailable-capabilities, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)port, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)connection-timeout-millis, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)tcp-only, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)non-module-capabilities, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)pass-through, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)protocol, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)between-attempts-timeout-millis, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)actor-response-wait-time, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)connection-status, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)connected-message, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)max-connection-attempts, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)available-capabilities, (urn:opendaylight:netconf-node-topology?revision=2015-01-14)keepalive-delay]}, body=[ImmutableLeafNode{identifier=(urn:opendaylight:netconf-node-topology?revision=2015-01-14)connection-status, body=connecting}, ImmutableLeafNode{identifier=(urn:opendaylight:netconf-node-topology?revision=2015-01-14)port, body=36000}, ImmutableLeafNode{identifier=(urn:opendaylight:netconf-node-topology?revision=2015-01-14)host, body=127.0.0.1}]}]}]}}}}}}}}}}
java.lang.UnsupportedOperationException: Augmentation node has no QName
 at org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier$AugmentationIdentifier.getNodeType(YangInstanceIdentifier.java:915) ~[bundleFile:?]
 at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[?:?]
 at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177) ~[?:?]
 at java.util.ArrayDeque$DeqSpliterator.forEachRemaining(ArrayDeque.java:849) ~[?:?]
 at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[?:?]
 at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[?:?]
 at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[?:?]
 at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
 at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[?:?]
 at org.opendaylight.restconf.common.serializer.JsonDataTreeCandidateSerializer.serializeData(JsonDataTreeCandidateSerializer.java:43) ~[bundleFile:?]
 at org.opendaylight.restconf.common.serializer.AbstractWebsocketSerializer.serializeLeafNodesOnly(AbstractWebsocketSerializer.java:70) ~[bundleFile:?]
 at org.opendaylight.restconf.common.serializer.AbstractWebsocketSerializer.serializeLeafNodesOnly(AbstractWebsocketSerializer.java:76) ~[bundleFile:?]
 at org.opendaylight.restconf.common.serializer.AbstractWebsocketSerializer.serializeLeafNodesOnly(AbstractWebsocketSerializer.java:76) ~[bundleFile:?]
 at org.opendaylight.restconf.common.serializer.AbstractWebsocketSerializer.serializeLeafNodesOnly(AbstractWebsocketSerializer.java:76) ~[bundleFile:?]
 at org.opendaylight.restconf.common.serializer.AbstractWebsocketSerializer.serializeLeafNodesOnly(AbstractWebsocketSerializer.java:76) ~[bundleFile:?]
 at org.opendaylight.restconf.common.serializer.AbstractWebsocketSerializer.serializeLeafNodesOnly(AbstractWebsocketSerializer.java:76) ~[bundleFile:?]
 at org.opendaylight.restconf.common.serializer.AbstractWebsocketSerializer.serializeLeafNodesOnly(AbstractWebsocketSerializer.java:76) ~[bundleFile:?]
 at org.opendaylight.restconf.common.serializer.AbstractWebsocketSerializer.serialize(AbstractWebsocketSerializer.java:36) ~[bundleFile:?]
 at org.opendaylight.restconf.common.formatters.JSONDataTreeCandidateFormatter.createText(JSONDataTreeCandidateFormatter.java:73) ~[bundleFile:?]
 at org.opendaylight.restconf.common.formatters.JSONDataTreeCandidateFormatter.createText(JSONDataTreeCandidateFormatter.java:26) ~[bundleFile:?]
 at org.opendaylight.restconf.common.formatters.EventFormatter.eventData(EventFormatter.java:76) ~[bundleFile:?]
 at org.opendaylight.restconf.nb.rfc8040.streams.listeners.ListenerAdapter.onDataTreeChanged(ListenerAdapter.java:78) ~[bundleFile:?]
 at org.opendaylight.controller.cluster.datastore.DataTreeChangeListenerActor.dataTreeChanged(DataTreeChangeListenerActor.java:84) ~[bundleFile:?]
 at org.opendaylight.controller.cluster.datastore.DataTreeChangeListenerActor.handleReceive(DataTreeChangeListenerActor.java:45) ~[bundleFile:?]
 at akka.japi.pf.UnitCaseStatement.apply(CaseStatements.scala:24) [bundleFile:?]
 at akka.japi.pf.UnitCaseStatement.apply(CaseStatements.scala:20) [bundleFile:?]
 at scala.PartialFunction.applyOrElse(PartialFunction.scala:189) [bundleFile:?]
 at scala.PartialFunction.applyOrElse$(PartialFunction.scala:188) [bundleFile:?]
 at akka.japi.pf.UnitCaseStatement.applyOrElse(CaseStatements.scala:20) [bundleFile:?]
 at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:244) [bundleFile:?]
 at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:245) [bundleFile:?]
 at akka.actor.Actor.aroundReceive(Actor.scala:537) [bundleFile:?]
 at akka.actor.Actor.aroundReceive$(Actor.scala:535) [bundleFile:?]
 at akka.actor.AbstractActor.aroundReceive(AbstractActor.scala:220) [bundleFile:?]
 at akka.actor.ActorCell.receiveMessage(ActorCell.scala:580) [bundleFile:?]
 at akka.actor.ActorCell.invoke(ActorCell.scala:548) [bundleFile:?]
 at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:270) [bundleFile:?]
 at akka.dispatch.Mailbox.run(Mailbox.scala:231) [bundleFile:?]
 at akka.dispatch.Mailbox.exec(Mailbox.scala:243) [bundleFile:?]
 at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) [?:?]
 at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) [?:?]
 at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) [?:?]
 at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) [?:?]
 at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) [?:?]

Not sure if this issue is problem in notification creation process or it is yangtools problem and this bug belongs there.



 Comments   
Comment by Samuel Schneider [ 07/Feb/22 ]

Hello ppuskar, can you provide more detailed steps to reproduce?

 

Comment by Peter Puškár [ 07/Feb/22 ]

Hello SamoSchneider,

I forgot to mention I was testing with odl-leaf-nodes-only=true, without this parameter it works as expected after retest, 

so I updated the title.

Anyways, here are the steps to reproduce:

  • Run Phosphorus SR-1
  • Install odl-netconf-topology, odl-restconf-nb-rfc8040
  • Create notification stream
POST http://127.0.0.1:8181/rests/operations/sal-remote:create-data-change-event-subscription

{    "input": {        "path": "/network-topology:network-topology",        "sal-remote-augment:datastore": "CONFIGURATION",        "sal-remote-augment:scope": "SUBTREE",        "sal-remote-augment:notification-output-type": "JSON"    }}
  • Subscribe to it
GET http://127.0.0.1:8181/rests/data/ietf-restconf-monitoring:restconf-state/streams/stream/data-change-event-subscription/network-topology:network-topology/datastore=CONFIGURATION/scope=SUBTREE/JSON?odl-leaf-nodes-only=true

Then try to mount any device ie

POST http://127.0.0.1:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=testtool

{    "node": [        {            "node-id": "testtool",            "netconf-node-topology:host": "127.0.0.1",            "netconf-node-topology:port": 36000,            "netconf-node-topology:keepalive-delay": 200,            "netconf-node-topology:tcp-only": false,            "netconf-node-topology:username": "admin",            "netconf-node-topology:password": "admin"        }    ]}

 You will see error in logs while the notification is being created.

So it seems like there is some problem while utilizing odl-leaf-nodes-only param from the query based on the log above.

 

 

Comment by Peter Puškár [ 21/Feb/22 ]

Proposed change fixes serialization of augmented nodes, now notifications fail when Choice nodes are present in notification, as their serialization fails.

Bug reported in NormalizedNodeStreamWriter stack fails to initialize on choice nodes

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