[sysrepo-devel] loading two different yang file versions into sysrepo

Jakub Nadolski JNadolski at advaoptical.com
Fri Aug 25 10:42:15 UTC 2017


Radek,


I can load all my modules using libyang 0.13.49, thanks again for being so helpful.


Regards,

Jakub

________________________________
From: Radek Krejčí <rkrejci at cesnet.cz>
Sent: Thursday, August 24, 2017 5:27:39 PM
To: Jakub Nadolski; Michal Vaško
Cc: sysrepo-devel at sysrepo.org
Subject: Re: [sysrepo-devel] loading two different yang file versions into sysrepo

(we had discussion with Jakub off the list, now going back to the list)

Hi,
the issues should be solved in libyang 0.13.48 (current master and devel), please update and let me know if it solved all the issues - I'm now able to parse the most of the provided schemas, the rest is caused by bugs in schemas.

Regards,
Radek


Dne 23.8.2017 v 11:14 Radek Krejčí napsal(a):
> ok, I'll wait - from the backtrace it seems that there is something wrong with applying deviations, unfortunately I'm probably not able to solve the issue without the modules (I probably do not need all, just those causing the issue :)). You can try to run yanglint under valgrind if it see some issue there.
>
> Radek
>
>
> Dne 23.8.2017 v 11:07 Jakub Nadolski napsal(a):
>> Radek,
>>
>>
>> I will provide modules after I double-check I can do that, until then, here's the backtrace:
>>
>>
>> (gdb) bt
>> #0  0x00007f99c0db79ba in lys_node_addchild (parent=0x1c307f0, module=0x1c12f90, child=0x1c30e10) at /_path_/libyang/src/tree_schema.c:859
>> #1  0x00007f99c0dc1d51 in lys_switch_deviation (dev=0x1c02ab8, module=0x1bbae70, unres=0x1bc0390) at /_path_/libyang/src/tree_schema.c:4108
>> #2  0x00007f99c0dc2443 in remove_dev (dev=0x1c02ab8, module=0x1bbae70, unres=0x1bc0390) at /_path_/libyang/src/tree_schema.c:4251
>> #3  0x00007f99c0dc289d in lys_sub_module_remove_devs_augs (module=0x1bbae70) at /_path_/libyang/src/tree_schema.c:4325
>> #4  0x00007f99c0d3dad9 in ly_ctx_destroy (ctx=0x1bb3010, private_destructor=0x0) at /_path_/libyang/src/context.c:339
>> #5  0x0000000000405d66 in main_ni (argc=3, argv=0x7ffcd8da7668) at /_path_/libyang/tools/lint/main_ni.c:974
>> #6  0x0000000000402fac in main (argc=3, argv=0x7ffcd8da7668) at /_path_/libyang/tools/lint/main.c:41
>>
>> Thanks a lot, I really appreciate what you do:)
>>
>>
>> Regards,
>>
>> Jakub
>>
>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>> *From:* Radek Krejčí <rkrejci at cesnet.cz>
>> *Sent:* Wednesday, August 23, 2017 10:49:14 AM
>> *To:* Jakub Nadolski; Michal Vaško
>> *Cc:* sysrepo-devel at sysrepo.org
>> *Subject:* Re: [sysrepo-devel] loading two different yang file versions into sysrepo
>>
>> Hi Jakub,
>> on your own (or without permission to provide the modules), you can connect to it with gdb and provide at least the stack traceback where it hangs. But preferably, please, provide us all the modules (in zip or tar) to allow us to debug it.
>>
>> Regards,
>> Radek
>>
>> Dne 23.8.2017 v 10:43 Jakub Nadolski napsal(a):
>>> Radek,
>>>
>>>
>>> The same happens when parsing with yanglint, so looks like there's a problem in parsing, here's the output:
>>>
>>>
>>> yanglint mef-cfm-dev.yang -VVV
>>>
>>> Validating mef-cfm-dev.yang schema file.
>>> verb: Searching for "mef-cfm" in /_path_/yang-models.
>>> verb: Searching for "mef-cfm" in /_path_/yang-models.
>>> verb: Loading schema from "/_path_/yang-models/mef-cfm.yang" file.
>>> verb: Searching for "ietf-yang-types" in /_path_/yang-models.
>>> verb: Loading schema from "/_path_/yang-models/ietf-yang-types at 2010-09-24.yang" file.
>>> verb: Module "ietf-yang-types" successfully parsed.
>>> verb: Searching for "ietf-inet-types" in /_path_/yang-models.
>>> verb: Loading schema from "/_path_/yang-models/ietf-inet-types at 2010-09-24.yang" file.
>>> verb: Resolving derived type "union" failed, it will be attempted later.
>>> verb: Resolving type default "" failed, it will be attempted later.
>>> verb: Resolving derived type "union" failed, it will be attempted later.
>>> verb: Resolving type default "" failed, it will be attempted later.
>>> verb: Resolving derived type "union" failed, it will be attempted later.
>>> verb: Resolving type default "" failed, it will be attempted later.
>>> verb: Resolving "ietf-inet-types" unresolved schema nodes and their constraints...
>>> verb: All "ietf-inet-types" schema nodes and constraints resolved.
>>> verb: Module "ietf-inet-types" successfully parsed.
>>> verb: Module "mef-cfm" successfully parsed.
>>> verb: Searching for "mef-soam-fm" in /_path_/yang-models.
>>> verb: Searching for "mef-soam-fm" in /_path_/yang-models.
>>> verb: Loading schema from "/_path_/yang-models/mef-soam-fm.yang" file.
>>> verb: Resolving "mef-soam-fm" unresolved schema nodes and their constraints...
>>> warn: Schema node "true" not found (../is-generator = true) with context node "/create-test-signal/input/test-type".
>>> warn: Schema node "true" not found (../is-generator = true) with context node "/create-test-signal/input/target-address".
>>> warn: Schema node "true" not found (../is-generator = true) with context node "/create-test-signal/input/interval".
>>> warn: Schema node "true" not found (../is-generator = true) with context node "/create-test-signal/input/priority".
>>> warn: Schema node "true" not found (../is-generator = true) with context node "/create-test-signal/input/drop-eligible".
>>> warn: Schema node "true" not found (../is-generator = true) with context node "/create-test-signal/input/frame-size".
>>> warn: Schema node "true" not found (../y1731-compliant= true) with context node "/mef-cfm:maintenance-domain/mef-cfm:maintenance-association/meg-id-format".
>>> warn: Schema node "icc-based" not found (../meg-id-format = icc-based) with context node "/mef-cfm:maintenance-domain/mef-cfm:maintenance-association/icc-name-value".
>>> warn: Schema node "true" not found (../y1731-compliant= true) with context node "/mef-cfm:maintenance-domain/mef-cfm:maintenance-association/meg-level".
>>> warn: Schema node "data-tlv" not found (not(../data-tlv) with context node "/mef-cfm:maintenance-domain/mef-cfm:maintenance-association/mef-cfm:maintenance-association-end-point/mef-cfm:loopback/frame-size".
>>> warn: Schema node "data-tlv" not found (not(../data-tlv) with context node "/mef-cfm:maintenance-domain/mef-cfm:maintenance-association/mef-cfm:maintenance-association-end-point/mef-cfm:loopback/data-pattern".
>>> warn: Schema node "data-tlv" not found (not(../data-tlv) with context node "/mef-cfm:maintenance-domain/mef-cfm:maintenance-association/mef-cfm:maintenance-association-end-point/mef-cfm:loopback/test-tlv-included".
>>> warn: Schema node "data-tlv" not found (not(../data-tlv) with context node "/mef-cfm:maintenance-domain/mef-cfm:maintenance-association/mef-cfm:maintenance-association-end-point/mef-cfm:loopback/test-tlv-pattern".
>>> warn: Schema node "true" not found (../is-generator = true) with context node "/mef-cfm:maintenance-domain/mef-cfm:maintenance-association/mef-cfm:maintenance-association-end-point/test-signal/test-type".
>>> warn: Schema node "true" not found (../is-generator = true) with context node "/mef-cfm:maintenance-domain/mef-cfm:maintenance-association/mef-cfm:maintenance-association-end-point/test-signal/target-address".
>>> warn: Schema node "true" not found (../is-generator = true) with context node "/mef-cfm:maintenance-domain/mef-cfm:maintenance-association/mef-cfm:maintenance-association-end-point/test-signal/interval".
>>> warn: Schema node "true" not found (../is-generator = true) with context node "/mef-cfm:maintenance-domain/mef-cfm:maintenance-association/mef-cfm:maintenance-association-end-point/test-signal/priority".
>>> warn: Schema node "true" not found (../is-generator = true) with context node "/mef-cfm:maintenance-domain/mef-cfm:maintenance-association/mef-cfm:maintenance-association-end-point/test-signal/drop-eligible".
>>> warn: Schema node "true" not found (../is-generator = true) with context node "/mef-cfm:maintenance-domain/mef-cfm:maintenance-association/mef-cfm:maintenance-association-end-point/test-signal/frame-size".
>>> warn: Schema node "true" not found (../is-receiver = true) with context node "/mef-cfm:maintenance-domain/mef-cfm:maintenance-association/mef-cfm:maintenance-association-end-point/test-signal/test-signal-stats-in".
>>> warn: Schema node "true" not found (../is-generator = true) with context node "/mef-cfm:maintenance-domain/mef-cfm:maintenance-association/mef-cfm:maintenance-association-end-point/test-signal/test-signal-stats-out".
>>> verb: All "mef-soam-fm" schema nodes and constraints resolved.
>>> verb: Module "mef-soam-fm" successfully parsed.
>>> verb: Searching for "mef-soam-pm" in /_path_/yang-models.
>>> verb: Searching for "mef-soam-pm" in /_path_/yang-models.
>>> verb: Loading schema from "/_path_/yang-models/mef-soam-pm.yang" file.
>>> verb: Module "mef-soam-pm" successfully parsed.
>>> verb: Module "mef-cfm-dev" successfully parsed.
>>> Enabling all features in module ietf-yang-library.
>>> Enabling all features in module ietf-yang-types.
>>> Enabling all features in module ietf-inet-types.
>>> Enabling all features in module mef-cfm.
>>> Enabling all features in module mef-soam-fm.
>>> Enabling all features in module mef-soam-pm.
>>> Enabling all features in module mef-cfm-dev.
>>>
>>> And here it hangs.
>>>
>>>
>>> Thanks,
>>>
>>> Jakub
>>>
>>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>> *From:* Radek Krejčí <rkrejci at cesnet.cz>
>>> *Sent:* Wednesday, August 23, 2017 10:24:40 AM
>>> *To:* Jakub Nadolski; Michal Vaško
>>> *Cc:* sysrepo-devel at sysrepo.org
>>> *Subject:* Re: [sysrepo-devel] loading two different yang file versions into sysrepo
>>>
>>> Hi, please try to parse them with yanglint (tool installed with libyang), there are also options to increase verbosity. At least we will see if the problem is in parsing the schemas or in something specific to sysrepoctl.
>>>
>>> Radek
>>>
>>>
>>> Dne 23.8.2017 v 10:12 Jakub Nadolski napsal(a):
>>>> Hi Radek,
>>>>
>>>>
>>>> I just tested with libyang 0.13.47 and it works well, I am able to load almost all of my modules, thanks a lot for the quick help. I still have some problems with the modules where deviations are defined, but these are private company modules and I need to be sure before making them public. The behavior is strange, because there's no error, but sysrepoctl doesn't return, just hangs:
>>>>
>>>>
>>>> sysrepoctl -i --yang=mef-cfm-dev.yang
>>>> Installing a new module from file 'mef-cfm-dev.yang'...
>>>> Installing the YANG file to '/_path_/sysrepo/build/repository/yang/mef-cfm-dev at 2017-07-26.yang'...
>>>> Resolving dependency: 'mef-cfm-dev' imports 'mef-cfm'...
>>>> Installing the YANG file to '/_path_/sysrepo/build/repository/yang/mef-cfm at 2012-04-16.yang'...
>>>> Resolving dependency: 'mef-cfm' imports 'ietf-yang-types'...
>>>> Installing the YANG file to '/_path_/sysrepo/build/repository/yang/ietf-yang-types at 2010-09-24.yang'...
>>>> Resolving dependency: 'mef-cfm' imports 'ietf-inet-types'...
>>>> Installing the YANG file to '/_path_/sysrepo/build/repository/yang/ietf-inet-types at 2010-09-24.yang'...
>>>> Resolving dependency: 'mef-cfm-dev' imports 'mef-soam-fm'...
>>>> Installing the YANG file to '/_path_/sysrepo/build/repository/yang/mef-soam-fm at 2012-04-16.yang'...
>>>> Resolving dependency: 'mef-soam-fm' imports 'mef-cfm'...
>>>> Installing the YANG file to '/_path_/sysrepo/build/repository/yang/mef-cfm at 2012-04-16.yang'...
>>>> Resolving dependency: 'mef-cfm' imports 'ietf-yang-types'...
>>>> Installing the YANG file to '/_path_/sysrepo/build/repository/yang/ietf-yang-types at 2010-09-24.yang'...
>>>> Resolving dependency: 'mef-cfm' imports 'ietf-inet-types'...
>>>> Installing the YANG file to '/_path_/sysrepo/build/repository/yang/ietf-inet-types at 2010-09-24.yang'...
>>>> Resolving dependency: 'mef-soam-fm' imports 'ietf-yang-types'...
>>>> Installing the YANG file to '/_path_/sysrepo/build/repository/yang/ietf-yang-types at 2010-09-24.yang'...
>>>> Resolving dependency: 'mef-cfm-dev' imports 'mef-soam-pm'...
>>>> Installing the YANG file to '/_path_/sysrepo/build/repository/yang/mef-soam-pm at 2012-04-16.yang'...
>>>> Resolving dependency: 'mef-soam-pm' imports 'mef-cfm'...
>>>> Installing the YANG file to '/_path_/sysrepo/build/repository/yang/mef-cfm at 2012-04-16.yang'...
>>>> Resolving dependency: 'mef-cfm' imports 'ietf-yang-types'...
>>>> Installing the YANG file to '/_path_/sysrepo/build/repository/yang/ietf-yang-types at 2010-09-24.yang'...
>>>> Resolving dependency: 'mef-cfm' imports 'ietf-inet-types'...
>>>> Installing the YANG file to '/_path_/sysrepo/build/repository/yang/ietf-inet-types at 2010-09-24.yang'...
>>>> Resolving dependency: 'mef-soam-pm' imports 'ietf-yang-types'...
>>>> Installing the YANG file to '/_path_/sysrepo/build/repository/yang/ietf-yang-types at 2010-09-24.yang'...
>>>>
>>>> Nothing happens here until I cancel this command. Are there some logs when I can check what happens and why it hangs?
>>>>
>>>>
>>>> Regards,
>>>>
>>>> Jakub
>>>>
>>>>
>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>>> *From:* Radek Krejčí <rkrejci at cesnet.cz>
>>>> *Sent:* Tuesday, August 22, 2017 3:57:57 PM
>>>> *To:* Jakub Nadolski; Michal Vaško
>>>> *Cc:* sysrepo-devel at sysrepo.org
>>>> *Subject:* Re: [sysrepo-devel] loading two different yang file versions into sysrepo
>>>>
>>>> Hi Jakub,
>>>> the value " " for bits does not strictly follow the bits representation description from RFC, but in this case the parser should probably handle that in silence on its own (as it does even for other types). So, please, update libyang to 0.13.47 version, which should fix this issue.
>>>>
>>>> Regards,
>>>> Radek
>>>>
>>>>
>>>> Dne 22.8.2017 v 15:19 Jakub Nadolski napsal(a):
>>>>> Hi Michal,
>>>>>
>>>>>
>>>>> This is standard one, from MEF - https://www.mef.net/Assets/Technical_Specifications/PDF/MEF_39.pdf
>>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Jakub
>>>>>
>>>>>
>>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>>>> *From:* Michal Vaško <mvasko at cesnet.cz>
>>>>> *Sent:* Tuesday, August 22, 2017 3:14:52 PM
>>>>> *To:* Jakub Nadolski
>>>>> *Cc:* sysrepo-devel at sysrepo.org
>>>>> *Subject:* Re: [sysrepo-devel] loading two different yang file versions into sysrepo
>>>>>
>>>>> Hello Jakub,
>>>>> could you please provide the module in question for us? If you do not want to publish it publicly, it would be great if you could send it to my private email at least. We want to examine the problem carefully and then decide whether to fix this error or really consider the value invalid.
>>>>>
>>>>> Regards,
>>>>> Michal
>>>>>
>>>>> On Tuesday, August 22, 2017 14:59 CEST, Jakub Nadolski <JNadolski at advaoptical.com> wrote:
>>>>>
>>>>>> Hi Michal,
>>>>>>
>>>>>>
>>>>>> Thanks for the quick answer. I tried --search-dir option and I was able to load mef-cfm.yang. The next problem I see is with loading mef-soam-fm.yang:
>>>>>>
>>>>>>
>>>>>> Installing a new module from file 'mef-soam-pm.yang'...
>>>>>> [ERR] (srctl_ly_log_cb:500) libyang: Invalid value " " in "fake-default" element.
>>>>>> [ERR] (srctl_ly_log_cb:500) libyang: Invalid value " " in "fake-default" element.
>>>>>> [ERR] (srctl_ly_log_cb:500) libyang: Invalid value " " in "fake-default" element.
>>>>>> [ERR] (srctl_ly_log_cb:500) libyang: Invalid value " " in "fake-default" element.
>>>>>> [ERR] (srctl_ly_log_cb:500) libyang: Invalid value " " in "fake-default" element.
>>>>>> [ERR] (srctl_ly_log_cb:500) libyang: Invalid value " " in "fake-default" element.
>>>>>> [ERR] (srctl_ly_log_cb:500) libyang: Invalid value " " in "fake-default" element.
>>>>>> [ERR] (srctl_ly_log_cb:500) libyang: Invalid value " " in "fake-default" element.
>>>>>> [ERR] (srctl_ly_log_cb:500) libyang: Module "mef-soam-pm" parsing failed.
>>>>>> Error: Unable to load the module by libyang.
>>>>>> Install operation failed.
>>>>>>
>>>>>> The invalid value " " is used as default value for some leafs with bits type. Is this could be libyang issue?
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Jakub
>>>>>>
>>>>>>
>>>>>> ________________________________
>>>>>> From: Michal Vaško <mvasko at cesnet.cz>
>>>>>> Sent: Tuesday, August 22, 2017 2:30:38 PM
>>>>>> To: Jakub Nadolski
>>>>>> Cc: sysrepo-devel at sysrepo.org
>>>>>> Subject: Re: [sysrepo-devel] loading two different yang file versions into sysrepo
>>>>>>
>>>>>> Hi Jakub,
>>>>>> do not install imported modules directly (unless you want to also implement that module or you want to use an identity from that module). If you install mef-cfm.yang or another module that imports some other modules, they are loaded only as imports (as long as they are found in searchpaths), which can have duplicate names (but must have different revisions). Try executing "sysrepoctl -l", it will show you the current status of conformance for each module loaded into sysrepo.
>>>>>>
>>>>>> Regards,
>>>>>> Michal
>>>>>>
>>>>>> On Tuesday, August 22, 2017 13:59 CEST, Jakub Nadolski <JNadolski at advaoptical.com> wrote:
>>>>>>
>>>>>>> Hi All,
>>>>>>>
>>>>>>>
>>>>>>> I am using standard yang module mef-cfm.yang which depends on the ietf-inet-types at 2010-09-24.yang. But for other modules in my system, I need ietf-inet-types at 2013-07-15.yang. When trying to load both modules to sysrepo and I got an error:
>>>>>>>
>>>>>>>
>>>>>>> sysrepoctl -i --yang=ietf-inet-types at 2010-09-24.yang
>>>>>>> Installing a new module from file 'ietf-inet-types at 2010-09-24.yang'...
>>>>>>> Installing the YANG file to '/_path_/sysrepo/build/repository/yang/ietf-inet-types at 2010-09-24.yang'...
>>>>>>> Skipping installation of data files for module 'ietf-inet-types'...
>>>>>>> Notifying sysrepo about the change...
>>>>>>> Install operation completed successfully.
>>>>>>>
>>>>>>> sysrepoctl -i --yang=ietf-inet-types at 2013-07-15.yang
>>>>>>> Installing a new module from file 'ietf-inet-types at 2013-07-15.yang'...
>>>>>>> Installing the YANG file to '/_path_/sysrepo/build/repository/yang/ietf-inet-types at 2013-07-15.yang'...
>>>>>>> [ERR] (md_insert_lys_module:1905) Module 'ietf-inet-types' is already implemented in revision '2010-09-24'.
>>>>>>> Error: Unable to insert the module into the dependency graph.
>>>>>>> Reverting the install operation...
>>>>>>> Deleted the schema file '/_path_/sysrepo/build/repository/yang/ietf-inet-types at 2013-07-15.yang'.
>>>>>>> Install operation failed.
>>>>>>>
>>>>>>> Currently, I know that Netconf client, MG Soft Browser, supports loading two versions of the same yang. Do you know if there's a way to solve this problem?
>>>>>>>
>>>>>>> Thanks in advance,
>>>>>>> Jakub
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> sysrepo-devel mailing list
>>>>> sysrepo-devel at sysrepo.org
>>>>> http://lists.sysrepo.org/listinfo/sysrepo-devel
>>>> --
>>>> Radek Krejci
>>>> mobile  : +420 732 212 714
>>>> office  : +420 234 680 256
>>>> e-mail  : rkrejci at cesnet.cz
>>>> LinkedIn: http://www.linkedin.com/in/radekkrejci
>>>>
>>>> CESNET, Association of Legal Entities
>>>> Zikova 4
>>>> 160 00 Praha 6
>>>> Czech Republic
>>>>
>>>>
>>
>
> _______________________________________________
> sysrepo-devel mailing list
> sysrepo-devel at sysrepo.org
> http://lists.sysrepo.org/listinfo/sysrepo-devel


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sysrepo.org/archives/sysrepo-devel/attachments/20170825/61119d09/attachment.html>


More information about the sysrepo-devel mailing list