Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-1064

Restconf / SAXParseException errors on XML payload with nested <config>...</config> statements

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • High
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      The error in question is this:
      XmlNormalizedNodeBodyReader | 362 - org.opendaylight.netconf.restconf-nb-bierman02 - 1.8.1 | - | Error parsing xml input
      org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.

      ...which appears in Fluorine-SR1 (2.0.12), but not Fluorine-SR3 (2.0.20), and not Nitrogen-SR3 (...older).

      It applies to XML payloads submitted via restconf where there are multiple "nested" <config> .. </config> sections.

      Example POST that triggers the parsing error:
      POST http://controller:8181/restconf/operations/network-topology:network-topology/topology/topology-netconf/node/node/yang-ext:mount/ietf-netconf:edit-config

      <?xml version="1.0" encoding="UTF-8"?>
      <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
      <target>
      <running />
      </target>
      <default-operation>merge</default-operation>
      <config>
      <lldp xmlns="http://openconfig.net/yang/lldp">
      <interfaces>
      <interface>
      <name>Ethernet1</name>
      <config>
      <enabled>false</enabled>
      </config>
      </interface>
      </interfaces>
      </lldp>
      <interfaces xmlns="http://openconfig.net/yang/interfaces">
      <interface>
      <name>Ethernet1</name>
      <config>
      <description>test1</description>
      <name>Ethernet1</name>
      <enabled>true</enabled>
      <tpid xmlns="http://openconfig.net/yang/vlan">TPID_0X88A8</tpid>
      </config>
      <ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet">
      <config>
      <port-speed>SPEED_1GB</port-speed>
      <duplex-mode>FULL</duplex-mode>
      <auto-negotiate>true</auto-negotiate>
      </config>
      <switched-vlan xmlns="http://openconfig.net/yang/vlan">
      <config>
      <interface-mode>TRUNK</interface-mode>
      <trunk-vlans nc:operation="replace" />
      </config>
      <vlan-translation xmlns="http://arista.com/yang/vlan-translation">
      <config>
      <ingress-mapping-required>true</ingress-mapping-required>
      </config>
      </vlan-translation>
      </switched-vlan>
      </ethernet>
      </interface>
      </interfaces>
      <arista xmlns="http://arista.com/yang/experimental/eos">
      <eos>
      <qos xmlns="http://arista.com/yang/experimental/eos/qos">
      <acl xmlns="http://arista.com/yang/experimental/eos/qos/acl">
      <input>
      <cli>
      <pmapType>
      <type>mapQos</type>
      <pmap>
      <name>test1</name>
      </pmap>
      </pmapType>
      </cli>
      </input>
      </acl>
      <input xmlns="http://arista.com/yang/experimental/eos/qos/config">
      <config>
      <cli>
      <servicePolicyConfig>
      <key-direction>input</key-direction>
      <key-pmapName>test1</key-pmapName>
      <key-type>mapQos</key-type>
      <intfIds>
      <index>Ethernet1</index>
      <value>true</value>
      </intfIds>
      </servicePolicyConfig>
      </cli>
      </config>
      </input>
      </qos>
      </eos>
      </arista>
      </config>
      </rpc>

      Our folks noticed that this looks like something we could cherry-pick as a good match; looking for feedback here:
      https://jira.opendaylight.org/projects/YANGTOOLS/issues/YANGTOOLS-1002

      [Curious: Affects-Versions in this JIRA form doesn't list yangtools 2.0.12 as a valid match; fyi]

      Thanks;
      -Jeff

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bvaradar Balaji Varadaraju
            malloc_failed Jeff Hartley
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: