<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:16:42 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-1114] Incorrect operational state of device configuration with Invalid encrypted password</title>
                <link>https://jira.opendaylight.org/browse/NETCONF-1114</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;p&gt;Some device configuration with invalid encrypted password causes failure while processing the device configuration and creates incorrect operational state for the device.&lt;/p&gt;

&lt;p&gt;For example, the following request which directly creates/updates device configuration with unencrypted password:&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;PUT /rests/data/network-topology:network-topology/topology=topology-netconf/node=netconf-mdsal

{
    &quot;network-topology:node&quot;: [
        {
            &quot;node-id&quot;: &quot;netconf-mdsal&quot;,
            &quot;netconf-node-topology:concurrent-rpc-limit&quot;: 0,
            &quot;netconf-node-topology:schema-cache-directory&quot;: &quot;netconf-mdsal&quot;,
            &quot;netconf-node-topology:login-password&quot;: {
                &quot;username&quot;: &quot;admin&quot;,
                &quot;password&quot;: &quot;admin&quot;
            },
            &quot;netconf-node-topology:default-request-timeout-millis&quot;: 1800000,
            &quot;netconf-node-topology:port&quot;: 2830,
            &quot;netconf-node-topology:tcp-only&quot;: false,
            &quot;netconf-node-topology:host&quot;: &quot;127.0.0.1&quot;,
            &quot;netconf-node-topology:actor-response-wait-time&quot;: 600,
            &quot;netconf-node-topology:keepalive-delay&quot;: 600
        }
    ]
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;triggers this exception:&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;00:51:16.260 ERROR [opendaylight-cluster-data-notification-dispatcher-46] member-1-shard-topology-config: Error notifying listener org.opendaylight.mdsal.binding.dom.adapter.BindingDOMDataTreeChangeListenerAdapter@4abd7f00
java.lang.IllegalArgumentException: Last unit does not have enough valid bits
	at java.util.Base64$Decoder.decode0(Base64.java:867) ~[?:?]
	at java.util.Base64$Decoder.decode(Base64.java:566) ~[?:?]
	at java.util.Base64$Decoder.decode(Base64.java:589) ~[?:?]
	at org.opendaylight.aaa.encrypt.impl.AAAEncryptionServiceImpl.decrypt(AAAEncryptionServiceImpl.java:151) ~[?:?]
	at org.opendaylight.netconf.topology.spi.DefaultNetconfClientConfigurationBuilderFactory.getHandlerFromCredentials(DefaultNetconfClientConfigurationBuilderFactory.java:96) ~[bundleFile:?]
	at org.opendaylight.netconf.topology.spi.DefaultNetconfClientConfigurationBuilderFactory.createClientConfigurationBuilder(DefaultNetconfClientConfigurationBuilderFactory.java:68) ~[bundleFile:?]
	at org.opendaylight.netconf.topology.spi.NetconfNodeHandler.&amp;lt;init&amp;gt;(NetconfNodeHandler.java:143) ~[bundleFile:?]
	at org.opendaylight.netconf.topology.spi.AbstractNetconfTopology.setupConnection(AbstractNetconfTopology.java:142) ~[bundleFile:?]
	at org.opendaylight.netconf.topology.spi.AbstractNetconfTopology.lockedEnsureNode(AbstractNetconfTopology.java:108) ~[bundleFile:?]
	at org.opendaylight.netconf.topology.spi.AbstractNetconfTopology.ensureNode(AbstractNetconfTopology.java:96) ~[bundleFile:?]
	at org.opendaylight.netconf.topology.impl.NetconfTopologyImpl.onDataTreeChanged(NetconfTopologyImpl.java:145) ~[?:?]
	at org.opendaylight.mdsal.binding.dom.adapter.BindingDOMDataTreeChangeListenerAdapter.onDataTreeChanged(BindingDOMDataTreeChangeListenerAdapter.java:44) ~[bundleFile:?]
	at org.opendaylight.controller.cluster.datastore.DataTreeChangeListenerActor.dataTreeChanged(DataTreeChangeListenerActor.java:90) ~[bundleFile:?]
	at org.opendaylight.controller.cluster.datastore.DataTreeChangeListenerActor.handleReceive(DataTreeChangeListenerActor.java:45) ~[bundleFile:?]
	at akka.japi.pf.UnitCaseStatement.apply(CaseStatements.scala:24) ~[bundleFile:?]
	at akka.japi.pf.UnitCaseStatement.apply(CaseStatements.scala:20) ~[bundleFile:?]
	at scala.PartialFunction.applyOrElse(PartialFunction.scala:214) ~[bundleFile:?]
	at scala.PartialFunction.applyOrElse$(PartialFunction.scala:213) ~[bundleFile:?]
	at akka.japi.pf.UnitCaseStatement.applyOrElse(CaseStatements.scala:20) ~[bundleFile:?]
	at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:269) ~[bundleFile:?]
	at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:270) ~[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:579) ~[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:373) ~[?:?]
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The exception thrown from &lt;tt&gt;Base64$Decoder.decode&lt;/tt&gt; while attempting to decrypt the password is not handled while processing the device configuration, hence the process is abruptly aborted and premature operational state is created with &lt;tt&gt;connection-status&lt;/tt&gt; of &lt;tt&gt;connecting&lt;/tt&gt; even though there is no connection attempt:&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=netconf-mdsal?content=nonconfig

{
    &quot;network-topology:node&quot;: [
        {
            &quot;node-id&quot;: &quot;netconf-mdsal&quot;,
            &quot;netconf-node-topology:port&quot;: 2830,
            &quot;netconf-node-topology:connection-status&quot;: &quot;connecting&quot;,
            &quot;netconf-node-topology:host&quot;: &quot;127.0.0.1&quot;
        }
    ]
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Also, the operational data is not cleaned up even after the device configuration is removed.&lt;/p&gt;

&lt;p&gt;Another side effect of this issue is that if there are multiple devices created/updated together, e.g. when controller is restarted with multiple devices configured, then several of them may not be activated even if there just one device with the configuration issue because processing is aborted for the rest once this error is encountered.&lt;/p&gt;</description>
                <environment></environment>
        <key id="37163">NETCONF-1114</key>
            <summary>Incorrect operational state of device configuration with Invalid encrypted password</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="3" iconUrl="https://jira.opendaylight.org/images/icons/statuses/inprogress.png" description="This issue is being actively worked on at the moment by the assignee.">In Progress</status>
                    <statusCategory id="4" key="indeterminate" colorName="yellow"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="PeterSuna">Peter Suna</assignee>
                                    <reporter username="sangwookha">Sangwook Ha</reporter>
                        <labels>
                            <label>pt</label>
                    </labels>
                <created>Thu, 3 Aug 2023 01:03:22 +0000</created>
                <updated>Fri, 3 Nov 2023 13:59:30 +0000</updated>
                                            <version>6.0.0</version>
                    <version>5.0.7</version>
                    <version>4.0.8</version>
                                    <fixVersion>7.0.0</fixVersion>
                                    <component>netconf</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="72505" author="JIRAUSER13216" created="Mon, 28 Aug 2023 08:01:00 +0000"  >&lt;p&gt;Root cause description &#8211; see &lt;a href=&quot;https://github.com/opendaylight/netconf/blob/master/apps/netconf-topology/src/main/java/org/opendaylight/netconf/topology/spi/AbstractNetconfTopology.java#L132&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;AbstractNetconfTopology#setupConnection(...)&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;on initialization of &lt;em&gt;deviceSalFacade&lt;/em&gt; variable the instance of NetconfDeviceTopologyAdapter is created which immediately (out of constructor) writes device connection status &quot;connecting&quot; to operational datastore.&lt;/li&gt;
	&lt;li&gt;on next variable &lt;em&gt;nodeHandler&lt;/em&gt; initialization the instance of NetconfNodeHandler is created, however building a client configuration (within constructor) RuntimeException occurs&lt;/li&gt;
	&lt;li&gt;as result &lt;em&gt;nodeHandler&lt;/em&gt; variable is not created and no handler being mapped to &lt;em&gt;nodeId&lt;/em&gt; within &lt;em&gt;activeConnectors&lt;/em&gt; map&lt;/li&gt;
	&lt;li&gt;when node deletion is requested no associated handler is found; due to operational data cleanup is performed via &lt;em&gt;nodeHandler&lt;/em&gt;.close() &#8211; which is transferred to &lt;a href=&quot;https://github.com/opendaylight/netconf/blob/master/apps/netconf-topology/src/main/java/org/opendaylight/netconf/topology/spi/NetconfDeviceTopologyAdapter.java#L201&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;NetconfDeviceTopologyAdapter#close()&lt;/a&gt;&#160;&#8211; then handler absence causes node data remaining in operational data store as garbage&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="72506" author="rovarga" created="Mon, 28 Aug 2023 09:23:10 +0000"  >&lt;p&gt;So the problem is that the password is allowed to be stored through the PUT request. As the expectation is to have if Base64-encoded, this should by expressed in the YANG model (via a pattern) and the datastore would reject it.&lt;/p&gt;</comment>
                            <comment id="72508" author="JIRAUSER13216" created="Tue, 29 Aug 2023 09:38:30 +0000"  >&lt;p&gt;the password encryption is out of scope for current task, the issue to be solved via &lt;a href=&quot;https://jira.opendaylight.org/browse/NETCONF-1115&quot; title=&quot;Handle unencrypted password in login-password for topology node&quot; class=&quot;issue-link&quot; data-issue-key=&quot;NETCONF-1115&quot;&gt;NETCONF-1115&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The issue with client configuration build failure can be also caused by missing credentials (NPE on building clientConfig). This also lead garbage data remain on node removal&lt;/p&gt;</comment>
                            <comment id="72654" author="ivanhrasko" created="Tue, 17 Oct 2023 11:15:42 +0000"  >&lt;p&gt;Yes, we have handled any possible exception that can occur. Fix is working but maybe in the future our logic would need more refactoring and better layering to avoid catching plain java&apos;s Exception class.&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_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i0462f:</customfieldvalue>

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