[NETCONF-1239] Exception on building get-config list filter with fields Created: 29/Jan/24  Updated: 30/Jan/24  Resolved: 30/Jan/24

Status: Resolved
Project: netconf
Component/s: netconf, netconf-client-mdsal
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: Ruslan Kashapov Assignee: Ivan Hrasko
Resolution: Won't Do Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
blocks NETCONF-1177 PUT requests failing with "insert" qu... Confirmed

 Description   

In order to extract list items with a specific set of fields the empty field elements expected to be set under list item node as explained in https://www.rfc-editor.org/rfc/rfc6241#section-6.4.4 

On attempt building such filter the exception like below is thrown

java.io.IOException: Child identifier (urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?revision=2010-10-04)identifier is invalid in parent (urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?revision=2010-10-04)schema
    at org.opendaylight.netconf.common.mdsal.StreamingContext$AbstractMapMixin.emitChildTreeNode(StreamingContext.java:252)
    at org.opendaylight.netconf.common.mdsal.StreamingContext$AbstractComposite.streamToWriter(StreamingContext.java:167)
    at org.opendaylight.netconf.common.mdsal.StreamingContext$AbstractComposite.emitChildTreeNode(StreamingContext.java:174)
    at org.opendaylight.netconf.common.mdsal.StreamingContext$AbstractComposite.streamToWriter(StreamingContext.java:167)
    at org.opendaylight.netconf.common.mdsal.StreamingContext$AbstractComposite.emitChildTreeNode(StreamingContext.java:174)
    at org.opendaylight.netconf.common.mdsal.StreamingContext$AbstractComposite.streamToWriter(StreamingContext.java:167)
    at org.opendaylight.netconf.common.mdsal.NormalizedDataUtil.writeFilter(NormalizedDataUtil.java:285)

Test case: https://git.opendaylight.org/gerrit/c/netconf/+/110078/1



 Comments   
Comment by Ivan Hrasko [ 30/Jan/24 ]

The patch compilation is failing.

Comment by Ivan Hrasko [ 30/Jan/24 ]

On current main branch (081fb37b7), we can successfully invoke a request to netconf testtool via restconf:

http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=17830-sim-device/yang-ext:mount/toaster:toaster?fields=toasterStatus;darknessFactor 

Which send to the device:

<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-15">
    <get>
        <filter type="subtree">
            <toaster xmlns="http://netconfcentral.org/ns/toaster">
                <toasterStatus/>
                <darknessFactor/>
            </toaster>
        </filter>
    </get>
</rpc>

And everything is processed fine and we get what is expected:

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-15">
    <data>
        <toaster xmlns="http://netconfcentral.org/ns/toaster" xmlns:op="urn:ietf:params:xml:ns:netconf:base:1.0" op:operation="replace">
            <toasterStatus>up</toasterStatus>
            <darknessFactor>1000</darknessFactor>
        </toaster>
    </data>
</rpc-reply>
Comment by Ruslan Kashapov [ 30/Jan/24 ]

the issue addresses list node, not container one
toaster model contains no lists
restconf example using yang library model would be 

http://localhost:8181/rests/data/ietf-yang-library:yang-library/schema?fields=name

which throws error immediately because:
1. api does not support list nodes without predicate
2. (when 1 is fixed) filer cannot be built because of current issue

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