<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:16:20 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-961] CallHomeSessionContext session cannot be closed, so device could not make a new call-home connection</title>
                <link>https://jira.opendaylight.org/browse/NETCONF-961</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;We are using the lighty.io 15.1.0 version in our application. We have devices that uses netopeer2server for making call-home connection to the application. Sometimes, device connects and disconnects repeatedly when we start loading network traffic on device. At this step, after a time, opendaylight starts to log as below:&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;
2023-02-01 06:47:19.588 ERROR 1 .m.CallHomeMountSessionManager : Server Host Key/Certificate RSA Public Key [30:4e:62:da:08:41:35:80:85:7a:4b:86:3e:b6:ff:54:fe:07:f7:80],[56:66:d1:a4]
        modulus: bc625370b9fbdc38589892c0aba9c9ff1503662e6ea13194f847622d2c342a5979d0838be8dbfc9b08c8f8995257e6b77403a87f3c696ba6225a6cf03854c0d41bffa8346a054813931d6d518b1493fd0c12df92f8b3a13dc58a05ed6faaa262373fe8051162838f79c65c1d79d968528e1e3cb0b6a38168129dd6c86814472d991fbbe4b33ab182e825e67557a5f7b1165c672d1ef4ec3f6ac9d5a2615e076c32bd0c241f9a7414ab3920d9e11eb620489a983381cdf38b1875208a33a17302739166e0ac1119083221a3b292324eea92d88b74f27fc8eb342fbbea604d1011eeeaba525344269e7fb3f68e8092e45b3692a9e75b8618176de69ea0d8816cf3
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; exponent: 10001
 is associated with existing session CallHomeMountSessionContext{address=/172.23.0.5:41032, hostKey=RSA Public Key [30:4e:62:da:08:41:35:80:85:7a:4b:86:3e:b6:ff:54:fe:07:f7:80],[56:66:d1:a4]
        modulus: bc625370b9fbdc38589892c0aba9c9ff1503662e6ea13194f847622d2c342a5979d0838be8dbfc9b08c8f8995257e6b77403a87f3c696ba6225a6cf03854c0d41bffa8346a054813931d6d518b1493fd0c12df92f8b3a13dc58a05ed6faaa262373fe8051162838f79c65c1d79d968528e1e3cb0b6a38168129dd6c86814472d991fbbe4b33ab182e825e67557a5f7b1165c672d1ef4ec3f6ac9d5a2615e076c32bd0c241f9a7414ab3920d9e11eb620489a983381cdf38b1875208a33a17302739166e0ac1119083221a3b292324eea92d88b74f27fc8eb342fbbea604d1011eeeaba525344269e7fb3f68e8092e45b3692a9e75b8618176de69ea0d8816cf3
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; exponent: 10001
}, closing session org.opendaylight.netconf.callhome.protocol.CallHomeSessionContext@2a79b789 &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Log says that there is an existing session with the public key, so I guess it is rejecting and closing the incoming session.&lt;/p&gt;

&lt;p&gt;After we start to see this log, device cannot makes a call-home connection anymore. Even restarting netopeer2server or rebooting device do not change the situation. Only solution is restarting our application. But that is not wanted in production enviroment.&lt;/p&gt;

&lt;p&gt;Log is printed by CallHomeMountSessionManager class. When I checked the code, I saw that deviceContext is kept in the below ConcurrentMap by device&apos;s SSH public key:&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;private&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; ConcurrentMap&amp;lt;PublicKey, CallHomeMountSessionContext&amp;gt; contextByPublicKey = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ConcurrentHashMap&amp;lt;&amp;gt;(); &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I think, the entry related with public key stays in the map and cannot be removed somehow. Maybe, this causes the problem.&lt;/p&gt;

&lt;p&gt;Note: We changed ODL core property: IDLE_TIMEOUT to 2 minutes.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment>&lt;ul&gt;
	&lt;li&gt;Lighty.io version -&amp;gt; 15.1.0&lt;/li&gt;
	&lt;li&gt;Lighty.io 15.1.0 uses ODL netconf 2.0.9&lt;/li&gt;
	&lt;li&gt;Java 11&lt;/li&gt;
&lt;/ul&gt;
</environment>
        <key id="36661">NETCONF-961</key>
            <summary>CallHomeSessionContext session cannot be closed, so device could not make a new call-home connection</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.opendaylight.org/images/icons/priorities/critical.svg">High</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="10001">Won&apos;t Do</resolution>
                                        <assignee username="ivanhrasko">Ivan Hrasko</assignee>
                                    <reporter username="sekobey">Serkan Y&#305;ld&#305;r&#305;m</reporter>
                        <labels>
                            <label>pt</label>
                    </labels>
                <created>Thu, 9 Feb 2023 08:25:27 +0000</created>
                <updated>Wed, 21 Jun 2023 07:44:19 +0000</updated>
                            <resolved>Wed, 19 Apr 2023 11:48:32 +0000</resolved>
                                                                    <component>netconf</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="72015" author="ivanhrasko" created="Thu, 16 Feb 2023 08:00:49 +0000"  >&lt;p&gt;The logs look very similar to &lt;a href=&quot;https://jira.opendaylight.org/browse/NETCONF-942&quot; title=&quot;Callhome session is closed after allowing device to connect&quot; class=&quot;issue-link&quot; data-issue-key=&quot;NETCONF-942&quot;&gt;&lt;del&gt;NETCONF-942&lt;/del&gt;&lt;/a&gt;. Version 2.0.9 however is not affected by that bug.&lt;/p&gt;</comment>
                            <comment id="72016" author="ivanhrasko" created="Thu, 16 Feb 2023 11:49:45 +0000"  >&lt;p&gt;Steps to reproduce with version 2.0.9.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Setup netopeer2 call-home device&lt;/li&gt;
	&lt;li&gt;Add netopeer2 to allowed call-home devices == device is connected successfully&lt;/li&gt;
	&lt;li&gt;Delete all allowed devices&lt;/li&gt;
	&lt;li&gt;Add netopeer2 to allowed call-home devices again == device is connected but failed in call-home configuration&lt;/li&gt;
	&lt;li&gt;After 10 minutes there will be reconnect, block execution by debugger in &lt;b&gt;CallHomeMountSessionManager#createSession&lt;/b&gt;&lt;/li&gt;
	&lt;li&gt;Session fails to establish and we get logs as described in bug report&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Even after more than 1 hour the /rests/data/odl-netconf-callhome-server:netconf-callhome-server shows &lt;b&gt;FAILED&lt;/b&gt; status and node in netconf topology is &lt;b&gt;connecting&lt;/b&gt;.&lt;/p&gt;</comment>
                            <comment id="72018" author="JIRAUSER15909" created="Sat, 18 Feb 2023 18:49:39 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=ivanhrasko&quot; class=&quot;user-hover&quot; rel=&quot;ivanhrasko&quot;&gt;ivanhrasko&lt;/a&gt; ,&lt;/p&gt;

&lt;p&gt;We solved this by adding the lines below to the createSession method in&#160;&lt;br/&gt;
CallHomeMountSessionManager class.&lt;br/&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;
CallHomeMountSessionContext createSession(&lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; CallHomeProtocolSessionContext session,
        &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; CallHomeChannelActivator activator, &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; CloseCallback onCloseHandler) {
    &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; CallHomeMountSessionContext deviceContext = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; CallHomeMountSessionContext(session.getSessionId(),
        session, activator, devCtxt -&amp;gt; onClosed(devCtxt, onCloseHandler));

    &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; PublicKey remoteKey = session.getRemoteServerKey();
    &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; CallHomeMountSessionContext existing = contextByPublicKey.putIfAbsent(remoteKey, deviceContext);
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (existing != &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
        &lt;span class=&quot;code-comment&quot;&gt;// Check &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; the sshkey or certificate of the incoming netconf server is present. If present &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;,
&lt;/span&gt;        &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; store the session. The sshkey/certificate is the uniqueness of the callhome sessions not the
&lt;/span&gt;        &lt;span class=&quot;code-comment&quot;&gt;// uniqueid/devicename
&lt;/span&gt;        LOG.error(&lt;span class=&quot;code-quote&quot;&gt;&quot;Server Host Key/Certificate {} is associated with existing session {}, closing session {}&quot;&lt;/span&gt;,
            remoteKey, existing, session);
        session.terminate();
        &lt;span class=&quot;code-comment&quot;&gt;// Added code - start
&lt;/span&gt;        existing.getProtocol().terminate();
        contextByPublicKey.remove(remoteKey);
        &lt;span class=&quot;code-comment&quot;&gt;// Added code - finish
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; SocketAddress remoteAddress = session.getRemoteAddress();
    &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; CallHomeMountSessionContext prev = contextByAddress.put(remoteAddress, deviceContext);
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (prev != &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
        LOG.warn(&lt;span class=&quot;code-quote&quot;&gt;&quot;Remote {} replaced context {} with {}&quot;&lt;/span&gt;, remoteAddress, prev, deviceContext);
    }
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; deviceContext;
} &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="72019" author="ivanhrasko" created="Mon, 20 Feb 2023 07:28:26 +0000"  >&lt;p&gt;Thanks, I will check it. Anyway I thing that this problem has been solved in &lt;a href=&quot;https://jira.opendaylight.org/browse/NETCONF-681&quot; title=&quot;Netconf Callhome SSH: drop connections&quot; class=&quot;issue-link&quot; data-issue-key=&quot;NETCONF-681&quot;&gt;&lt;del&gt;NETCONF-681&lt;/del&gt;&lt;/a&gt;. Thus in recent netconf/lighty.io versions the problem should be fixed.&lt;/p&gt;

&lt;p&gt;This needs to be verified. I have not tried to reproduce the issue on current releases yet.&lt;/p&gt;</comment>
                            <comment id="72020" author="ivanhrasko" created="Mon, 20 Feb 2023 07:30:14 +0000"  >&lt;p&gt;Are you able to make unit test for this? So we can test your changes in 2.0.x and current 5.x?&lt;/p&gt;</comment>
                            <comment id="72025" author="JIRAUSER15909" created="Mon, 27 Feb 2023 06:32:45 +0000"  >&lt;p&gt;Sorry for late response Ivan. I could not see a unit test for class&#160;&lt;br/&gt;
CallHomeMountSessionManager class. Therefore, I did not write it from scratch. Is there a doc for implementing new unit tests?&lt;/p&gt;</comment>
                            <comment id="72108" author="JIRAUSER15510" created="Wed, 5 Apr 2023 14:10:07 +0000"  >&lt;p&gt;Testing 2.0.x with patch from &lt;a href=&quot;https://jira.opendaylight.org/browse/NETCONF-681&quot; title=&quot;Netconf Callhome SSH: drop connections&quot; class=&quot;issue-link&quot; data-issue-key=&quot;NETCONF-681&quot;&gt;&lt;del&gt;NETCONF-681&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Setup netopeer2 call-home device&lt;/li&gt;
	&lt;li&gt;Add netopeer2 to allowed call-home devices == device is connected successfully&lt;/li&gt;
	&lt;li&gt;Delete all allowed devices&lt;/li&gt;
	&lt;li&gt;Add netopeer2 to allowed call-home devices again == device is connected but failed in call-home configuration&lt;br/&gt;
After that action we don&apos;t see successful reconnection:&lt;/li&gt;
&lt;/ul&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;
12:46:50.047 INFO [opendaylight-cluster-data-notification-dispatcher-35] Deleting the entry &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; callhome device InstanceIdentifier{targetType=&lt;span class=&quot;code-keyword&quot;&gt;interface&lt;/span&gt; org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netconf.callhome.server.rev201015.netconf.callhome.server.AllowedDevices, path=[org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netconf.callhome.server.rev201015.NetconfCallhomeServer, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netconf.callhome.server.rev201015.netconf.callhome.server.AllowedDevices]}
13:46:10.284 INFO [nioEventLoopGroup-4-3] requestNewKeysExchange(ClientSessionImpl[netconf@/172.17.0.2:42848]) Initiating key re-exchange
14:46:12.928 INFO [nioEventLoopGroup-4-3] requestNewKeysExchange(ClientSessionImpl[netconf@/172.17.0.2:42848]) Initiating key re-exchange
15:46:15.220 INFO [nioEventLoopGroup-4-3] requestNewKeysExchange(ClientSessionImpl[netconf@/172.17.0.2:42848]) Initiating key re-exchange &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;After more than 3 hours the /rests/data/odl-netconf-callhome-server:netconf-callhome-server shows &lt;b&gt;DISCONNECTED&lt;/b&gt; status although the node in netconf topology is &lt;b&gt;connected&lt;/b&gt;.&lt;/p&gt;</comment>
                            <comment id="72113" author="ivanhrasko" created="Wed, 12 Apr 2023 13:13:38 +0000"  >&lt;p&gt;We expect device connects again, please see new issue here: &lt;a href=&quot;https://jira.opendaylight.org/browse/NETCONF-989&quot; title=&quot;Reconnection failure after deleting and re-adding call-home devices&quot; class=&quot;issue-link&quot; data-issue-key=&quot;NETCONF-989&quot;&gt;NETCONF-989&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="72120" author="ivanhrasko" created="Wed, 19 Apr 2023 11:47:36 +0000"  >&lt;p&gt;By cherry-picking of &lt;a href=&quot;https://git.opendaylight.org/gerrit/c/netconf/+/105212&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/c/netconf/+/105212&lt;/a&gt; we have verified that &lt;a href=&quot;https://jira.opendaylight.org/browse/NETCONF-681&quot; title=&quot;Netconf Callhome SSH: drop connections&quot; class=&quot;issue-link&quot; data-issue-key=&quot;NETCONF-681&quot;&gt;&lt;del&gt;NETCONF-681&lt;/del&gt;&lt;/a&gt; has fixed this issue. Unfortunately netconf 2.x is no more maintained and we recommend users to upgrade.&lt;/p&gt;

&lt;p&gt;During investigating this issue we have found out new one &lt;a href=&quot;https://jira.opendaylight.org/browse/NETCONF-989&quot; title=&quot;Reconnection failure after deleting and re-adding call-home devices&quot; class=&quot;issue-link&quot; data-issue-key=&quot;NETCONF-989&quot;&gt;NETCONF-989&lt;/a&gt; which is present also on current master branch. It will be addressed separately.&lt;/p&gt;</comment>
                            <comment id="72121" author="ivanhrasko" created="Wed, 19 Apr 2023 11:48:32 +0000"  >&lt;p&gt;The netconf 2.x branch is no more maintained. Current releases are not affected by this issue.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10002">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="32632">NETCONF-681</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                                                <inwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="36823">NETCONF-989</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="18603" name="reproduced-2.0.9.karaf.log" size="1609542" author="ivanhrasko" created="Thu, 16 Feb 2023 11:53:56 +0000"/>
                    </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_10202" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Priority</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10312"><![CDATA[High]]></customfieldvalue>

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

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