[NETCONF-430] get-config and edit-config fail with schemaless mount points Created: 15/Jun/17  Updated: 15/Mar/19  Resolved: 28/Jun/17

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

Type: Bug
Reporter: Gwenael Lambrouin Assignee: Gwenael Lambrouin
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: 8697

 Description   

ODL Boron release introduced schemaless netconf mount points [1] to deal with devices that do not offer YANG models. This feature can also be used as a workaround for devices whose YANG model cannot be parsed by ODL.

I developed a proof-of-concept ODL application in order to figure out how to work with schemaless netconf mount points. Its code can be found on github [2], and it can be used to reproduce the problem.

Getting or editing the configuration of a schemaless-mounted netconf device from the code of an ODL application results in a NullPointerException. Example while trying to read the configuration of a Juniper device:

2017-06-02 11:05:06,955 | ERROR | tp1288045576-189 | ContainerResponse | 232 - com.sun.jersey.jersey-server - 1.17.0 | The RuntimeException could not be mapped to a response, re-throwing to the HTTP container
java.lang.NullPointerException: Cannot find (http://xml.juniper.net/xnm/1.1/xnm)configuration node in schema context. Instance identifier has to start from root
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:250)[65:com.google.guava:18.0.0]
at org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.fromInstanceId(ImmutableNodes.java:134)[81:org.opendaylight.yangtools.yang-data-impl:1.1.0.Carbon]
at org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.fromInstanceId(ImmutableNodes.java:105)[81:org.opendaylight.yangtools.yang-data-impl:1.1.0.Carbon]
at org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.toFilterStructure(NetconfMessageTransformUtil.java:170)
at org.opendaylight.netconf.sal.connect.netconf.util.NetconfRpcStructureTransformer.toFilterStructure(NetconfRpcStructureTransformer.java:44)
at org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps.getConfig(NetconfBaseOps.java:170)
at org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps.getConfigRunning(NetconfBaseOps.java:205)
at org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps.getConfigRunningData(NetconfBaseOps.java:184)
at org.opendaylight.netconf.sal.connect.netconf.sal.tx.ReadOnlyTx.readConfigurationData(ReadOnlyTx.java:42)
at org.opendaylight.netconf.sal.connect.netconf.sal.tx.ReadOnlyTx.read(ReadOnlyTx.java:66)
at com.bcom.pocnetconfschemaless.impl.Hostname.getHostname(Hostname.java:89)

This is quite unexpected because we're working in schemaless mode. So ODL should not look for a schema, and there should not be an exception.

The traceback shows that ODL uses a NetconfRpcStructureTransformer, while it should use a SchemalessRpcStructureTransformer.

Looking for ODL behaviour at mount time with a debugger, we can see that the NetconfBaseOps object is created with the wrong transformer. As a matter of fact, in the NetconfBaseOps constructor, the "rpc instanceof SchemalessNetconfDeviceRpc" test fails. Investigation shows that rpc is a KeepAliveSalFacade.KeepAliveDomRpcService object, while rpc.deviceRpc is a SchemalessNetconfDeviceRpc object.

I will submit a patch that fixes the issue.

[1] https://git.opendaylight.org/gerrit/#/c/38300/

[2] https://github.com/b-com/pocnetconfschemaless



 Comments   
Comment by Gwenael Lambrouin [ 23/Jun/17 ]

Patch submitted for review here:
https://git.opendaylight.org/gerrit/#/c/59068/

Comment by Gwenael Lambrouin [ 28/Jun/17 ]

Patch merged on:

  • stable/carbon
  • master (nitrogen)
  • stable/boron
Generated at Wed Feb 07 20:15:01 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.