[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Issue 12.6: <rpc-error>



Hi,

Here is some proposed text on <rpc-error> and a list of
NETCONF standard errors.  I would like the WG to refine
and complete the <rpc-error> details ASAP, so the
protocol document can be completed.

thanks,
Andy
<rpc-error>
  <error-type>
  <error-tag>
  <error-severity>
  [<error-app-tag>]
  [<error-path>]
  [<error-message>]
  [<error-info>]
</rpc-error>

   o  error-type: Defines the conceptual layer that the error occurred.
      Enumeration -- one of:
         - transport
         - rpc
         - protocol
         - application

   o  error-tag: String identifying the error condition.
      Enumeration: see list below for allowed values

   o  error-severity: String identifying the error severity, 
      as determined by the device. 
      Enumeration -- one of:
          - error
          - warning

   o  error-app-tag: String identifying the data model
      specific or vendor specific error condition, if 
      one exists.  This element will not be present if no 
      appropriate application error tag can be associated 
      with a particular error condition.

   o  error-path: Absolute Xpath expression identifying the element
      path to the node which is associated with the error being
      reported in a particular rpc-error element.
      This element will not be present if no appropriate payload
      element can be associated with a particular error condition,
      or if the 'bad-element' QString returned in the 'error-info'
      container is sufficient to identify the node associated with
      the error.

   o  error-message: String describing the error condition.  This
      element will not be present if no appropriate message
      is provided for a particular error condition.

   o  error-info: container for protocol or data model specific 
      error content.  This element will not be present if no 
      such error content is provided for a particular error condition.
      The list below defines any mandatory error-info content
      for each error.  After any protocol-mandated content,
      a data model definition may mandate certain application layer
      error information be included in the error-info container.
      Finally, a vendor may which to include additional elements
      at the end of the sequence to provide extended and/or 
      implementation-specific debugging information.

------------------------------------------------------------------

XSD fragment:

  <xsd:simpleType name="NetconfSessionId" type="xsd:unsignedInt"/>

  <xsd:simpleType name="NetconfErrorType">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="transport"/>
      <xsd:enumeration value="rpc"/>
      <xsd:enumeration value="protocol"/>
      <xsd:enumeration value="application"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="NetconfErrorTag">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="TOO_BIG"/>
      <xsd:enumeration value="MISSING_ATTRIBUTE"/>
      <xsd:enumeration value="BAD_ATTRIBUTE"/>
      <xsd:enumeration value="UNKNOWN_ATTRIBUTE"/>
      <xsd:enumeration value="MISSING_ELEMENT"/>
      <xsd:enumeration value="BAD_ELEMENT"/>
      <xsd:enumeration value="UNKNOWN_ELEMENT"/>
      <xsd:enumeration value="ACCESS_DENIED"/>
      <xsd:enumeration value="LOCK_DENIED"/>
      <xsd:enumeration value="RESOURCE_DENIED"/>
      <xsd:enumeration value="ROLLBACK_FAILED"/>
      <xsd:enumeration value="DATA_EXISTS"/>
      <xsd:enumeration value="DATA_MISSING"/>
      <xsd:enumeration value="OPERATION_NOT_SUPPORTED"/>
      <xsd:enumeration value="OPERATION_FAILED"/>
      <xsd:enumeration value="PARTIAL_OPERATION"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="NetconfErrorSeverity">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="error"/>
      <xsd:enumeration value="warning"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:complexType name="rpc-errorType"
      minOccurs="0" maxOccurs="unbounded">
    <xsd:sequence>
      <xsd:element name="error-type" type="NetconfErrorType"/>
      <xsd:element name="error-tag" type="NetconfErrorTag"/>
      <xsd:element name="error-severity" type="NetconfErrorSeverity"/>
      <xsd:element name="error-app-tag" type="xsd:string" minOccurs="0"/>
      <xsd:element name="error-path" type="xsd:string" minOccurs="0"/>
      <xsd:element name="error-message" type="xsd:string" minOccurs="0"/>
      <xsd:element name="error-info" type="xsd:any" minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>

  <!-- Standard elements used in the error-info container  -->

  <xsd:element name="bad-attribute" type="xsd:QName"
      minOccurs="0" maxOccurs="1"/>

  <xsd:element name="bad-element" type="xsd:QName"
      minOccurs="0" maxOccurs="1"/>

  <xsd:element name="ok-element" type="xsd:QName"
      minOccurs="0" maxOccurs="unbounded"/>

  <xsd:element name="err-element" type="xsd:QName"
      minOccurs="0" maxOccurs="unbounded"/>

  <xsd:element name="noop-element" type="xsd:QName"
      minOccurs="0" maxOccurs="unbounded"/>

  <xsd:element name="locked-by" type="NetconfSessionId"
      minOccurs="0" maxOccurs="1"/>

--------------------------------------------------------------------------
Error list:

Tag:         TOO_BIG
Error-type:  transport, rpc, protocol, application
Severity:    error
Error-info:  none
Description: The request or response (that would be generated) is too 
             large for the implementation to handle.

Tag:         MISSING_ATTRIBUTE
Error-type:  rpc, protocol, application
Severity:    error
Error-info:  <bad-attribute> : name of the missing attribute
             <bad-element> : name of the element that should
             contain the missing attribute
Description: An expected attribute is missing

Tag:         BAD_ATTRIBUTE
Error-type:  rpc, protocol, application
Severity:    error
Error-info:  <bad-attribute> : name of the attribute w/ bad value
             <bad-element> : name of the element that contains
             the attribute with the bad value
Description: An attribute value is not correct; e.g., wrong type,
             out of range, pattern mismatch

Tag:         UNKNOWN_ATTRIBUTE
Error-type:  rpc, protocol, application
Severity:    error
Error-info:  <bad-attribute> : name of the unexpected attribute
             <bad-element> : name of the element that contains
             the unexpected attribute
Description: An unexpected attribute is present

Tag:         MISSING_ELEMENT
Error-type:  rpc, protocol, application
Severity:    error
Error-info:  <bad-element> : name of the missing element
Description: An expected element is missing

Tag:         BAD_ELEMENT
Error-type:  rpc, protocol, application
Severity:    error
Error-info:  <bad-element> : name of the element w/ bad value
Description: An element value is not correct; e.g., wrong type,
             out of range, pattern mismatch

Tag:         UNKNOWN_ELEMENT
Error-type:  rpc, protocol, application
Severity:    error
Error-info:  <bad-element> : name of the unexpected element
Description: An unexpected element is present

Tag:         ACCESS_DENIED
Error-type:  rpc, protocol, application
Severity:    error
Error-info:  none
Description: Access to the requested RPC, protocol operation,
             or application data model is denied because
             authorization failed

Tag:         LOCK_DENIED
Error-type:  protocol
Severity:    error
Error-info:  <locked-by> : session ID of session holding the
             requested lock, or zero to indicate a non-NETCONF
             entity holds the lock
Description: Access to the requested lock is denied because the
             lock is currently held by another entity

Tag:         RESOURCE_DENIED
Error-type:  transport, rpc, protocol, application
Severity:    error
Error-info:  none
Description: Request could not be completed because of insufficient
             resources

Tag:         ROLLBACK_FAILED
Error-type:  protocol, application
Severity:    error
Error-info:  none
Description: Request to rollback some configuration change (via 
             rollback-on-error or discard-changes operations) was
             not completed for some reason. 

Tag:         DATA_EXISTS
Error-type:  application
Severity:    error
Error-info:  none
Description: Request could not be completed because the relevant
             data model content already exists. For example, 
             a 'create' operation was attempted on data which
             already exists.

Tag:         DATA_MISSING
Error-type:  application
Severity:    error
Error-info:  none
Description: Request could not be completed because the relevant
             data model content does not exist.  For example,
             a 'modify' or 'delete' operation was attempted on 
             data which does not exist.
             
Tag:         OPERATION_NOT_SUPPORTED
Error-type:  rpc, protocol, application
Severity:    error
Error-info:  none
Description: Request could not be completed because the requested
             operation is not supported by this implementation.

Tag:         OPERATION_FAILED
Error-type:  rpc, protocol, application
Severity:    error
Error-info:  none
Description: Request could not be completed because the requested
             operation failed for some reason not covered by 
             any other error condition.


Tag:         PARTIAL_OPERATION
Error-type:  application
Severity:    error
Error-info:  <ok-element> : identifies an element in the data model
             for which the requested operation has been completed
             for that node and all its child nodes.  This element
             can appear zero or more times in the <error-info>
             container.

             <err-element> : identifies an element in the data model
             for which the requested operation has failed for that 
             node and all its child nodes. This element
             can appear zero or more times in the <error-info>
             container.

             <noop-element> : identifies an element in the data model
             for which the requested operation was not attempted for 
             that node and all its child nodes. This element
             can appear zero or more times in the <error-info>
             container.

Description: Some part of the requested operation failed or was
             not attempted for some reason.  Full cleanup has 
             not been performed (e.g., rollback not supported)
             by the agent.  The error-info container is used
             to identify which portions of the application
             data model content for which the requested operation 
             has succeeded (<ok-element>), failed (<bad-elmenet>),
             or not attempted (<noop-element>).


-----------------------------------------------------------------------

Examples:

Missing message-id attribute:

  <rpc xmlns="http://ietf.org/netconf/base/1.0";>
    <get-config>
      <source><running/></source>
    </get-config>
    <config/>
  </rpc>

  <rpc-reply xmlns="http://ietf.org/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>

--------------

The 'source' param is really 'src' in get-config command:

  <rpc message-id="103" xmlns="http://ietf.org/netconf/base/1.0";>
    <get-config>
      <src><running/></src>
    </get-config>
    <config/>
  </rpc>

  <rpc-reply message-id="103" xmlns="http://ietf.org/netconf/base/1.0";>
    <rpc-error>
      <error-type>protocol</error-type>
      <error-tag>UNKNOWN_ELEMENT</error-tag>
      <error-severity>error</error-severity>
      <error-info>
        <bad-element>src</bad-element>
      </error-info>
    </rpc-error>
    <rpc-error>
      <error-type>protocol</error-type>
      <error-tag>MISSING_ELEMENT</error-tag>
      <error-severity>error</error-severity>
      <error-info>
        <bad-element>source</bad-element>
      </error-info>
    </rpc-error>
  </rpc-reply>

--------------

The edit-config command was partially completed.

  <rpc message-id="104" xmlns="http://ietf.org/netconf/base/1.0";>
    <edit-config>
      <source><running/></source>
      <test-option>set</test-option>
      <error-option>stop-on-error</test-option>
      <error-option>stop-on-error</test-option>
    </get-config>
    <config xmlns:t="http://example.com/xsd.1.1";>
      <t:foo>4</t:foo>
      <t:goo>2003-05-15</t:goo>
      <t:boo>false</t:boo>
      <t:woo>75</t:woo>
    </config>
  </rpc>

  <rpc-reply message-id="104" xmlns="http://ietf.org/netconf/base/1.0";>
    <rpc-error>
      <error-type>application</error-type>
      <error-tag>BAD_ELEMENT</error-tag>
      <error-severity>error</error-severity>
      <error-app-tag>GOO_TIME_ALREADY_PAST</error-app-tag>
      <error-path>/goo</error-path>
      <error-message>
        Invalid parameter: The time specified has already past.
      </error-message>
      <error-info>
        <bad-element>t:goo</bad-element>
      </error-info>
    </rpc-error>
    <rpc-error>
      <error-type>application</error-type>
      <error-tag>PARTIAL_OPERATION</error-tag>
      <error-severity>error</error-severity>
      <error-info xmlns:t="http://example.com/xsd.1.1";>
        <ok-element>t:foo</ok-element>
        <err-element>t:goo</err-element>
        <noop-element>t:boo</noop-element>
        <noop-element>t:woo</noop-element>
      </error-info>
    </rpc-error>
  </rpc-reply>

--------------------------

The edit-config operation fails because the 'mtu' parameter
is outside the valid range defined in the data model XSD.

  <rpc message-id="102" xmlns="http://ietf.org/netconf/base/1.0";>
    <edit-config>
      <source><running/></source>
      <test-option>test-then-set</test-option>
      <error-option>stop-on-error</error-option>
      <config>
        <interfaces xmlns="http://example.com/xsd/itf.1";>
          <interface>
             <name>Ethernet/1</name>
             <mtu>21050</mtu>
          </interface>
        </interfaces>
      </config>
    </edit-config>
  </rpc>

  <rpc-reply message-id="102" xmlns="http://ietf.org/netconf/base/1.0";>
    <rpc-error>
      <error-type>application</error-type>
      <error-tag>BAD_ELEMENT</error-tag>
      <error-severity>error</error-severity>
      <error-app-tag>ETHIF_MTU_RANGE_ERROR</error-app-tag>
      <error-path>
         /interfaces/interface[name='Ethernet/1']/mtu
      </error-path>
      <error-message>
         MTU 21050 on Ethernet/1 is outside range 256..9192
      </error-message>
      <error-info xmlns:t="http://example.com/xsd/itf.1";>
        <bad-element>t:mtu</bad-element>
      </error-info>
    </rpc-error>
  </rpc-reply>