Ask is moving to Stack Overflow and Serverfault.com! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode

Revision history [back]

Error accessing NETCONF device using custom Yang schema

I am trying to comunicate with a Juniper Device through NETCONF in ODL Helium. I configured the netconf-connector, and obtained a Yang file (which I stored in cache/schema), since the device does not support netconf-monitoring.

I also added

<yang-module-capabilities xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
  <capability xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
    urn:ietf:params:xml:ns:yang:ietf-inet-types?module=ietf-inet-types&amp;revision=2010-09-24
  </capability>
  <capability xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
    urn:ietf:params:xml:ns:yang:junos-yang-module-14.2R1.9?module=junos-yang-module-14.2R1.9&amp;revision=2015-01-14
  </capability>
</yang-module-capabilities>

to the netconf-connector definition for the device, to specify the Yang modules.

The device seems to be working, since I see the log message:

2015-01-14 10:03:09,681 | INFO  | ssing-executor-4 | NetconfDevice                    | 376 - org.opendaylight.controller.sal-netconf-connector - 1.1.1.Helium-SR1 | RemoteDevice{sw-opennaas-1}: Netconf connector initialized successfully

But when I try to access the configuration of the device using restconf url: http://localhost:8181/restconf/config/opendaylight-inventory:nodes/opendaylight-inventory:node/sw-opennaas-1/yang-ext:mount/

It gives me an error:

2015-01-14 10:48:30,673 | ERROR | oupCloseable-4-2 | NetconfDeviceReadOnlyTx          | 376 - org.opendaylight.controller.sal-netconf-connector - 1.1.1.Helium-SR1 | RemoteDevice{sw-opennaas-1}: Unable to normalize data for /, data: Node[ImmutableCompositeNode], qName[data], modify[n/a], children.size = 1
java.lang.IllegalArgumentException: Failed to get child operation for Node[ImmutableCompositeNode], qName[data], modify[n/a], children.size = 1
    at org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizer.toNormalized(DataNormalizer.java:113)[162:org.opendaylight.controller.sal-common-impl:1.1.1.Helium-SR1]
    at org.opendaylight.controller.sal.connect.netconf.sal.tx.NetconfDeviceReadOnlyTx.transform(NetconfDeviceReadOnlyTx.java:91)[376:org.opendaylight.controller.sal-netconf-connector:1.1.1.Helium-SR1]
    at org.opendaylight.controller.sal.connect.netconf.sal.tx.NetconfDeviceReadOnlyTx.access$100(NetconfDeviceReadOnlyTx.java:41)[376:org.opendaylight.controller.sal-netconf-connector:1.1.1.Helium-SR1]
    at org.opendaylight.controller.sal.connect.netconf.sal.tx.NetconfDeviceReadOnlyTx$1.apply(NetconfDeviceReadOnlyTx.java:68)[376:org.opendaylight.controller.sal-netconf-connector:1.1.1.Helium-SR1]
    at org.opendaylight.controller.sal.connect.netconf.sal.tx.NetconfDeviceReadOnlyTx$1.apply(NetconfDeviceReadOnlyTx.java:60)[376:org.opendaylight.controller.sal-netconf-connector:1.1.1.Helium-SR1]
    at com.google.common.util.concurrent.Futures$1.apply(Futures.java:720)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.Futures$ChainingListenableFuture.run(Futures.java:859)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:293)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.ExecutionList$RunnableExecutorPair.execute(ExecutionList.java:150)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:135)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.Futures$ChainingListenableFuture$1.run(Futures.java:873)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:293)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.Futures$ImmediateFuture.addListener(Futures.java:99)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.Futures$ChainingListenableFuture.run(Futures.java:866)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:293)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.ExecutionList$RunnableExecutorPair.execute(ExecutionList.java:150)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:135)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185)[132:com.google.guava:14.0.1]
    at org.opendaylight.controller.sal.connect.netconf.listener.UncancellableFuture.set(UncancellableFuture.java:45)[376:org.opendaylight.controller.sal-netconf-connector:1.1.1.Helium-SR1]
    at org.opendaylight.controller.sal.connect.netconf.listener.NetconfDeviceCommunicator.processMessage(NetconfDeviceCommunicator.java:251)[376:org.opendaylight.controller.sal-netconf-connector:1.1.1.Helium-SR1]
    at org.opendaylight.controller.sal.connect.netconf.listener.NetconfDeviceCommunicator.onMessage(NetconfDeviceCommunicator.java:197)[376:org.opendaylight.controller.sal-netconf-connector:1.1.1.Helium-SR1]
    at org.opendaylight.controller.sal.connect.netconf.listener.NetconfDeviceCommunicator.onMessage(NetconfDeviceCommunicator.java:45)[376:org.opendaylight.controller.sal-netconf-connector:1.1.1.Helium-SR1]
    at org.opendaylight.controller.netconf.nettyutil.AbstractNetconfSession.handleMessage(AbstractNetconfSession.java:57)[199:org.opendaylight.controller.netconf-netty-util:0.2.6.Helium-SR1]
    at org.opendaylight.controller.netconf.nettyutil.AbstractNetconfSession.handleMessage(AbstractNetconfSession.java:28)[199:org.opendaylight.controller.netconf-netty-util:0.2.6.Helium-SR1]
    at org.opendaylight.protocol.framework.AbstractProtocolSession.channelRead0(AbstractProtocolSession.java:46)[185:org.opendaylight.controller.protocol-framework:0.5.1.Helium-SR1]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)[182:io.netty.transport:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)[182:io.netty.transport:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)[182:io.netty.transport:4.0.23.Final]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163)[203:io.netty.codec:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)[182:io.netty.transport:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)[182:io.netty.transport:4.0.23.Final]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163)[203:io.netty.codec:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)[182:io.netty.transport:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)[182:io.netty.transport:4.0.23.Final]
    at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)[182:io.netty.transport:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)[182:io.netty.transport:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext.access$700(AbstractChannelHandlerContext.java:32)[182:io.netty.transport:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext$8.run(AbstractChannelHandlerContext.java:324)[182:io.netty.transport:4.0.23.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380)[183:io.netty.common:4.0.23.Final]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)[182:io.netty.transport:4.0.23.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)[183:io.netty.common:4.0.23.Final]
    at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)[183:io.netty.common:4.0.23.Final]
    at java.lang.Thread.run(Thread.java:745)[:1.7.0_65]
Caused by: org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizationException: Supplied QName (http://xml.juniper.net/xnm/1.1/xnm)configuration is not valid according to schema SchemaContextImpl{modules=[ModuleImpl[name=ietf-inet-types, namespace=urn:ietf:params:xml:ns:yang:ietf-inet-types, revision=Fri Sep 24 00:00:00 CEST 2010, prefix=inet, yangVersion=1], ModuleImpl[name=configuration, namespace=http://yang.juniper.net/yang/1.1/jc, revision=Thu Jan 01 01:00:00 CET 1970, prefix=jc, yangVersion=1]]}, potential children nodes: [container configuration]
    at org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizationOperation.fromSchemaAndQNameChecked(DataNormalizationOperation.java:681)[162:org.opendaylight.controller.sal-common-impl:1.1.1.Helium-SR1]
    at org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizationOperation.access$000(DataNormalizationOperation.java:57)[162:org.opendaylight.controller.sal-common-impl:1.1.1.Helium-SR1]
    at org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizationOperation$DataContainerNormalizationOperation.fromLocalSchemaAndQName(DataNormalizationOperation.java:277)[162:org.opendaylight.controller.sal-common-impl:1.1.1.Helium-SR1]
    at org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizationOperation$DataContainerNormalizationOperation.getChild(DataNormalizationOperation.java:272)[162:org.opendaylight.controller.sal-common-impl:1.1.1.Helium-SR1]
    at org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizer.toNormalized(DataNormalizer.java:111)[162:org.opendaylight.controller.sal-common-impl:1.1.1.Helium-SR1]
    ... 43 more

When I alternatively try the config-controller loopback node, it retrieves the config without problems.

Does anyone knows what this means? Is it related to incorrect Yang parsing? How can I troubleshoot this?

Thanks in advance for your help.

Error accessing NETCONF device using custom Yang schema

I am trying to comunicate with a Juniper Device through NETCONF in ODL Helium. I configured the netconf-connector, and obtained a Yang file (which I stored in cache/schema), since the device does not support netconf-monitoring.

I also added

<yang-module-capabilities xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
  <capability xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
    urn:ietf:params:xml:ns:yang:ietf-inet-types?module=ietf-inet-types&amp;revision=2010-09-24
  </capability>
  <capability xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
    urn:ietf:params:xml:ns:yang:junos-yang-module-14.2R1.9?module=junos-yang-module-14.2R1.9&amp;revision=2015-01-14
  </capability>
 </yang-module-capabilities>

to the netconf-connector definition for the device, to specify the Yang modules.

The device seems to be working, since I see the log message:

2015-01-14 10:03:09,681 | INFO  | ssing-executor-4 | NetconfDevice                    | 376 - org.opendaylight.controller.sal-netconf-connector - 1.1.1.Helium-SR1 | RemoteDevice{sw-opennaas-1}: Netconf connector initialized successfully

But when I try to access the configuration of the device using restconf url: http://localhost:8181/restconf/config/opendaylight-inventory:nodes/opendaylight-inventory:node/sw-opennaas-1/yang-ext:mount/

It gives me an error:

2015-01-14 10:48:30,673 | ERROR | oupCloseable-4-2 | NetconfDeviceReadOnlyTx          | 376 - org.opendaylight.controller.sal-netconf-connector - 1.1.1.Helium-SR1 | RemoteDevice{sw-opennaas-1}: Unable to normalize data for /, data: Node[ImmutableCompositeNode], qName[data], modify[n/a], children.size = 1
java.lang.IllegalArgumentException: Failed to get child operation for Node[ImmutableCompositeNode], qName[data], modify[n/a], children.size = 1
    at org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizer.toNormalized(DataNormalizer.java:113)[162:org.opendaylight.controller.sal-common-impl:1.1.1.Helium-SR1]
    at org.opendaylight.controller.sal.connect.netconf.sal.tx.NetconfDeviceReadOnlyTx.transform(NetconfDeviceReadOnlyTx.java:91)[376:org.opendaylight.controller.sal-netconf-connector:1.1.1.Helium-SR1]
    at org.opendaylight.controller.sal.connect.netconf.sal.tx.NetconfDeviceReadOnlyTx.access$100(NetconfDeviceReadOnlyTx.java:41)[376:org.opendaylight.controller.sal-netconf-connector:1.1.1.Helium-SR1]
    at org.opendaylight.controller.sal.connect.netconf.sal.tx.NetconfDeviceReadOnlyTx$1.apply(NetconfDeviceReadOnlyTx.java:68)[376:org.opendaylight.controller.sal-netconf-connector:1.1.1.Helium-SR1]
    at org.opendaylight.controller.sal.connect.netconf.sal.tx.NetconfDeviceReadOnlyTx$1.apply(NetconfDeviceReadOnlyTx.java:60)[376:org.opendaylight.controller.sal-netconf-connector:1.1.1.Helium-SR1]
    at com.google.common.util.concurrent.Futures$1.apply(Futures.java:720)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.Futures$ChainingListenableFuture.run(Futures.java:859)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:293)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.ExecutionList$RunnableExecutorPair.execute(ExecutionList.java:150)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:135)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.Futures$ChainingListenableFuture$1.run(Futures.java:873)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:293)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.Futures$ImmediateFuture.addListener(Futures.java:99)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.Futures$ChainingListenableFuture.run(Futures.java:866)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:293)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.ExecutionList$RunnableExecutorPair.execute(ExecutionList.java:150)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:135)[132:com.google.guava:14.0.1]
    at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185)[132:com.google.guava:14.0.1]
    at org.opendaylight.controller.sal.connect.netconf.listener.UncancellableFuture.set(UncancellableFuture.java:45)[376:org.opendaylight.controller.sal-netconf-connector:1.1.1.Helium-SR1]
    at org.opendaylight.controller.sal.connect.netconf.listener.NetconfDeviceCommunicator.processMessage(NetconfDeviceCommunicator.java:251)[376:org.opendaylight.controller.sal-netconf-connector:1.1.1.Helium-SR1]
    at org.opendaylight.controller.sal.connect.netconf.listener.NetconfDeviceCommunicator.onMessage(NetconfDeviceCommunicator.java:197)[376:org.opendaylight.controller.sal-netconf-connector:1.1.1.Helium-SR1]
    at org.opendaylight.controller.sal.connect.netconf.listener.NetconfDeviceCommunicator.onMessage(NetconfDeviceCommunicator.java:45)[376:org.opendaylight.controller.sal-netconf-connector:1.1.1.Helium-SR1]
    at org.opendaylight.controller.netconf.nettyutil.AbstractNetconfSession.handleMessage(AbstractNetconfSession.java:57)[199:org.opendaylight.controller.netconf-netty-util:0.2.6.Helium-SR1]
    at org.opendaylight.controller.netconf.nettyutil.AbstractNetconfSession.handleMessage(AbstractNetconfSession.java:28)[199:org.opendaylight.controller.netconf-netty-util:0.2.6.Helium-SR1]
    at org.opendaylight.protocol.framework.AbstractProtocolSession.channelRead0(AbstractProtocolSession.java:46)[185:org.opendaylight.controller.protocol-framework:0.5.1.Helium-SR1]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)[182:io.netty.transport:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)[182:io.netty.transport:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)[182:io.netty.transport:4.0.23.Final]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163)[203:io.netty.codec:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)[182:io.netty.transport:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)[182:io.netty.transport:4.0.23.Final]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163)[203:io.netty.codec:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)[182:io.netty.transport:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)[182:io.netty.transport:4.0.23.Final]
    at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)[182:io.netty.transport:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)[182:io.netty.transport:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext.access$700(AbstractChannelHandlerContext.java:32)[182:io.netty.transport:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext$8.run(AbstractChannelHandlerContext.java:324)[182:io.netty.transport:4.0.23.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380)[183:io.netty.common:4.0.23.Final]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)[182:io.netty.transport:4.0.23.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)[183:io.netty.common:4.0.23.Final]
    at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)[183:io.netty.common:4.0.23.Final]
    at java.lang.Thread.run(Thread.java:745)[:1.7.0_65]
Caused by: org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizationException: Supplied QName (http://xml.juniper.net/xnm/1.1/xnm)configuration is not valid according to schema SchemaContextImpl{modules=[ModuleImpl[name=ietf-inet-types, namespace=urn:ietf:params:xml:ns:yang:ietf-inet-types, revision=Fri Sep 24 00:00:00 CEST 2010, prefix=inet, yangVersion=1], ModuleImpl[name=configuration, namespace=http://yang.juniper.net/yang/1.1/jc, revision=Thu Jan 01 01:00:00 CET 1970, prefix=jc, yangVersion=1]]}, potential children nodes: [container configuration]
    at org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizationOperation.fromSchemaAndQNameChecked(DataNormalizationOperation.java:681)[162:org.opendaylight.controller.sal-common-impl:1.1.1.Helium-SR1]
    at org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizationOperation.access$000(DataNormalizationOperation.java:57)[162:org.opendaylight.controller.sal-common-impl:1.1.1.Helium-SR1]
    at org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizationOperation$DataContainerNormalizationOperation.fromLocalSchemaAndQName(DataNormalizationOperation.java:277)[162:org.opendaylight.controller.sal-common-impl:1.1.1.Helium-SR1]
    at org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizationOperation$DataContainerNormalizationOperation.getChild(DataNormalizationOperation.java:272)[162:org.opendaylight.controller.sal-common-impl:1.1.1.Helium-SR1]
    at org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizer.toNormalized(DataNormalizer.java:111)[162:org.opendaylight.controller.sal-common-impl:1.1.1.Helium-SR1]
    ... 43 more

When I alternatively try the config-controller loopback node, it retrieves the config without problems.

Does anyone knows what this means? Is it related to incorrect Yang parsing? How can I troubleshoot this?

Thanks in advance for your help.