Re: [netconf] RFC6241: "xs:QName" text values in <nc:rpc-error> instances
Jernej Tuljak <jernej.tuljak@mg-soft.si> Fri, 02 June 2023 06:10 UTC
Return-Path: <jernej.tuljak@mg-soft.si>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DF1DEC151990 for <netconf@ietfa.amsl.com>; Thu, 1 Jun 2023 23:10:36 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.095
X-Spam-Level:
X-Spam-Status: No, score=-2.095 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, HTML_MESSAGE=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=mg-soft.si
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pF8echmo5bHB for <netconf@ietfa.amsl.com>; Thu, 1 Jun 2023 23:10:32 -0700 (PDT)
Received: from galileo.mg-soft.si (gate.mg-soft.si [212.30.73.66]) by ietfa.amsl.com (Postfix) with ESMTP id E0EEEC15152E for <netconf@ietf.org>; Thu, 1 Jun 2023 23:10:30 -0700 (PDT)
Received: from [10.0.0.222] (tp-x61t.mg-soft.si [10.0.0.222]) by galileo.mg-soft.si (Postfix) with ESMTP id 9F673C41D787; Fri, 2 Jun 2023 08:10:29 +0200 (CEST)
DKIM-Filter: OpenDKIM Filter v2.11.0 galileo.mg-soft.si 9F673C41D787
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mg-soft.si; s=default; t=1685686229; bh=nfp31fOozSwX3vrYj8DAwNcpLcmVIC29O4N4bKjH0Hc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=OwGDMQRTXL07qj8lvTo7oKNte2yO+HS1I1lgbxTAq9ylnzC4RDskeEdt4UFdXYEcf V4AC+6kk8sNFJ4BomhfUCgKBWBA+yO0Jg+j3uMcWMnBbZdrtcV5bXq+6u+5qYSjGYK p0qIvj5tPh4N8j4lKC8NBKBgXySgzC+eJF3Lh6QggzxhDoOqpjX/Nj2CPmIHJKg1nx n8N67dchEnCZuKySD7MCcef1SHalx+6VCeypYqHNI0Rxqe+0KzJwtuHoDqS4LKS/nW 92IXwQzTH3UOlb5wbNJe+C2ZBHtESXCz221fj/EODaaW4uHO4QVF+nZ3Uz9B7dfKtw xpbRQzDoCxohg==
Content-Type: multipart/alternative; boundary="------------DuiTA30eJgdzb0cj64WN0hh7"
Message-ID: <ba0df693-5d2c-b1a7-989e-b9827cf2515c@mg-soft.si>
Date: Fri, 02 Jun 2023 08:10:28 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
To: Andy Bierman <andy@yumaworks.com>
Cc: Netconf <netconf@ietf.org>
References: <59252a86-3889-16e8-5542-e12790958b94@mg-soft.si> <CABCOCHReETyPw2KZmcBPoLJT1PYCgoFftBs6+Vr9hF8ND-YjNw@mail.gmail.com>
Content-Language: en-US
From: Jernej Tuljak <jernej.tuljak@mg-soft.si>
In-Reply-To: <CABCOCHReETyPw2KZmcBPoLJT1PYCgoFftBs6+Vr9hF8ND-YjNw@mail.gmail.com>
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/NeWgXqtcsCEqaUr4WDuLXxcgZu8>
Subject: Re: [netconf] RFC6241: "xs:QName" text values in <nc:rpc-error> instances
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: NETCONF WG list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 02 Jun 2023 06:10:37 -0000
On 01/06/2023 21:10, Andy Bierman wrote: > > > On Thu, Jun 1, 2023 at 2:13 AM Jernej Tuljak > <jernej.tuljak@mg-soft.si> wrote: > > Hi, > > RFC 6241 contains the following example in section 4.3. > > Example: An error is returned if an <rpc> element is received > without a "message-id" attribute. Note that only in this > case is > it acceptable for the NETCONF peer to omit the "message-id" > attribute in the <rpc-reply> element. > > <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> > <get-config> > <source> > <running/> > </source> > </get-config> > </rpc> > > <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> > <rpc-error> > <error-type>rpc</error-type> > <error-tag>missing-attribute</error-tag> > <error-severity>error</error-severity> > <error-info> > <bad-attribute>message-id</bad-attribute> > <bad-element>rpc</bad-element> > </error-info> > </rpc-error> > </rpc-reply> > > I think this <rpc-reply> is semantically incorrect. It should be > corrected to: > > <nc:rpc-reply > xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> > <nc:rpc-error> > <nc:error-type>rpc</nc:error-type> > <nc:error-tag>missing-attribute</nc:error-tag> > <nc:error-severity>error</nc:error-severity> > <nc:error-info> > <nc:bad-attribute>message-id</nc:bad-attribute> > <nc:bad-element>nc:rpc</nc:bad-element> > </nc:error-info> > </nc:rpc-error> > </nc:rpc-reply> > > > > You should file an Errata. > > OLD: > > <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> > <rpc-error> > <error-type>rpc</error-type> > <error-tag>missing-attribute</error-tag> > <error-severity>error</error-severity> > <error-info> > <bad-attribute>message-id</bad-attribute> > <bad-element>rpc</bad-element> > </error-info> > </rpc-error> > </rpc-reply> > NEW: > <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> > <rpc-error> > <error-type>rpc</error-type> > <error-tag>missing-attribute</error-tag> > <error-severity>error</error-severity> > <error-info> > <bad-attribute > xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">nc:message-id</bad-attribute> > <bad-element > xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">nc:rpc</bad-element> > </error-info> > </rpc-error> > </rpc-reply> The NETCONF "message-id" attribute does not belong to any namespace (it is in the null namespace when it appears in <rpc> and <rpc-reply>) - XML attributes do not inherit the default namespace like XML elements do. Your NEW proposal could actually be semantically equivalent to OLD. > Andy > > NETCONF messages layer is modeled with XML Schema 1.1 (XSD 1.1) in > Appendix B. > > While the <rpc-reply> in the original example is valid according > to XML > 1.1 Schema in Appendix B, it does not seem to be consistent with > requirements described in Appendix A. The text value of XML elements > <bad-attribute> and <bad-element> should be a valid "xs:QName" that > references a known attribute or element by its name ({namepace-name, > local-part} tuple, not a string literal). Since the "message-id" > attribute and "rpc" element do not belong to the same namespace in an > <rpc> message, one of the text values in the original <rpc-reply> > cannot > be semantically correct. > > It is also unclear which namespace unprefixed text values of XSD 1.1 > modeled data map to (and RFC 6241 says nothing about this), so my > correction above is intentionally verbose in order to eliminate the > default namespace. Note that the intention of the authors of XSD 1.1 > specification seems to be that such values are _always_ mapped to the > null namespace, unlike in some other XML schema languages, where the > default namespace would be used instead (if it exists), which would > imply that only the value of <bad-element> in the original > <rpc-reply> > is problematic. The following could also be semantically correct: > > <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" > xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> > <rpc-error> > <error-type>rpc</error-type> > <error-tag>missing-attribute</error-tag> > <error-severity>error</error-severity> > <error-info> > <bad-attribute>message-id</bad-attribute> > <bad-element>nc:rpc</bad-element> > </error-info> > </rpc-error> > </rpc-reply> > > However, XSD 1.1 specification does not seem to explicitly confirm > this > anywhere. > XSD 1.1 namespace resolving of unprefixed text values of type "xs:QName" probably works like it does in YANG modeled data. Not sure why some sources say this is not so. There's this in their spec [1]: "The host language, whether XML-based or otherwise, may specify whether unqualified names are bound to the default namespace (if any) or not; the host language may also place this under user control. If the host language does not specify otherwise, unqualified names are bound to the default namespace." That would mean that eliminating the default namespace in effect on <bad-attribute> is the only way solve this. I intend to file an errata, but here's what I'd file (if there's agreement): OLD: <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <rpc-error> <error-type>rpc</error-type> <error-tag>missing-attribute</error-tag> <error-severity>error</error-severity> <error-info> <bad-attribute>message-id</bad-attribute> <bad-element>rpc</bad-element> </error-info> </rpc-error> </rpc-reply> NEW: <nc:rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <nc:rpc-error> <nc:error-type>rpc</nc:error-type> <nc:error-tag>missing-attribute</nc:error-tag> <nc:error-severity>error</nc:error-severity> <nc:error-info> <nc:bad-attribute>message-id</nc:bad-attribute> <nc:bad-element>nc:rpc</nc:bad-element> </nc:error-info> </nc:rpc-error> </nc:rpc-reply> BTW, there's no normative reference to XSD 1.1 in RFC 6241. Jernej [1] - https://www.w3.org/TR/xmlschema11-2/#QName > > Can someone please clarify what the intention of RFC 6241 was here? > Specifically, why was XSD 1.1 "xs:QName" chosen as the data type for > such XML elements in Appendix B, and what does "name" in Appendix A > refer to? > > Jernej > > _______________________________________________ > netconf mailing list > netconf@ietf.org > https://www.ietf.org/mailman/listinfo/netconf >
- [netconf] RFC6241: "xs:QName" text values in <nc:… Jernej Tuljak
- Re: [netconf] RFC6241: "xs:QName" text values in … Andy Bierman
- Re: [netconf] RFC6241: "xs:QName" text values in … Jernej Tuljak