<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:15:59 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[NETCONF-820] Fail to process RESTCONF fields on the mounted device</title>
                <link>https://jira.opendaylight.org/browse/NETCONF-820</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;p&gt;RESCONF get&#160;call to retrieve a subset of tree on a mounted device using the fields parameter fails when it includes a list path.&lt;/p&gt;

&lt;p&gt;For example, the following error was thrown when&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;GET /rests/data/network-topology:network-topology/topology=topology-netconf/node=SJ-E9-221/yang-ext:mount/ietf-interfaces:interfaces?fields=interface/type
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;where &lt;tt&gt;interface&lt;/tt&gt; is a list.&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;04:54:24.938 ERROR [opendaylight-cluster-data-akka.actor.default-dispatcher-13] class org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier$NodeIdentifier cannot be cast to class org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier$NodeIdentifierWithPredicates (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier$NodeIdentifier and org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier$NodeIdentifierWithPredicates are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @43ad1bfd)
java.lang.ClassCastException: class org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier$NodeIdentifier cannot be cast to class org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier$NodeIdentifierWithPredicates (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier$NodeIdentifier and org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier$NodeIdentifierWithPredicates are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @43ad1bfd)
	at org.opendaylight.netconf.util.StreamingContext$AbstractMapMixin.emitChildTreeNode(StreamingContext.java:268) ~[bundleFile:?]
	at org.opendaylight.netconf.util.StreamingContext$AbstractComposite.streamToWriter(StreamingContext.java:181) ~[bundleFile:?]
	at org.opendaylight.netconf.util.StreamingContext$AbstractComposite.emitChildTreeNode(StreamingContext.java:188) ~[bundleFile:?]
	at org.opendaylight.netconf.util.StreamingContext$AbstractComposite.streamToWriter(StreamingContext.java:181) ~[bundleFile:?]
	at org.opendaylight.netconf.util.NetconfUtil.writeFilter(NetconfUtil.java:254) ~[bundleFile:?]
	at org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.toFilterStructure(NetconfMessageTransformUtil.java:261) ~[bundleFile:?]
	at org.opendaylight.netconf.sal.connect.netconf.util.NetconfRpcStructureTransformer.toFilterStructure(NetconfRpcStructureTransformer.java:77) ~[bundleFile:?]
	at org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps.get(NetconfBaseOps.java:351) ~[bundleFile:?]
	at org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps.getData(NetconfBaseOps.java:302) ~[bundleFile:?]
	at org.opendaylight.netconf.sal.connect.netconf.sal.AbstractNetconfDataTreeService.get(AbstractNetconfDataTreeService.java:265) ~[bundleFile:?]
	at org.opendaylight.netconf.topology.singleton.impl.actors.NetconfDataTreeServiceActor.onReceive(NetconfDataTreeServiceActor.java:70) ~[?:?]
	at akka.actor.UntypedAbstractActor$$anonfun$receive$1.applyOrElse(AbstractActor.scala:332) ~[bundleFile:?]
	at akka.actor.Actor.aroundReceive(Actor.scala:537) ~[bundleFile:?]
	at akka.actor.Actor.aroundReceive$(Actor.scala:535) ~[bundleFile:?]
	at akka.actor.AbstractActor.aroundReceive(AbstractActor.scala:220) ~[bundleFile:?]
	at akka.actor.ActorCell.receiveMessage(ActorCell.scala:577) [bundleFile:?]
	at akka.actor.ActorCell.invoke(ActorCell.scala:547) [bundleFile:?]
	at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:270) [bundleFile:?]
	at akka.dispatch.Mailbox.run(Mailbox.scala:231) [bundleFile:?]
	at akka.dispatch.Mailbox.exec(Mailbox.scala:243) [bundleFile:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) [?:?]
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) [?:?]
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) [?:?]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) [?:?]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) [?:?]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="34450">NETCONF-820</key>
            <summary>Fail to process RESTCONF fields on the mounted device</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.opendaylight.org/images/icons/priorities/major.svg">Medium</priority>
                        <status id="5" iconUrl="https://jira.opendaylight.org/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="ppuskar">Peter Pu&#353;k&#225;r</assignee>
                                    <reporter username="sangwookha">Sangwook Ha</reporter>
                        <labels>
                    </labels>
                <created>Wed, 15 Sep 2021 04:59:06 +0000</created>
                <updated>Sun, 6 Nov 2022 19:51:16 +0000</updated>
                            <resolved>Sun, 6 Nov 2022 19:51:16 +0000</resolved>
                                                    <fixVersion>4.0.3</fixVersion>
                                    <component>netconf</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="69800" author="rovarga" created="Fri, 22 Oct 2021 16:04:41 +0000"  >&lt;p&gt;I suspect the problem does not lie with netconf-util&apos;s handling of filters, but rather with restconf-nb-rfc8040&apos;s parser which creates the structure. This is a nightmare to follow, but bear with me.&lt;/p&gt;

&lt;p&gt;The first bit is here: &lt;a href=&quot;https://github.com/opendaylight/netconf/blob/master/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/utils/ReadDataTransactionUtil.java#L166-L170:&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/opendaylight/netconf/blob/master/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/utils/ReadDataTransactionUtil.java#L166-L170:&lt;/a&gt;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (identifier.getMountPoint() != &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
                builder.setFieldPaths(parseFieldsPaths(identifier, fields.get(0)));
            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                builder.setFields(parseFieldsParameter(identifier, fields.get(0)));
            }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So we are doing different things for mount points (parseFieldsPaths()) and local datastore (parseFieldsParameter()). Let&apos;s focus on the former, as the latter is absolutely unimplemented. This (eventually) leads us to &lt;a href=&quot;https://github.com/opendaylight/netconf/blob/master/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/utils/parser/ParserFieldsParameter.java#L409&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ParserFieldsParameter&lt;/a&gt; which just an atrocious piece of code.&lt;/p&gt;

&lt;p&gt;Let&apos;s improve the diagnostics first and show whether the requested child actually matches the QName we expect here, or whether it is a mixup with a child leaf. At any rate I am putting a rewrite of that class on by TODO list.&lt;/p&gt;</comment>
                            <comment id="69801" author="JIRAUSER13318" created="Fri, 22 Oct 2021 16:43:20 +0000"  >&lt;p&gt;Makes sense. I also noticed a difference in the behavior between mount point &amp;amp; internal datastore: e.g. the latter does not include the key leaves in the response if they are not included in the fields query.&lt;/p&gt;</comment>
                            <comment id="69802" author="rovarga" created="Fri, 22 Oct 2021 18:31:02 +0000"  >&lt;p&gt;Yeah, it is a pathological case of wrong layering and resulting bowl of pasta.&lt;/p&gt;

&lt;p&gt;Anyway, I have merged the diagnostic patch to both master and 1.13.x, can you give it a try, please?&lt;/p&gt;

&lt;p&gt;In the meantime I have started on splitting out string parsing from that monstrosity here: &lt;a href=&quot;https://git.opendaylight.org/gerrit/c/netconf/+/98051&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/c/netconf/+/98051&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="69804" author="JIRAUSER13318" created="Fri, 22 Oct 2021 20:22:40 +0000"  >&lt;p&gt;I tried the patch and the error message is clearer now:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;20:11:46.492 ERROR [opendaylight-cluster-data-akka.actor.default-dispatcher-16] Unable to serialize filter element for path /(urn:ietf:params:xml:ns:yang:ietf-interfaces?revision=2014-05-08)interfaces with fields: [/(urn:ietf:params:xml:ns:yang:ietf-interfaces?revision=2014-05-08)interface[{}]/type]
java.lang.IllegalStateException: Unable to serialize filter element for path /(urn:ietf:params:xml:ns:yang:ietf-interfaces?revision=2014-05-08)interfaces with fields: [/(urn:ietf:params:xml:ns:yang:ietf-interfaces?revision=2014-05-08)interface[{}]/type]
	at org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.toFilterStructure(NetconfMessageTransformUtil.java:263) ~[bundleFile:?]
	at org.opendaylight.netconf.sal.connect.netconf.util.NetconfRpcStructureTransformer.toFilterStructure(NetconfRpcStructureTransformer.java:77) ~[bundleFile:?]
	at org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps.get(NetconfBaseOps.java:351) ~[bundleFile:?]
	at org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps.getData(NetconfBaseOps.java:302) ~[bundleFile:?]
	at org.opendaylight.netconf.sal.connect.netconf.sal.AbstractNetconfDataTreeService.get(AbstractNetconfDataTreeService.java:265) ~[bundleFile:?]
	at org.opendaylight.netconf.topology.singleton.impl.actors.NetconfDataTreeServiceActor.onReceive(NetconfDataTreeServiceActor.java:70) ~[?:?]
	at akka.actor.UntypedAbstractActor$$anonfun$receive$1.applyOrElse(AbstractActor.scala:332) ~[bundleFile:?]
	at akka.actor.Actor.aroundReceive(Actor.scala:537) ~[bundleFile:?]
	at akka.actor.Actor.aroundReceive$(Actor.scala:535) ~[bundleFile:?]
	at akka.actor.AbstractActor.aroundReceive(AbstractActor.scala:220) ~[bundleFile:?]
	at akka.actor.ActorCell.receiveMessage(ActorCell.scala:580) [bundleFile:?]
	at akka.actor.ActorCell.invoke(ActorCell.scala:548) [bundleFile:?]
	at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:270) [bundleFile:?]
	at akka.dispatch.Mailbox.run(Mailbox.scala:231) [bundleFile:?]
	at akka.dispatch.Mailbox.exec(Mailbox.scala:243) [bundleFile:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) [?:?]
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) [?:?]
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) [?:?]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) [?:?]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) [?:?]
Caused by: java.io.IOException: Child identifier (urn:ietf:params:xml:ns:yang:ietf-interfaces?revision=2014-05-08)type is invalid in parent (urn:ietf:params:xml:ns:yang:ietf-interfaces?revision=2014-05-08)interface
	at org.opendaylight.netconf.util.StreamingContext$AbstractMapMixin.emitChildTreeNode(StreamingContext.java:270) ~[bundleFile:?]
	at org.opendaylight.netconf.util.StreamingContext$AbstractComposite.streamToWriter(StreamingContext.java:181) ~[bundleFile:?]
	at org.opendaylight.netconf.util.StreamingContext$AbstractComposite.emitChildTreeNode(StreamingContext.java:188) ~[bundleFile:?]
	at org.opendaylight.netconf.util.StreamingContext$AbstractComposite.streamToWriter(StreamingContext.java:181) ~[bundleFile:?]
	at org.opendaylight.netconf.util.NetconfUtil.writeFilter(NetconfUtil.java:254) ~[bundleFile:?]
	at org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.toFilterStructure(NetconfMessageTransformUtil.java:261) ~[bundleFile:?]
	... 19 more
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="69805" author="rovarga" created="Fri, 22 Oct 2021 21:04:28 +0000"  >&lt;p&gt;Right-o. So it is PathParser&apos;s fault after all &amp;#8211; it should be inserting an NodeIdentifierWithPredicates before accessing type.&lt;/p&gt;

&lt;p&gt;The problem is the usual confusion about addressing: we have a number of constructs which boil down to List&amp;lt;QName&amp;gt; in some shape or form, but they have distinct meanings:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;SchemaPath has aweful definition, which makes it useless due to ambiguity&lt;/li&gt;
	&lt;li&gt;SchemaNodeIdentifier is QNames as seen by the likes of &quot;augment /foo/bar&quot; YANG statements&lt;/li&gt;
	&lt;li&gt;YangInstanceIdentifier corresponds to NormalizedNode layout&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;It is never a good sign when common code is used to build a SchemaPath/SchemaNodeIdentifier and YangInstanceIdentifier. The two differ when lists are concerned, because NormalizedNodes require MapNode-&amp;gt;MapEntryNode (i.e. corresponding to JSON structure, not XML).&lt;/p&gt;

&lt;p&gt;To add insult to injury, netconf-util is misusing YangInstanceIdentifier, it really should have its own class to represent what it wants. We will deal with that separately though.&lt;/p&gt;</comment>
                            <comment id="69903" author="rovarga" created="Mon, 25 Oct 2021 18:04:45 +0000"  >&lt;p&gt;So I created a FieldsParam and the associated parser to split the problem ParserFieldsParameter is dealing with into two problems:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;FieldsParam.parse() parses the URI string into a DTO with a simple structure (done)&lt;/li&gt;
	&lt;li&gt;ParserFiledsParameter will then be used to bind FiledsParam to an EffectiveModelContext, creating whatever is needed (todo)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Now we are in a position where we can integrate the two, which will result in taking some of the complexity out of the picture, making it easier to refactor further.&lt;/p&gt;</comment>
                            <comment id="69904" author="JIRAUSER13318" created="Mon, 25 Oct 2021 18:23:34 +0000"  >&lt;p&gt;Great! Thanks for the update.&lt;/p&gt;</comment>
                            <comment id="69905" author="rovarga" created="Mon, 25 Oct 2021 22:20:52 +0000"  >&lt;p&gt;Okay, so the integration is done and dusted. Now I have split up the two parsers and their test suites in &lt;a href=&quot;https://git.opendaylight.org/gerrit/c/netconf/+/98129&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/c/netconf/+/98129&lt;/a&gt; . Since both should handle the same inputs, we now have an AbstractFieldsTranslatorTest, which drives the test cases and two subclasses which are evaluating assertions.&lt;/p&gt;

&lt;p&gt;During that I realized the test suite is rather strange: it loads up an EffectiveModelContext, but also does a ton of mocking around SchemaNodes &#8211; to the point where some of the test cases do not make quite sense, I am afraid. So the next step here is clean up that part, which will probably start showing some deficiencies in the code base.&lt;/p&gt;

&lt;p&gt;Once that is done, reproducing the failure in a nice test case should be possible and that should drive us forward.&lt;/p&gt;</comment>
                            <comment id="70001" author="rovarga" created="Tue, 26 Oct 2021 15:57:11 +0000"  >&lt;p&gt;After looking at the error more closely, it looks a bit strange.&lt;/p&gt;

&lt;p&gt;The request is for /interfaces list, which is fine. The fields specification looks also fine: interface&lt;span class=&quot;error&quot;&gt;&amp;#91;{}&amp;#93;&lt;/span&gt; is the empty NodeIdentifierWithPredicates.&lt;/p&gt;

&lt;p&gt;Without looking at the code, the state should be such that we are entering filter serialization with DataSchemaContextNode for &apos;interfaces&apos; as the current node, then enter the empty NodeIdentifierWithPredicates, then enter type.&lt;/p&gt;

&lt;p&gt;It looks, though, as if we are starting at root (or, more generally, at the parent of &apos;interfaces&apos;), then use the NodeIdentifierWithPredicates to enter the node for &apos;interfaces&apos; and then reject the &apos;type&apos; child. If this is really happening, we should really reject the first step, as it is the first mismatch.&lt;/p&gt;

&lt;p&gt;In any case, this is a disagreement between NETCONF and RESTCONF, so it&apos;s still not clear who is at fault here:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;NETCONF may have good reasons to not enter the &apos;interfaces&apos; node there &#8211; that encapsulation does not exist in XML mapping&lt;/li&gt;
	&lt;li&gt;RESTCONF does have enough state to start with &apos;interfaces&apos; NodeIdentifier&lt;/li&gt;
	&lt;li&gt;Judging by the error message alone, a YangInstanceIdentifier concatenation of &apos;for path&apos; and &apos;with fields&apos; really yields what RESTCONF is looking for&lt;/li&gt;
	&lt;li&gt;The interface seems to be defined very weakly, so there&apos;s some room for improvement there&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So after spending some quality time in RESTCONF code, it is now time to sift through the NETCONF side of things again &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.opendaylight.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="70002" author="JIRAUSER13318" created="Tue, 26 Oct 2021 17:34:36 +0000"  >&lt;p&gt;For the list node the NETCONF side is expecting both NodeIdentifier &amp;amp; NodeIdentifierWithPredicates - for example, YangInstanceIdentifier for a field &lt;tt&gt;datastores/datastore&lt;/tt&gt; is created like this in the &lt;a href=&quot;https://github.com/opendaylight/netconf/blob/f184dc851aafaec05a05fc549ae60b231ae5596a/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/schema/mapping/NetconfMessageTransformerTest.java#L1033&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;unit test&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;final YangInstanceIdentifier datastoreListField = YangInstanceIdentifier.create(toId(Datastores.QNAME),
        toId(Datastore.QNAME), NodeIdentifierWithPredicates.of(Datastore.QNAME));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;There are NodeIdentifier &amp;amp; NodeIdentifierWithPredicates for the list node &lt;tt&gt;datastore&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;However, RESTCONF just generates a YangInstanceIdentifier with NodeIdentifierWithPredicates only.&lt;/p&gt;

&lt;p&gt;I was trying to make it work with a NETCONF side fix but wasn&apos;t really sure which side is at fault.&lt;/p&gt;</comment>
                            <comment id="70003" author="rovarga" created="Tue, 26 Oct 2021 17:35:38 +0000"  >&lt;p&gt;So the stitching on lists is rather not obvious and is asserted by tests here: &lt;a href=&quot;https://github.com/opendaylight/netconf/blob/master/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/schema/mapping/NetconfMessageTransformerTest.java#L1061-L1097&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/opendaylight/netconf/blob/master/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/schema/mapping/NetconfMessageTransformerTest.java#L1061-L1097&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What this does is actually ignore the leading NodeIdentifierWithPredicates, because path is:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;/(urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?revision=2010-10-04)netconf-state/sessions
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;i.e. it points to sessions and then field is accessed as:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;/(urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?revision=2010-10-04)session/session[{(urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?revision=2010-10-04)session-id=1}]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Note how there is no empty NodeIdentifierWithPredicates on either side. So if this really is how this piece of fine engineering is meant to operate, RESTCONF should &lt;b&gt;not&lt;/b&gt; be emitting the leading empty NodeIdentifierWithPredicates. A bit more investigation is necessary to understand whether this is specific to the stitch point, or whether there are other weird things happening.&lt;/p&gt;</comment>
                            <comment id="70004" author="rovarga" created="Tue, 26 Oct 2021 17:45:28 +0000"  >&lt;p&gt;Yes, this is how I would expect it to operate, but this test case is different: we are crossing into the list and then through its entries as part of the fields filter, i.e. the path/field stitching is at ContainerNode-&amp;gt;MapNode and then MapNode-&amp;gt;MapEntryNode-&amp;gt;LeafNode is part of the field YangInstanceIdentifier.&lt;/p&gt;

&lt;p&gt;I think the mapping code is performing a magic jump in addressing when the final node of &apos;path&apos;, i.e. the stitch point, is a MapNode, then the addressing is not MapNode-&amp;gt;MapEntryNode-&amp;gt;LeafNode, but rather MapNode-&amp;gt;LeafNode &amp;#8211; with the stitch point being the only place where this happens.&lt;/p&gt;</comment>
                            <comment id="70005" author="rovarga" created="Tue, 26 Oct 2021 18:16:59 +0000"  >&lt;p&gt;The thing is, though, we are not talking directly to the code being tested here, but go through &lt;a href=&quot;https://github.com/opendaylight/netconf/blob/f184dc851aafaec05a05fc549ae60b231ae5596a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfBaseOps.java#L350-L352&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this guy&lt;/a&gt; on netconf side:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isFilterPresent(filterPath)) {
            rpcInput = NetconfMessageTransformUtil.wrap(NETCONF_GET_NODEID, transformer.toFilterStructure(
                    Collections.singletonList(FieldsFilter.of(filterPath.get(), fields))));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here the inputs are controlled by RESTCONF. I think it is very reasonable for RESTCONF to supply the leading empty NodeIdentifierWith predicates, because that makes it consistent from the perspective of YangInstanceIdentifier addressing &amp;#8211; concat the filterPath and any of the fields and you get a valid YangInstanceIdentifier, containing PathArguments for Container-&amp;gt;MapNode-&amp;gt;MapEntryNode-&amp;gt;LeafNode steps.&lt;/p&gt;

&lt;p&gt;The problem is that FieldsFilter does not work that way at least for the case of MapNodes, as demonstrated by the UT I pointed out. There the expectation is that filterPath contains PathArguments for Container-&amp;gt;MapNode and field contains just the LeafNode PathArgument.&lt;/p&gt;</comment>
                            <comment id="70006" author="rovarga" created="Tue, 26 Oct 2021 18:19:29 +0000"  >&lt;p&gt;I am going offline, but a simple test to try out would be to modify this piece of code to check each of the fields and if it starts with an empty NodeIdentifierWith predicates, trim it before adding it to FieldsFilter. I strongly suspect this will fix the issue.&lt;/p&gt;</comment>
                            <comment id="70007" author="rovarga" created="Tue, 26 Oct 2021 18:32:00 +0000"  >&lt;p&gt;Ah, and it that works, we have a hotfix &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.opendaylight.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;In any case, the long-term fix is to ditch YangInstanceIdentifier in FieldsParam and define a new structure, which will hold just a List&amp;lt;QName&amp;gt;, similar to what SchemaNodeIdentifier does. We cannot use SchemaNodeIdentifier, as the QNames there are interpreted as steps along YANG schema tree axis. This new structure would interpret those QName along YANG data tree axis &amp;#8211; which how NETCONF/RESTCONF addressing works natively &amp;#8211; and hence we will be able to delete a chunk of complex code! &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.opendaylight.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                            <comment id="70008" author="JIRAUSER13318" created="Tue, 26 Oct 2021 18:43:12 +0000"  >&lt;p&gt;Tried another case in the lab:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;/rests/data/network-topology:network-topology/topology=topology-netconf/node=SJ-E9-221/yang-ext:mount/ietf-interfaces:interfaces?fields=interface/type&lt;/li&gt;
	&lt;li&gt;/rests/data/network-topology:network-topology/topology=topology-netconf/node=SJ-E9-221/yang-ext:mount/ietf-interfaces:interfaces/interface=loopback10/host-management-std:loopback?fields=ipv6/address/ip&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The first case is the original failure case where &lt;tt&gt;interface&lt;/tt&gt; is a list node.&lt;/p&gt;

&lt;p&gt;In the second case &lt;tt&gt;host-management-std:loopback&lt;/tt&gt; and &lt;tt&gt;ipv6&lt;/tt&gt; are both containers, and &lt;tt&gt;address&lt;/tt&gt; is a list node. And this one also fails:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;nable to serialize filter element for path /(urn:ietf:params:xml:ns:yang:ietf-interfaces?revision=2014-05-08)interfaces/interface/interface[{(urn:ietf:params:xml:ns:yang:ietf-interfaces?revision=2014-05-08)name=loopback10}]/AugmentationIdentifier{childNames=[(http://www.calix.com/ns/exa/host-management-std?revision=2020-10-19)loopback]}/(http://www.calix.com/ns/exa/host-management-std?revision=2020-10-19)loopback with fields: [/(http://www.calix.com/ns/exa/host-management-std?revision=2020-10-19)ipv6/address[{}]/ip]
java.lang.IllegalStateException: Unable to serialize filter element for path /(urn:ietf:params:xml:ns:yang:ietf-interfaces?revision=2014-05-08)interfaces/interface/interface[{(urn:ietf:params:xml:ns:yang:ietf-interfaces?revision=2014-05-08)name=loopback10}]/AugmentationIdentifier{childNames=[(http://www.calix.com/ns/exa/host-management-std?revision=2020-10-19)loopback]}/(http://www.calix.com/ns/exa/host-management-std?revision=2020-10-19)loopback with fields: [/(http://www.calix.com/ns/exa/host-management-std?revision=2020-10-19)ipv6/address[{}]/ip]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;But the following works without a child leaf node:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;/rests/data/network-topology:network-topology/topology=topology-netconf/node=SJ-E9-221/yang-ext:mount/ietf-interfaces:interfaces?fields=interface&lt;/li&gt;
	&lt;li&gt;/rests/data/network-topology:network-topology/topology=topology-netconf/node=SJ-E9-221/yang-ext:mount/ietf-interfaces:interfaces/interface=loopback10/host-management-std:loopback?fields=ipv6/address&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So fields with list node + child node seem to be the issue.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10002">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="35111">NETCONF-849</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                                                <inwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="32462">NETCONF-660</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i03zjz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>