[YANGTOOLS-1064] Restconf / SAXParseException errors on XML payload with nested <config>...</config> statements Created: 09/Jan/20  Updated: 10/Jan/20  Resolved: 10/Jan/20

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: High
Reporter: Jeff Hartley Assignee: Balaji Varadaraju
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 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



 Comments   
Comment by Balaji Varadaraju [ 09/Jan/20 ]

rovarga Is the following fix addresses the same issue?

https://jira.opendaylight.org/browse/YANGTOOLS-1002

 

https://git.opendaylight.org/gerrit/q/yangtools-1002

 

Comment by Balaji Varadaraju [ 10/Jan/20 ]

I think we need to pick this fix for this
https://git.opendaylight.org/gerrit/c/yangtools/+/78479
 

Comment by Balaji Varadaraju [ 10/Jan/20 ]

As suspected  https://git.opendaylight.org/gerrit/c/yangtools/+/78479 fixes this issue. This can be closed.

Comment by Daniel De La Rosa [ 10/Jan/20 ]

bvaradar confirmed that this has been fixed already

Generated at Wed Feb 07 20:55:05 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.