Subject: [Netconf] Mixing <rpc-error> and "rpcResponses" in NETCONF replies

From: "Jernej Tuljak" <[email-masked]>
Date: Wed, 28 Sep 2016 13:41:09 +0200

Hi,

is a RFC6241 compliant NETCONF server allowed to return a response like this for standard operations (get, get-config)?

<?xml version="1.0" encoding="utf-8"?>

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">

  <data/>

  <rpc-error>

    <error-type>application</error-type>

    <error-tag>operation-failed</error-tag>

    <error-severity>error</error-severity>

    <error-message>Unknown error occured.</error-message>

  </rpc-error>

</rpc-reply>

That is, mixing a Positive Response and Negative Response? For the sake of argument, consider the <rpc-error> above as one of the standard ones from Appendix A [1] (and <data/> may not actually be empty). 

It is clear from Appendix B [2] that <rpc-error> and "rpcResponse" (<data/> above) may appear as siblings in sequence. But is mixing supported by RFC text below?

7.1 <get-config> [3]

   Positive Response:  If the device can satisfy the request, the server
      sends an <rpc-reply> element containing a <data> element with the
      results of the query.
 
   Negative Response:  An <rpc-error> element is included in the
      <rpc-reply> if the request cannot be completed for any reason.

7.7 <get> [4]

   Positive Response:  If the device was able to satisfy the request, an
      <rpc-reply> is sent.  The <data> section contains the appropriate
      subset.
 
   Negative Response:  An <rpc-error> element is included in the
      <rpc-reply> if the request cannot be completed for any reason.

Also, is there a reason for different wording of Positive Response text for these two operations?

Another related question is, if a client receives a warning severity <rpc-error> to a query that normally returns an <ok/>, should it consider the query a success or failure? In other words, why are <ok/> and <rpc-error> mutually exclusive – can an operation not succeed with warnings? It would appear that only operations that return something other than <ok/> may express such behavior.

[1] - https://tools.ietf.org/html/rfc6241#appendix-A

[2] - https://tools.ietf.org/html/rfc6241#appendix-B

[3] - https://tools.ietf.org/html/rfc6241#section-7.1

[4] - https://tools.ietf.org/html/rfc6241#section-7.7

Jernej