Re: [yang-doctors] [netconf] Require-instance problem [was: RE: WGLC: draft-ietf-netconf-notification-capabilities-11]

Balázs Lengyel <balazs.lengyel@ericsson.com> Fri, 13 March 2020 09:40 UTC

Return-Path: <balazs.lengyel@ericsson.com>
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 54DDD3A14CB; Fri, 13 Mar 2020 02:40:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.101
X-Spam-Level:
X-Spam-Status: No, score=-2.101 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_PASS=-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=ericsson.com
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 UvwFJF1PVHyt; Fri, 13 Mar 2020 02:40:28 -0700 (PDT)
Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20631.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1a::631]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 310423A14C9; Fri, 13 Mar 2020 02:40:27 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jcsbeTKeSqT5HUEqN2uH6LweI3hSC1av00DStLkzjtK6wTkeuB8HH0/DO2EZFMOBGSErbOVj1TBgzVgr/QWKcKNu/oZ0Ukd11WPp4hvHhne/W+8lG7UYU05L6VCeU7/Pe/MtrDpf/HZiqxnVlSYb1qKEYwQar7ASNPEmWhq9L4lOxnQXEm+xz3Gqr6VmQCLOZt1BT5DbPFpzyBqc3TMdOzCNfL4dzD48XtGcmXebIjkYeqart61PoUpEVEfdRLcCz8ixClYQWG0gfgyl7HVQcuX3wT7+FrSW3WJytv+OMFGeZleOl6oTAsNA3NZ3Pb94jMIFkZqwZUL36c/gBI7B+g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qSxfoNJAxcyoL6o4cZ243qRJXvK7Y+ZOg4g3kSnC7tY=; b=ZjBEqE0o0PgHZVhNf6zp2a4+WtN1iHKLJZkvmD3X1FzcYe/oMfTzA5rTWsTw8HUZk6375wnGp0HY8WEl84wL+wPM7m1xdjj5Y/+hzI8jJnW9DLS6qWa/N/Etv2gohhX5G68lwMCnMVNP8D978WplL7jpJ40uURlykKPrsOu83mpr6y4CrcDjoWMt3AiSug0Cc3C6/aoolpufo5VtQQOVVXmrzANd7b88ijS+SdzEIKxD3b7ojdz4SF44qJZRPNa45E6QfMBDhRA2wa7dI2U1570Ne9wHAWQ9OCtTZa0UIUTvJzqotv2rcZ5zPcopa7DiKXHGBpmz2gHx98wIvrdJ0Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ericsson.com; dmarc=pass action=none header.from=ericsson.com; dkim=pass header.d=ericsson.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qSxfoNJAxcyoL6o4cZ243qRJXvK7Y+ZOg4g3kSnC7tY=; b=byWwAbjs3+cW7VTJu9lEerkG/DBypf7jCD9AaAN6GYVkAjjxJV7b8zukdWmB1R2Pq5UhtxAyWKN+MwHEVszp1cRJWWaNLhhW8kobUbEXfVG0ncw6k6Iyup6jiy6r3MPMaUT/wvTxa6X6KtrKu4ErAl7vJOuTqA+2Z7n1EvdOC+g=
Received: from DB7PR07MB4011.eurprd07.prod.outlook.com (52.134.97.155) by DB7PR07MB3993.eurprd07.prod.outlook.com (52.134.100.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.9; Fri, 13 Mar 2020 09:40:25 +0000
Received: from DB7PR07MB4011.eurprd07.prod.outlook.com ([fe80::15cf:dc81:c6f4:aa0c]) by DB7PR07MB4011.eurprd07.prod.outlook.com ([fe80::15cf:dc81:c6f4:aa0c%7]) with mapi id 15.20.2814.007; Fri, 13 Mar 2020 09:40:25 +0000
From: Balázs Lengyel <balazs.lengyel@ericsson.com>
To: Michal Vaško <mvasko@cesnet.cz>
CC: Mahesh Jethanandani <mjethanandani@gmail.com>, "netconf@ietf.org" <netconf@ietf.org>, "yang-doctors@ietf.org" <yang-doctors@ietf.org>
Thread-Topic: [netconf] Require-instance problem [was: RE: WGLC: draft-ietf-netconf-notification-capabilities-11]
Thread-Index: AQHV+RZpBUOVF1UimEGStkW/1nHgpahGQQhg
Date: Fri, 13 Mar 2020 09:40:25 +0000
Message-ID: <DB7PR07MB4011F15A702E44FA45DE894DF0FA0@DB7PR07MB4011.eurprd07.prod.outlook.com>
References: <DB7PR07MB4011D375898BD9B8DD213135F0FA0@DB7PR07MB4011.eurprd07.prod.outlook.com> <18a5-5e6b4c80-51-14b8eec0@242693337>
In-Reply-To: <18a5-5e6b4c80-51-14b8eec0@242693337>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=balazs.lengyel@ericsson.com;
x-originating-ip: [80.98.254.17]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 84d276fc-a4be-46d7-cea7-08d7c7328eba
x-ms-traffictypediagnostic: DB7PR07MB3993:
x-microsoft-antispam-prvs: <DB7PR07MB39935181AFD26A8430F66F1AF0FA0@DB7PR07MB3993.eurprd07.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:2887;
x-forefront-prvs: 034119E4F6
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(39860400002)(396003)(346002)(376002)(136003)(199004)(9686003)(478600001)(33656002)(85202003)(5660300002)(54906003)(52536014)(71200400001)(966005)(85182001)(66574012)(86362001)(66616009)(15650500001)(66556008)(64756008)(4326008)(66446008)(7696005)(66476007)(76116006)(26005)(55016002)(186003)(8676002)(66946007)(6506007)(81156014)(2906002)(81166006)(316002)(6916009)(8936002)(53546011); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR07MB3993; H:DB7PR07MB4011.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1;
received-spf: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: esbeczwS/l8JRqQJqjePh/ZEfNMV+pq63ZU1NtkcJVnD1wHIcfYl0qZyj0G6/w0lA82V3/T9VZhQvCMh9MT15qKqPudxI4SQVSfak5CiUE3OQTlOHbrer7pnnZje31g33QysDfTzgbZn74FjrAUSy2XqH02fkreLxuq/lH1KEXv41y/ciw4w2UmIf9AgM31fxlqmJwNTPwhkxBopIjVqmhWbmTm1wdWkNp4dIJ0BsqWrBrnjSUEE/yQWhX5fdcZNvaC+DfMUAfklwtDtBuZ3qVqv25aXwffJ/Zmu1+l/KgFC924rXAaR/NPxqmXwrFzRd9696bYD+KWEIYynTvz1uwIBmJzWLxTSmVgFeW4TAxw29X8bu2vvjKycuZPdiDwoU5S/d7bfYsAVJq0XybR8eygHopWF/+OA1QvukmKGFs5FlNliTfyvFMgZNPMrQd/iM49Z+1uXhYC9Qz4t3+w/cVnIVEIwpJQ3jt4i0u4PuDa0Mi4k7AADu8BNXSlyJfHK85NBHRxvPYHe07SUPrJWQw==
x-ms-exchange-antispam-messagedata: 1Z0iGQ03C15ePJI7o57XT00+F5vbfPUufAIwRxySW6Lx4tN8XhAdN9Lx7EjLS1zzaQXeSkUKGmN/zZrF/M85JX7kDh6mqZyHDlYjJnZDdbvBm1pBR9TKnx3stGyHecoWFl471ZcCUTY/ufWCqhotKg==
x-ms-exchange-transport-forked: True
Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="SHA1"; boundary="----=_NextPart_000_0064_01D5F923.CD236C40"
MIME-Version: 1.0
X-OriginatorOrg: ericsson.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 84d276fc-a4be-46d7-cea7-08d7c7328eba
X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Mar 2020 09:40:25.2634 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: l7yWvL2zthHWsSe1uKaY8xsHcA+xAOujgC7/oqBef0wiOMpwL4i9k3wGup3eg1yFlcAk0pJA+sK8S3WyCn3sQUOVtlNrz8VjSQUaE6JRnRc=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR07MB3993
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/JwH5aYNDUESqLldif-QCs9SBYCI>
Subject: Re: [yang-doctors] [netconf] Require-instance problem [was: RE: 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:40:30 -0000

Hello Michal,
While the Require-instance issue may or may not be a problem, it is not caused by my netconf-notification-capabilities draft. I hope we agree on this.

About the require-instance problem:
Not mentioning derived types for require-instance in 9.9.3 can be intentional or an omission. If I just strictly read the text:
> The "require-instance" statement, which is a substatement to the
>    "type" statement, MAY be present if the type is "instance-identifier"
>    or "leafref".
This says that the require-instance is allowed under type; full stop. Intentions about the pattern of the text are speculation. The text says it MAY be there. So unless an errata is filed, it is allowed. IMHO if that is the intention we would need an explicit sentence like:
"Usage of require-instance is not allowed for derived types."
I don't have a strict view on which was the intention (maybe Martin has) but the text is unambiguous to me.
Regards Balazs

-----Original Message-----
From: Michal Vaško <mvasko@cesnet.cz> 
Sent: 2020. március 13., péntek 10:04
To: Balázs Lengyel <balazs.lengyel@ericsson.com>
Cc: Mahesh Jethanandani <mjethanandani@gmail.com>; netconf@ietf.org; yang-doctors@ietf.org
Subject: Re: [netconf] Require-instance problem [was: RE: WGLC: draft-ietf-netconf-notification-capabilities-11]

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:
> 
> https://protect2.fireeye.com/v1/url?k=6cc7e6c7-3013efa1-6cc7a65c-8610d8a762ca-0a278d65531d4f4f&q=1&e=b7200729-5cfb-4d52-b459-737457b266e0&u=http%3A%2F%2Fwww.yangvalidator.com%2Fyangvalidator%2Fvalidator
> 
> 
> 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> 
> 
>  
> 
>  
> 
>  
>