[NETCONF-910] Odl-yanglib fails to register provided sources Created: 08/Nov/22  Updated: 09/Jan/24  Resolved: 09/Oct/23

Status: Resolved
Project: netconf
Component/s: netconf
Affects Version/s: 4.0.3
Fix Version/s: 6.0.0

Type: Bug Priority: Medium
Reporter: Peter Suna Assignee: Ivan Hrasko
Resolution: Done Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screenshot 2023-10-09 131656.png     Text File karaf.log    
Issue Links:
Blocks
blocks NETCONF-857 Export supported features to ietf-yan... Confirmed
is blocked by NETCONF-909 Fix odl-yanglib feature usage Resolved

 Description   

Registering any models as schemaSource in odl-yanglib will fail at the line:
https://github.com/opendaylight/netconf/blob/master/netconf/yanglib/src/main/java/org/opendaylight/yanglib/impl/YangLibProvider.java#L143

More in provided logs.

Steps to reproduce:
I have used absolute path to "netconf/karaf/target/assembly/cache" with one model "ietf-yang-types" as a value for CacheFolder inside YanglibConfig.
https://github.com/opendaylight/netconf/blob/master/netconf/yanglib/src/main/java/org/opendaylight/yanglib/impl/YangLibProvider.java#L72
(Just hard-code configuration :

        yanglibConfig = new YanglibConfigBuilder()
                .setCacheFolder(FOLDER_PATH)
                .setBindingAddr("localhost")
                .setBindingAddr("8181")
                .build(); 

)

Odl-yanglib feature was installed with command:
feature:install odl-netconf-topology odl-restconf-nb odl-yanglib



 Comments   
Comment by Ivan Hrasko [ 02/Feb/23 ]

What are the steps to reproduce? What are models used?

For me it looks that you have problem in your models:

Caused by: java.lang.IllegalArgumentException: Require interface org.opendaylight.yangtools.yang.data.api.schema.SystemMapNode, got ImmutableUserMapNode{identifier=(urn:ietf:params:xml:ns:yang:ietf-yang-library?revision=2019-01-04)module, body=UnmodifiableCollection{[ImmutableMapEntryNode 
Comment by Robert Varga [ 02/Feb/23 ]

Hmm, this needs attaching a debugger and looking at things.

From what I understand, the datastore is populated with an OrderedMapNode (somehow?) and we are merging something into it (or perhaps vice versa?)
At any rate, OrderedMapNode has no business being there AFAICT and we need to track down where it is coming from and how.

Comment by Peter Suna [ 09/Oct/23 ]

This bug is no longer present in the current master. It was resolved by migrating to OSGi DS.
https://git.opendaylight.org/gerrit/c/netconf/+/103919

Comment by Ivan Hrasko [ 09/Oct/23 ]

Thanks, I assume fix version is the same as for NETCONF-772, 6.0.0.

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