Re: [yang-doctors] ?= [netconf] Require-instance problem [was: RE: =?utf-8?q? WGLC: draft-ietf-netconf-notification-capabilities-11]

Michal Vaško <mvasko@cesnet.cz> Fri, 13 March 2020 09:04 UTC

Return-Path: <mvasko@cesnet.cz>
X-Original-To: yang-doctors@ietfa.amsl.com
Delivered-To: yang-doctors@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B97FE3A1448; Fri, 13 Mar 2020 02:04:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.097 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cesnet.cz
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vyxiyJfCjIvK; Fri, 13 Mar 2020 02:04:20 -0700 (PDT)
Received: from kalendar.cesnet.cz (kalendar.cesnet.cz [78.128.211.34]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 212703A1446; Fri, 13 Mar 2020 02:04:19 -0700 (PDT)
Received: by kalendar.cesnet.cz (Postfix, from userid 999) id 3C6AB6016E; Fri, 13 Mar 2020 10:04:16 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cesnet.cz; s=kalendar; t=1584090256; bh=pfClkit1PnZQ410vF5Mwe0D1R6jHczgBmHTYUBDWaWc=; h=In-Reply-To:From:Date:Cc:To:Subject; b=v/bvtP8eKmiVJEyEDK86Lk2UrSNxpvyZUaXHMCQuo2kdpTjG78jA7EnMkv3BnX2hh +NuAxf3z1Djg7r5PhJWfcncfGs/yK8qQ6sl7asXEybmVyWiJWScAtIAc2HhZQrjZZ7 d5BvppqmY68qb7xDpilPu6ggZJvxgEmsswo/B44E=
Content-Type: text/plain; charset="utf-8"
In-Reply-To: <DB7PR07MB4011D375898BD9B8DD213135F0FA0@DB7PR07MB4011.eurprd07.prod.outlook.com>
From: Michal Vaško <mvasko@cesnet.cz>
X-Forward: 84.42.161.20
Date: Fri, 13 Mar 2020 10:04:16 +0100
Cc: Mahesh Jethanandani <mjethanandani@gmail.com>, "netconf@ietf.org" <netconf@ietf.org>, "yang-doctors@ietf.org" <yang-doctors@ietf.org>
To: Balázs Lengyel <balazs.lengyel=40ericsson.com@dmarc.ietf.org>
MIME-Version: 1.0
Message-ID: <18a5-5e6b4c80-51-14b8eec0@242693337>
User-Agent: SOGoMail 2.3.23
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/Yy2ibwxwGdPP6OThvQTBIL0rAvY>
Subject: Re: [yang-doctors] ?==?utf-8?q? [netconf] Require-instance problem [was:?==?utf-8?q? RE:?==?utf-8?q? WGLC: draft-ietf-netconf-notification-capabilities-11]
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Email list of the yang-doctors directorate <yang-doctors.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-doctors/>
List-Post: <mailto:yang-doctors@ietf.org>
List-Help: <mailto:yang-doctors-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Mar 2020 09:04:23 -0000

Hi Balazs,
just to explain libyang behavior, if you look at (pattern <https://tools.ietf.org/html/rfc7950#section-9.4.5> ) definition, there is explicitly mentioned that it can appear in derived types. There is no such wording for (require-instance <https://tools.ietf.org/html/rfc7950#section-9.9.3> ), it mentions only "instance-identifier" and "leafref" types.

Also, libyang does not allow loading invalid schemas so even if you only import it, it will fail.

Regards,
Michal

On Friday, March 13, 2020 09:55 CET, Balázs Lengyel <balazs.lengyel=40ericsson.com@dmarc.ietf.org> wrote: 
 
> Hello Mahesh,
> 
> Even if there is some problem with ietf-subscribed-notification how does that effect the validity of instance data for ietf-system-capabilities or ietf-notification-capabilities ? I only import a type and a feature from Yangpush (which imports subscribed notification). These seem nothing to do with require-instance.
> 
>  
> 
> Aside from my draft:
> 
> I do not understand some of libyangs statements:  
> 
> “as it turned out (ref <https://tools.ietf.org/html/rfc7950#section-9.9.3> ), you cannot put require-instance into a derived type”. 
> 
> Checking ref I did not find why you cannot put require instance into a typedef.
> 
>  
> 
> By the way I have bigger issues with YangValidator. When I load ietf-system-capabilities@2020-03-08 into it I get 
> 
>  
> 
> RecursionError at /yangvalidator/validator
> 
> maximum recursion depth exceeded
> 
> 
> Request Method:
> 
> POST
> 
> 
> Request URL:
> 
> http://www.yangvalidator.com/yangvalidator/validator
> 
> 
> Django Version:
> 
> 3.0.4
> 
> 
> Exception Type:
> 
> RecursionError
> 
> 
> Exception Value:
> 
> maximum recursion depth exceeded
> 
> 
> Exception Location:
> 
> /home/yang/yangvalidator/lib/python3.6/site-packages/pyang-2.1.1-py3.6.egg/pyang/statements.py in newf, line 42
> 
> 
> Python Executable:
> 
> /usr/sbin/uwsgi
> 
> 
> Python Version:
> 
> 3.6.10
> 
> 
> Python Path:
> 
> ['/home/yang/yangvalidator/lib/python3.6/site-packages/pyang-2.1.1-py3.6.egg/pyang/transforms',
> 
>  
> 
> Regards Balazs
> 
>  
> 
> From: Mahesh Jethanandani <mjethanandani@gmail.com> 
> Sent: 2020. március 12., csütörtök 22:28
> To: Balázs Lengyel <balazs.lengyel@ericsson.com>
> Cc: Kent Watsen <kent+ietf@watsen.net>; netconf@ietf.org; yang-doctors@ietf.org
> Subject: Re: [netconf] WGLC: draft-ietf-netconf-notification-capabilities-11
> 
>  
> 
> [Adding yang-doctors]
> 
>  
> 
> Hi Balazs,
> 
>  
> 
>  
> 
> On Mar 10, 2020, at 2:06 AM, Balázs Lengyel <balazs.lengyel@ericsson.com <mailto:balazs.lengyel@ericsson.com> > wrote:
> 
>  
> 
> Finally, have all the examples in the appendix been validated?
> 
> BALAZS: Yes, they have been loaded into a live Confd server.
> 
>  
> 
> I bring this up because I ran into issues when validating the https-notif model using ietf-subscribed-notification module, something that you also import. Here is what I see when I try to use yanglint to validate your example. In this case, I named your example as examples-notification-capabilities-1.xml.
> 
>  
> 
> bash-3.2$ yanglint -s -i -t auto -p /Volumes/External/git/iana/yang-parameters/ ietf-system-capabilities@2020-03-08.yang <mailto:ietf-system-capabilities@2020-03-08.yang>  ietf-notification-capabilities@2020-03-09.yang <mailto:ietf-notification-capabilities@2020-03-09.yang>  examples-notification-capabilities-1.xml 
> 
> err : Invalid keyword "require-instance".
> 
> err : Module "ietf-subscribed-notifications" parsing failed.
> 
> err : Importing "ietf-subscribed-notifications" module into "ietf-yang-push" failed.
> 
> err : Module "ietf-yang-push" parsing failed.
> 
> err : Importing "ietf-yang-push" module into "ietf-notification-capabilities" failed.
> 
> err : Module "ietf-notification-capabilities" parsing failed.
> 
>  
> 
> At first I thought the issue was with yanglint, because just like you I used confd and it did not complain. But folks over at libyang tell me that this was discussed as part of their issue  #881 <https://protect2.fireeye.com/v1/url?k=a6420c80-fa9605e6-a6424c1b-8610d8a762ca-d6cddc5edf1151a7&q=1&e=3cd8e8af-8aea-4f96-939b-8e1e455eac74&u=https%3A%2F%2Fgithub.com%2FCESNET%2Flibyang%2Fissues%2F881>  and the conclusion was that you cannot put require-instance in a derived type based on this <https://tools.ietf.org/html/rfc7950#section-9.9.3>  text.
> 
>  
> 
> Who is correct in their assertion, libyang or confd/RFC8639?
> 
>  
> 
> In case anyone is wondering which ietf-subsciribed-notifications module is being imported, here it is:
> 
>  
> 
> bash-3.2$ ls .../iana/yang-parameters/ietf-subscribed-notifications@2019-09-09.yang <mailto:iana/yang-parameters/ietf-subscribed-notifications@2019-09-09.yang> 
> 
>  
> 
> Cheers.
> 
>  
> 
> BTW, even if I comment out the ‘require-instance’ statement, yanglint complains about other issues with ietf-subscribed-notifications, which I will bring up in a separate thread.
> 
>  
> 
> Mahesh Jethanandani
> 
> mjethanandani@gmail.com <mailto:mjethanandani@gmail.com> 
> 
>  
> 
>  
> 
>  
>