Issue using ModelConverter with OpenConfig ModelObject

21 views
Skip to first unread message

Yuta Higuchi

unread,
Mar 29, 2018, 11:46:43 PM3/29/18
to ONOS Dynamic Configuration Brigade
Hi,

I'm trying to understand the following error message from yang tools.
# RuntimeException was artificially added to print backtrace

Code triggered it can be found here,
 
What I am seeing is when I try use ModelConverter to transform OpenConfig ModelObject into DataNode, 
I am getting the following error,
saying YangModelRegistry does not know about certain classes.

Am I missing in the code using YangTools, 
or is this some case where OpenConfig yang requires some kind of custom ModelRegistrator?


2018-03-30 03:21:40,774 | ERROR | r user y-higuchi | DefaultYangModelRegistry         | 179 - org.onosproject.onos-yang-runtime - 2.5.0.SNAPSHOT | Nothing registered for org.onosproject.yang.gen.v1.openconfigtransportlinecommon.rev20170708.OpenconfigTransportLineCommonService or org.onosproject.yang.gen.v1.openconfigtransportlinecommon.rev20170708.OpenconfigTransportLineCommon
java.lang.RuntimeException: printing backtrace..
at org.onosproject.yang.runtime.impl.DefaultYangModelRegistry.getRegisteredClass(DefaultYangModelRegistry.java:358)
at org.onosproject.yang.runtime.impl.ModelConverterUtil.getClassLoaderForAugment(ModelConverterUtil.java:222)
at org.onosproject.yang.runtime.impl.DataTreeBuilderHelper.processAugmentNode(DataTreeBuilderHelper.java:659)
at org.onosproject.yang.runtime.impl.DataTreeBuilderHelper.processCurSchemaNode(DataTreeBuilderHelper.java:469)
at org.onosproject.yang.runtime.impl.DataTreeBuilderHelper.getDataTree(DataTreeBuilderHelper.java:181)
at org.onosproject.yang.runtime.impl.DefaultDataTreeBuilder.processNodeObj(DefaultDataTreeBuilder.java:555)
at org.onosproject.yang.runtime.impl.DefaultDataTreeBuilder.processDataNodeConversion(DefaultDataTreeBuilder.java:191)
at org.onosproject.yang.runtime.impl.DefaultDataTreeBuilder.getResourceData(DefaultDataTreeBuilder.java:157)
at org.onosproject.yang.runtime.impl.DefaultModelConverter.createDataNode(DefaultModelConverter.java:48)
at org.onosproject.yang.impl.YangRuntimeManager.createDataNode(YangRuntimeManager.java:163)
at org.onosproject.odtn.cli.impl.OdtnPreConfCommand.toDataNode(OdtnPreConfCommand.java:253)
at org.onosproject.odtn.cli.impl.OdtnPreConfCommand.enable(OdtnPreConfCommand.java:162)
at org.onosproject.odtn.cli.impl.OdtnPreConfCommand.execute(OdtnPreConfCommand.java:115)
at org.onosproject.cli.AbstractShellCommand.doExecute(AbstractShellCommand.java:155)
at org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)[27:org.apache.karaf.shell.console:3.0.8]
at org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33)[27:org.apache.karaf.shell.console:3.0.8]
at Proxy5229c519_1afa_4afb_9b52_6f3d3c778d41.execute(Unknown Source)[:]
at Proxy5229c519_1afa_4afb_9b52_6f3d3c778d41.execute(Unknown Source)[:]
at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[27:org.apache.karaf.shell.console:3.0.8]
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)[27:org.apache.karaf.shell.console:3.0.8]
at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)[27:org.apache.karaf.shell.console:3.0.8]
at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[27:org.apache.karaf.shell.console:3.0.8]
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)[27:org.apache.karaf.shell.console:3.0.8]
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)[27:org.apache.karaf.shell.console:3.0.8]
at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)
at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:210)
at org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$1.runConsole(ShellFactoryImpl.java:158)[47:org.apache.karaf.shell.ssh:3.0.8]
at org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$1$1.run(ShellFactoryImpl.java:133)
at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_101]
at org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:57)[28:org.apache.karaf.jaas.modules:3.0.8]
at org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$1.run(ShellFactoryImpl.java:129)[47:org.apache.karaf.shell.ssh:3.0.8]

Gaurav agrawal

unread,
Mar 30, 2018, 12:58:50 AM3/30/18
to Yuta Higuchi, ONOS Dynamic Configuration Brigade

Hi Yuta,

 

Yes a custom model registrator will be needed to use ModelConverter. Please refer L3vpnModelRegistrator in /models/l3vpn on how to attach application end points to default model registrator.

 

Thanks and Regards,

Gaurav

--
You received this message because you are subscribed to the Google Groups "Dynamic configuration" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brigade-dyncon...@onosproject.org.
To post to this group, send email to brigade-...@onosproject.org.
Visit this group at https://groups.google.com/a/onosproject.org/group/brigade-dynconfig/.
To view this discussion on the web visit https://groups.google.com/a/onosproject.org/d/msgid/brigade-dynconfig/CAEJoDtO%2BzJnQ6xNK9Uf3OmVECgnPo4REAwWtzZ4eoetH%3DxGmCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/a/onosproject.org/d/optout.

Yuta Higuchi

unread,
Mar 30, 2018, 1:39:04 AM3/30/18
to Gaurav agrawal, ONOS Dynamic Configuration Brigade
Thank you for the clarification.

So do you think it's reasonable to say that, 
unless it’s a proprietary model that you know specifically you intend to use it, 
then probably all of those common/open models should have custom model registrator registering one class per .yang?


To unsubscribe from this group and stop receiving emails from it, send an email to brigade-dynconfig+unsubscribe@onosproject.org.
To post to this group, send email to brigade-dynconfig@onosproject.org.

Ashish Mittal

unread,
Mar 30, 2018, 1:53:22 AM3/30/18
to Yuta Higuchi, ONOS Dynamic Configuration Brigade
Hi Yuta,

We had faced this problem some time back and if i remember correctly, it was something related to Date mismatch.

ONOS compiles Yang models and create a  YangMetaData.ser file where it has stored objects of YangModel Interface. When it reads at runtime this YangMetaData.ser file in YangCompilerManager.parseJarFile()
from inside activate() method of  AbstractYangModelRegistrator
class, it gets a date different than expected. 

This problem makes registration of the Yang modes at run time with date other than expected in code i.e. 20170708. Due to which this problem happens.

This happens when you compile ONOS code on different machine and run on different and both of them are not in sync in time.

Since on the compilation machine code is generated from yang and it has date 20170708 which got encoded in .ser file. Now when it runs on different machine which time not in sync, it reads the ser file to find the modules available, it gets module with date other than 20170708 and hence no match found for this class.

Do you have any logs which can be used to verify with what date this module has got registered.

Regards

Ashish Mittal
--
Regards
Ashish Mittal

Gaurav agrawal

unread,
Mar 30, 2018, 1:54:26 AM3/30/18
to Yuta Higuchi, ONOS Dynamic Configuration Brigade

With current approach we have to register one class per yang. If there is any alternate better approach we should definitely evaluate the same.

To unsubscribe from this group and stop receiving emails from it, send an email to brigade-dyncon...@onosproject.org.
To post to this group, send email to brigade-...@onosproject.org.

Yuta Higuchi

unread,
Mar 30, 2018, 8:26:35 PM3/30/18
to Gaurav agrawal, ONOS Dynamic Configuration Brigade
I've tried using https://github.com/google/guava/wiki/ReflectionExplained#classpath to see if that part can be automated, 
but didn't work out. generated interface classes were never enumerated by ClassPath.
Not sure why, but I guess we'll need to explorer other ways.


To move thing forward, I manually added pieces required,
and the original error went away, are getting some XML generated,
but now I am having different problem.

I'm expecting something equivalent of below example to be generated,
but part highlighted in red is missing.

Please see the part building the tree in: 

Do you see a problem, constructing ModelObject with augmentation?

<component> <name>TRANSCEIVER_1_1_4_1</name> <config> <name>TRANSCEIVER_1_1_4_1</name> </config> <state> <name>TRANSCEIVER_1_1_4_1</name> <type xmlns:oc-platform-types="http://openconfig.net/yang/platform-types">oc-platform-types:TRANSCEIVER</type> </state> <transceiver xmlns="http://openconfig.net/yang/platform/transceiver"> <config> <enabled>true</enabled> <form-factor-preconf xmlns:oc-opt-types="http://openconfig.net/yang/transport-types">oc-opt-types:QSFP28</form-factor-preconf> <ethernet-pmd-preconf xmlns:oc-opt-types="http://openconfig.net/yang/transport-types">oc-opt-types:ETH_100GBASE_LR4</ethernet-pmd-preconf> </config> <state> <enabled>true</enabled> <form-factor-preconf xmlns:oc-opt-types="http://openconfig.net/yang/transport-types">oc-opt-types:QSFP28</form-factor-preconf> <ethernet-pmd-preconf xmlns:oc-opt-types="http://openconfig.net/yang/transport-types">oc-opt-types:ETH_100GBASE_LR4</ethernet-pmd-preconf> </state> </transceiver> </component>


To unsubscribe from this group and stop receiving emails from it, send an email to brigade-dynconfig+unsubscribe@onosproject.org.
To post to this group, send email to brigade-dynconfig@onosproject.org.

Gaurav agrawal

unread,
Apr 2, 2018, 1:03:08 AM4/2/18
to Yuta Higuchi, ONOS Dynamic Configuration Brigade

Hi Yuta,

 

You need to add an object of the class generated corresponding to augmentation. It seems you are adding an inner class which is “DefaultTransceiver”

 

 

 

There would be a class generated for below augment starting with prefix “DefaultAugmented..”

 

From: Yuta Higuchi [mailto:y-hi...@opennetworking.org]
Sent: 2018
331 5:56
To: Gaurav agrawal
Cc: ONOS Dynamic Configuration Brigade
Subject: Re: [brigade-dynconfig] Issue using ModelConverter with OpenConfig ModelObject

 

I've tried using https://github.com/google/guava/wiki/ReflectionExplained#classpath to see if that part can be automated, 

but didn't work out. generated interface classes were never enumerated by ClassPath.

Not sure why, but I guess we'll need to explorer other ways.

 

 

To move thing forward, I manually added pieces required,

and the original error went away, are getting some XML generated,

but now I am having different problem.

 

I'm expecting something equivalent of below example to be generated,

but part highlighted in red is missing.

 

Please see the part building the tree in: 

 

Do you see a problem, constructing ModelObject with augmentation?

 

<component> <name>TRANSCEIVER_1_1_4_1</name> <config> <name>TRANSCEIVER_1_1_4_1</name> </config> <state> <name>TRANSCEIVER_1_1_4_1</name> <type xmlns:oc-platform-types="http://openconfig.net/yang/platform-types">oc-platform-types:TRANSCEIVER</type> </state> <transceiver xmlns="http://openconfig.net/yang/platform/transceiver"> <config> <enabled>true</enabled> <form-factor-preconf xmlns:oc-opt-types="http://openconfig.net/yang/transport-types">oc-opt-types:QSFP28</form-factor-preconf> <ethernet-pmd-preconf xmlns:oc-opt-types="http://openconfig.net/yang/transport-types">oc-opt-types:ETH_100GBASE_LR4</ethernet-pmd-preconf> </config> <state> <enabled>true</enabled> <form-factor-preconf xmlns:oc-opt-types="http://openconfig.net/yang/transport-types">oc-opt-types:QSFP28</form-factor-preconf> <ethernet-pmd-preconf xmlns:oc-opt-types="http://openconfig.net/yang/transport-types">oc-opt-types:ETH_100GBASE_LR4</ethernet-pmd-preconf> </state> </transceiver> </component>

 

On Thu, Mar 29, 2018 at 10:53 PM, Gaurav agrawal <gaurav....@huawei.com> wrote:

With current approach we have to register one class per yang. If there is any alternate better approach we should definitely evaluate the same.

 

To unsubscribe from this group and stop receiving emails from it, send an email to brigade-dyncon...@onosproject.org.
To post to this group, send email to brigade-...@onosproject.org.

Gaurav agrawal

unread,
Apr 2, 2018, 1:08:33 AM4/2/18
to Gaurav agrawal, Yuta Higuchi, ONOS Dynamic Configuration Brigade

Documentation @ YANG tools wiki might be useful for Augment usage. (Note: It seems interfaces mentioned in the wiki is not updated one, we can update the same later.)

 

https://wiki.onosproject.org/display/ONOS/YANG+Compiler#YANGCompiler-Augment

 

 

From: Gaurav agrawal
Sent: 2018
42

10:33


To: 'Yuta Higuchi'
Cc: ONOS Dynamic Configuration Brigade

Subject: RE: [brigade-dynconfig] Issue using ModelConverter with OpenConfig ModelObject

 

Hi Yuta,

 

You need to add an object of the class generated corresponding to augmentation. It seems you are adding an inner class which is “DefaultTransceiver”

 

 

 

There would be a class generated for below augment starting with prefix “DefaultAugmented..”

 

From: Yuta Higuchi [mailto:y-hi...@opennetworking.org]
Sent: 2018
331 5:56
To: Gaurav agrawal
Cc: ONOS Dynamic Configuration Brigade
Subject: Re: [brigade-dynconfig] Issue using ModelConverter with OpenConfig ModelObject

 

I've tried using https://github.com/google/guava/wiki/ReflectionExplained#classpath to see if that part can be automated, 

but didn't work out. generated interface classes were never enumerated by ClassPath.

Not sure why, but I guess we'll need to explorer other ways.

 

 

To move thing forward, I manually added pieces required,

and the original error went away, are getting some XML generated,

but now I am having different problem.

 

I'm expecting something equivalent of below example to be generated,

but part highlighted in red is missing.

 

Please see the part building the tree in: 

 

Do you see a problem, constructing ModelObject with augmentation?

 

<component> <name>TRANSCEIVER_1_1_4_1</name> <config> <name>TRANSCEIVER_1_1_4_1</name> </config> <state> <name>TRANSCEIVER_1_1_4_1</name> <type xmlns:oc-platform-types="http://openconfig.net/yang/platform-types">oc-platform-types:TRANSCEIVER</type> </state> <transceiver xmlns="http://openconfig.net/yang/platform/transceiver"> <config> <enabled>true</enabled> <form-factor-preconf xmlns:oc-opt-types="http://openconfig.net/yang/transport-types">oc-opt-types:QSFP28</form-factor-preconf> <ethernet-pmd-preconf xmlns:oc-opt-types="http://openconfig.net/yang/transport-types">oc-opt-types:ETH_100GBASE_LR4</ethernet-pmd-preconf> </config> <state> <enabled>true</enabled> <form-factor-preconf xmlns:oc-opt-types="http://openconfig.net/yang/transport-types">oc-opt-types:QSFP28</form-factor-preconf> <ethernet-pmd-preconf xmlns:oc-opt-types="http://openconfig.net/yang/transport-types">oc-opt-types:ETH_100GBASE_LR4</ethernet-pmd-preconf> </state> </transceiver> </component>

 

On Thu, Mar 29, 2018 at 10:53 PM, Gaurav agrawal <gaurav....@huawei.com> wrote:

With current approach we have to register one class per yang. If there is any alternate better approach we should definitely evaluate the same.

 

To unsubscribe from this group and stop receiving emails from it, send an email to brigade-dyncon...@onosproject.org.
To post to this group, send email to brigade-...@onosproject.org.

Yuta Higuchi

unread,
Apr 2, 2018, 5:03:04 PM4/2/18
to Gaurav agrawal, ONOS Dynamic Configuration Brigade
Thanks for the info & pointer.

It's now spitting out tranceiver portion as well now.

onos> odtn-manual enable
XML:
<component xmlns="http://openconfig.net/yang/platform" xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="merge">
  <name>TRANSCEIVER_1_1_4_1</name>
    <config>
      <enabled>true</enabled>
      <form-factor-preconf xmlns:yangid="http://openconfig.net/yang/transport-types">yangid:QSFP28</form-factor-preconf>
      <ethernet-pmd-preconf xmlns:yangid="http://openconfig.net/yang/transport-types">yangid:ETH_100GBASE_LR4</ethernet-pmd-preconf>
    </config>
  </transceiver>
  <config>
    <name>TRANSCEIVER_1_1_4_1</name>
  </config>
</component>

JSON:
{
  "openconfig-platform:component" : [ {
    "name" : "TRANSCEIVER_1_1_4_1",
    "openconfig-platform-transceiver:transceiver" : {
      "config" : {
        "enabled" : "true",
        "form-factor-preconf" : "openconfig-transport-types:QSFP28",
        "ethernet-pmd-preconf" : "openconfig-transport-types:ETH_100GBASE_LR4"
      }
    },
    "config" : {
      "name" : "TRANSCEIVER_1_1_4_1"
    }
  } ]
}




To unsubscribe from this group and stop receiving emails from it, send an email to brigade-dynconfig+unsubscribe@onosproject.org.
To post to this group, send email to brigade-dynconfig@onosproject.org.

Reply all
Reply to author
Forward
0 new messages