<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:54:16 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>[YANGTOOLS-771] IncorrectNestingException when writing to an augmented data-tree (BORON-SR3)</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-771</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;I have created a project using boron-SR3 archetype. In one of the yang I have augmented a container. In the code I am trying to write the data to that container to the DataStore, but I am getting IncorrectNestingException exception. The same code is working fine in the boron stable project. Below are the yang and code snippets.&lt;/p&gt;

&lt;p&gt;File1.yang :&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;module test-controller {
 yang-version 1;
 namespace &quot;http://www.test.com/controllerconfiguration/core&quot;;
 prefix &quot;testconfig&quot;;
 description &quot;&quot;;
 revision &quot;2016-09-22&quot; { description &quot;Initial revision of model&quot;; }

 container controller {
 }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;File2.yang :&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;module device-config {
 yang-version 1;
 namespace &quot;urn:opendaylight:params:xml:ns:yang:controller:config:sal-clustering-it:device-config&quot;;
 prefix &quot;deviceconfig&quot;;
 revision &quot;2016-09-28&quot; { description &quot;Initial revision of connector configuration model&quot;; }
&#160;
 import test-controller { prefix testconfig; revision-date 2016-09-22; }

 import yang-ext { prefix ext; }

 import ietf-inet-types { prefix &quot;inet-types&quot;; revision-date 2013-07-15; }

grouping controller-common-group {
 container version-info {
 leaf version
{ type string; mandatory true; description &quot;Controller version.&quot;; }
}
}
&#160;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&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;/*

Augumented
 */
 augment &quot;/testconfig:controller&quot;
 Unknown macro: { ext}
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;File3.java :&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;
VersionInfoBuilder versionInfoBuilder = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; VersionInfoBuilder();
 versionInfoBuilder.setVersion(&lt;span class=&quot;code-quote&quot;&gt;&quot;17.1.1.1&quot;&lt;/span&gt;);
 InstanceIdentifier&amp;lt;VersionInfo&amp;gt; in = InstanceIdentifier.create(Controller.class)
 .augmentation(ControllerMgmtAugmentation.class).child(ControllerCommonMgmt.class)
 .child(VersionInfo.class);
 WriteTransaction writeTranaction = dataBroker.newWriteOnlyTransaction();
 writeTranaction.merge(LogicalDatastoreType.OPERATIONAL, in, versionInfoBuilder.build(), &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
 writeTranaction.submit();&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;File4.java :&lt;/p&gt;

&lt;p&gt;&#160;&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;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;interface&lt;/span&gt; ControllerMgmtAugmentation
 &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt;
 DataObject,
 Augmentation&amp;lt;Controller&amp;gt;
{ &lt;span class=&quot;code-comment&quot;&gt;/** * Controller version and backup details. * * * * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &amp;lt;code&amp;gt;org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.device.config.rev160928.controller.ControllerCommonMgmt&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;controllerCommonMgmt&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;&amp;lt;/code&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; not present */&lt;/span&gt; ControllerCommonMgmt getControllerCommonMgmt(); }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;LOG Traces :&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;2017-04-14 17:33:17,565 | ERROR | on-dispatcher-34 | DataTreeChangeListenerActor | 176 - org.opendaylight.controller.sal-distributed-datastore - 1.4.3.Boron-SR3 | Error notify
 ing listener org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataTreeChangeListenerAdapter@85aac52
 org.opendaylight.yangtools.binding.data.codec.impl.IncorrectNestingException: Class interface org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal
 .clustering.it.device.config.rev160928.ControllerMgmtAugmentation is not valid child of interface org.opendaylight.yang.gen.v1.http.www.test.com.controllerconfiguration.core.rev160
 922.Controller
 at org.opendaylight.yangtools.binding.data.codec.impl.IncorrectNestingException.create(IncorrectNestingException.java:28)[74:org.opendaylight.mdsal.binding-dom-codec:0.9.3.
 Boron-SR3]
 at org.opendaylight.yangtools.binding.data.codec.impl.DataContainerCodecContext.childNonNull(DataContainerCodecContext.java:180)[74:org.opendaylight.mdsal.binding-dom-codec
 :0.9.3.Boron-SR3]
 at org.opendaylight.yangtools.binding.data.codec.impl.DataObjectCodecContext.bindingPathArgumentChild(DataObjectCodecContext.java:184)[74:org.opendaylight.mdsal.binding-dom
 -codec:0.9.3.Boron-SR3]
 at org.opendaylight.yangtools.binding.data.codec.impl.BindingCodecContext.getCodecContextNode(BindingCodecContext.java:127)[74:org.opendaylight.mdsal.binding-dom-codec:0.9.
 3.Boron-SR3]
 at org.opendaylight.yangtools.binding.data.codec.impl.BindingCodecContext.newWriter(BindingCodecContext.java:104)[74:org.opendaylight.mdsal.binding-dom-codec:0.9.3.Boron-SR
 3]
 at org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry.toNormalizedNode(BindingNormalizedNodeCodecRegistry.java:102)[74:org.opendaylight.m
 dsal.binding-dom-codec:0.9.3.Boron-SR3]
 at org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec.toNormalizedNode(BindingToNormalizedNodeCodec.java:135)[146:org.opendaylight.controller.sal-
 binding-broker-impl:1.4.3.Boron-SR3]
 at org.opendaylight.controller.md.sal.binding.impl.AbstractWriteTransaction.merge(AbstractWriteTransaction.java:53)[146:org.opendaylight.controller.sal-binding-broker-impl:
 1.4.3.Boron-SR3]
 at org.opendaylight.controller.impl.ConnectorDTCL.onDataTreeChanged(ConnectorDTCL.java:41)[179:org.opendaylight.controller.test-impl:0.1.0.SNAPSHOT]
 at org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataTreeChangeListenerAdapter.onDataTreeChanged(BindingDOMDataTreeChangeListenerAdapter.java:41)[146:org.openda
 ylight.controller.sal-binding-broker-impl:1.4.3.Boron-SR3]
 at org.opendaylight.controller.cluster.datastore.DataTreeChangeListenerActor.dataChanged(DataTreeChangeListenerActor.java:58)[176:org.opendaylight.controller.sal-distribute
 d-datastore:1.4.3.Boron-SR3]
 at org.opendaylight.controller.cluster.datastore.DataTreeChangeListenerActor.handleReceive(DataTreeChangeListenerActor.java:40)[176:org.opendaylight.controller.sal-distribu
 ted-datastore:1.4.3.Boron-SR3]
 at org.opendaylight.controller.cluster.common.actor.AbstractUntypedActor.onReceive(AbstractUntypedActor.java:26)[170:org.opendaylight.controller.sal-clustering-commons:1.4.
 3.Boron-SR3]
 at akka.actor.UntypedActor$$anonfun$receive$1.applyOrElse(UntypedActor.scala:165)[158:com.typesafe.akka.actor:2.4.7]
 at akka.actor.Actor$class.aroundReceive(Actor.scala:484)[158:com.typesafe.akka.actor:2.4.7]
 at akka.actor.UntypedActor.aroundReceive(UntypedActor.scala:95)[158:com.typesafe.akka.actor:2.4.7]
 at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526)[158:com.typesafe.akka.actor:2.4.7]
 at akka.actor.ActorCell.invoke(ActorCell.scala:495)[158:com.typesafe.akka.actor:2.4.7]
 at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257)[158:com.typesafe.akka.actor:2.4.7]
 at akka.dispatch.Mailbox.run(Mailbox.scala:224)[158:com.typesafe.akka.actor:2.4.7]
 at akka.dispatch.Mailbox.exec(Mailbox.scala:234)[158:com.typesafe.akka.actor:2.4.7]
 at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)[154:org.scala-lang.scala-library:2.11.8.v20160304-115712-1706a37eb8]
 at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)[154:org.scala-lang.scala-library:2.11.8.v20160304-115712-1706a37eb8]
 at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)[154:org.scala-lang.scala-library:2.11.8.v20160304-115712-1706a37eb8]
 at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)[154:org.scala-lang.scala-library:2.11.8.v20160304-115712-1706a37eb8]
 2017-04-14 17:36:43,318 | WARN | ssionScavenger-4 | teInvalidatingHashSessionManager | 199 - org.ops4j.pax.web.pax-web-jetty - 3.2.9 | Timing out for 1 session(s) with id 1hhckm7x
 1lje1zujilxde8pq1
 2017-04-14 17:36:43,320 | WARN | ssionScavenger-4 | teInvalidatingHashSessionManager | 199 - org.ops4j.pax.web.pax-web-jetty - 3.2.9 | Timing out for 1 session(s) with id 1eo5yv73
 psibrvwqf3rjsmepy&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="23191">YANGTOOLS-771</key>
            <summary>IncorrectNestingException when writing to an augmented data-tree (BORON-SR3)</summary>
                <type id="10100" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10310&amp;avatarType=issuetype">Improvement</type>
                                                <status id="10003" iconUrl="https://jira.opendaylight.org/images/icons/status_generic.gif" description="">Confirmed</status>
                    <statusCategory id="2" key="new" colorName="blue-gray"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="sdutt@advaoptical.com">Satish Dutt</reporter>
                        <labels>
                    </labels>
                <created>Mon, 17 Apr 2017 06:40:11 +0000</created>
                <updated>Thu, 18 May 2023 11:11:57 +0000</updated>
                                            <version>1.0.3</version>
                                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="44408" author="martin.ciglan" created="Tue, 18 Apr 2017 11:04:04 +0000"  >&lt;p&gt;Can you re-try with latest stable/carbon branch? Thanks.&lt;/p&gt;</comment>
                            <comment id="44409" author="martin.ciglan" created="Wed, 19 Apr 2017 08:07:17 +0000"  >&lt;p&gt;and post logs&lt;/p&gt;</comment>
                            <comment id="44410" author="sdutt@advaoptical.com" created="Wed, 19 Apr 2017 08:09:07 +0000"  >&lt;p&gt;(In reply to Martin Ciglan from comment #2)&lt;br/&gt;
&amp;gt; and post logs&lt;/p&gt;

&lt;p&gt;The same issue is observed in the master branch, which I presume must be the Carbon branch&lt;/p&gt;</comment>
                            <comment id="44411" author="martin.ciglan" created="Wed, 19 Apr 2017 08:35:21 +0000"  >&lt;p&gt;Could you post complete logs from master? Thank you.&lt;/p&gt;</comment>
                            <comment id="44412" author="sdutt@advaoptical.com" created="Mon, 24 Apr 2017 07:13:09 +0000"  >&lt;p&gt;Hi All,&lt;/p&gt;

&lt;p&gt;I have analysed the root cause for this issue. The YANG RFC 6020 states that    &quot;If the target node is in another module, then nodes added by the&lt;br/&gt;
augmentation MUST NOT be mandatory nodes&quot;. So if we analyse the bug reported with this understanding, we can see that &apos;version&apos; is a mandatory node in a different module, which is being augmented to &apos;controller&apos; node present in a different module. So this is an violation as per RFC. Till the BoronSR1 this validation was not honored, and from  BoronSR3 this is being honored. Unfortunately Yangtools should have thrown this validation as an ERROR instead of reporting as an WARNING and making the build successful and causing this issue during the runtime. So ideally this bug should be moved to the Yangtools project.&lt;/p&gt;

&lt;p&gt;Regards&lt;br/&gt;
-Satish&lt;/p&gt;</comment>
                            <comment id="44413" author="martin.ciglan" created="Mon, 24 Apr 2017 07:26:07 +0000"  >&lt;p&gt;thanks for clarifying this, moving to Yangtools.&lt;/p&gt;

&lt;p&gt;Igor, Peter - we need fix for master and cherry-picks for Carbon &amp;amp; Boron too.&lt;/p&gt;</comment>
                            <comment id="44414" author="pkajsa" created="Mon, 24 Apr 2017 13:56:24 +0000"  >&lt;p&gt;(In reply to Satish Dutt from comment #5)&lt;br/&gt;
&amp;gt; Hi All,&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; I have analysed the root cause for this issue. The YANG RFC 6020 states that&lt;br/&gt;
&amp;gt; &quot;If the target node is in another module, then nodes added by the&lt;br/&gt;
&amp;gt; augmentation MUST NOT be mandatory nodes&quot;. So if we analyse the bug reported&lt;br/&gt;
&amp;gt; with this understanding, we can see that &apos;version&apos; is a mandatory node in a&lt;br/&gt;
&amp;gt; different module, which is being augmented to &apos;controller&apos; node present in a&lt;br/&gt;
&amp;gt; different module. So this is an violation as per RFC. Till the BoronSR1 this&lt;br/&gt;
&amp;gt; validation was not honored, and from  BoronSR3 this is being honored.&lt;br/&gt;
&amp;gt; Unfortunately Yangtools should have thrown this validation as an ERROR&lt;br/&gt;
&amp;gt; instead of reporting as an WARNING and making the build successful and&lt;br/&gt;
&amp;gt; causing this issue during the runtime. So ideally this bug should be moved&lt;br/&gt;
&amp;gt; to the Yangtools project.&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; Regards&lt;br/&gt;
&amp;gt; -Satish&lt;/p&gt;

&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;it is intended behavior to log it as a warning, because in such case we still want to continue with creation of a SchemaContext.&lt;/p&gt;

&lt;p&gt;BR&lt;br/&gt;
Peter.&lt;/p&gt;</comment>
                            <comment id="44415" author="sdutt@advaoptical.com" created="Mon, 24 Apr 2017 14:32:48 +0000"  >&lt;p&gt;Hi Peter,&lt;/p&gt;

&lt;p&gt;If just the warning is shown and is continued during the yangtools execution phase, it causes an issue during the runtime. In the runtime, IncorrectNestingException will be thrown, whenever the access is made to the nodes which are augmented to the target nodes of some other module. So it would be best during the yangtools execution phase, that this is thrown as an Error and abort. This will enable the user to fix his yang model which violates the RFC, rather than to get an exception during the runtime.&lt;/p&gt;

&lt;p&gt;-Satish&lt;/p&gt;</comment>
                            <comment id="44416" author="pkajsa" created="Tue, 25 Apr 2017 07:56:21 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I agree with you, but this behavior has been requested by the ODL community due to a lot of not entirely valid augments in yang models (e.g. augments into unknown nodes in tailf&apos;s models etc.). So they requested a less strict yang parser due to these &quot;not critical&quot; errors in augments. &lt;/p&gt;

&lt;p&gt;So please you can open a new discussion about this issue in community and if a new consensus is made, we are able to fix this very quickly.&lt;/p&gt;

&lt;p&gt;I downgrade severity of the bug to normal, because it is definitely not a blocker.&lt;/p&gt;

&lt;p&gt;BR&lt;br/&gt;
Peter.&lt;/p&gt;</comment>
                            <comment id="44417" author="rovarga" created="Thu, 29 Jun 2017 21:58:19 +0000"  >&lt;p&gt;While I agree, I think we can strike some middle ground.&lt;/p&gt;

&lt;p&gt;We really want to control strictness of the parser code (i.e. fail build instead of a warning). This can be controlled on a per-pom.xml basis using maven configuration, which would be passed down as yang-parser-impl configuration.&lt;/p&gt;

&lt;p&gt;This can then make it first an opt-in feature and once we stabilize augments vs. extensions, we can promote it to an opt-out feature.&lt;/p&gt;

&lt;p&gt;Changing to an improvement and slightly bumping the priority, as this should be pretty easy to do.&lt;/p&gt;</comment>
                    </comments>
                    <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_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>8233</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10201" key="com.atlassian.jira.plugin.system.customfieldtypes:url">
                        <customfieldname>External issue URL</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[https://bugs.opendaylight.org/show_bug.cgi?id=8233]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10206" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Issue Type</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10305"><![CDATA[Improvement]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i029a7:</customfieldvalue>

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