[jira] [Commented] (SSHD-891) SSh connections gets closed for every one hour with 0.13.0 version

2019-02-16 Thread Goldstein Lyor (JIRA)


[ 
https://issues.apache.org/jira/browse/SSHD-891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16770161#comment-16770161
 ] 

Goldstein Lyor commented on SSHD-891:
-

Sorry - the log you attached is incomplete at best - a lot of crucial 
information is lacking so I dare not venture a guess. Furthermore, since I have 
no idea whatsoever what your code is trying to achieve and how, I do not want 
to mislead you by speculating. However:

* You claim to have upgraded from 0.13.0 to 2.1.0 (actually I recommend you 
upgrade to the newly released 2.2.0). This is a huge leap between virtually 
incompatible versions. I strongly suggest you
** Recompile the code that invokes SSHD code - I have a feeling the upgrade 
from 0.13.0 to 2.1.0 (or 2.2.0) is not as smooth as it may seem
** Read the [documentation|https://github.com/apache/mina-sshd/] - perhaps more 
than once since there are may non-trivial concepts - including configurations, 
behavior, etc...
** Re-visit key RFC sections (most are mentioned in the documentation) to have 
a better understanding of the protocol
** Review your code in view of what you have learned and try to figure out what 
is going on and why it is failing
** Open relevant log levels and provide more information - not only the 
exception but also what led to it, what was the code trying to do when the 
exception occurred, what SSH messages were being exchanged etc,...

Best I can do for now with the limited information I can glean from the issue 
and without actually seeing the code in question or have full log information. 
My *wild guess* based on the exception is that the client fails to write a 
packet to its peer - as to why, your guess is as good as mine...

{quote}
And with respect to setting the state of sshd we are not able to access the 
state variable from ssh-server package as state varaible is made protected in 
ssh-common package
{quote}
I do not understand why you need access to this variable...

> SSh connections gets closed for every one hour with 0.13.0 version
> --
>
> Key: SSHD-891
> URL: https://issues.apache.org/jira/browse/SSHD-891
> Project: MINA SSHD
>  Issue Type: Bug
>Reporter: Anudeep
>Assignee: Goldstein Lyor
>Priority: Blocker
>
> SSH connections are getting closed for every one hours after 10 mins of idle 
> time even though there are incoming pacets data is not being wriiten to 
> client for every one hour and is being idle(10 mins which is default timeout 
> of ssh session).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SSHD-891) SSh connections gets closed for every one hour with 0.13.0 version

2019-02-16 Thread Anudeep (JIRA)


[ 
https://issues.apache.org/jira/browse/SSHD-891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16770055#comment-16770055
 ] 

Anudeep commented on SSHD-891:
--

Hi [~lgoldstein],

We have uplifted sshd-core version from 0.13.0 to 2.1.0.

But with 2.1.0 we see many impacts

one such is client session is getting closed abruptly after few minutes

Please find below logs
{code:java}
[id=0, recipient=43]-ServerSessionImpl[administrator@/141.137.237.205:58516]) 
by 4 down to 191244
2019-02-16 06:34:10,697 DEBUG [org.apache.sshd.common.io.nio2.Nio2Session] (EJB 
default - 44) writePacket(Nio2Session[local=/10.247.
246.100:8345, remote=/141.137.237.205:58516]) Writing 68 bytes
2019-02-16 06:34:10,697 DEBUG [org.apache.sshd.common.io.nio2.Nio2Session] 
(sshd-SshServer[5c704bd8]-nio2-thread-3) 
handleCompletedWriteCycle(Nio2Session[local=/10.247.246.100:8345, 
remote=/141.137.237.205:58516]) finished writing len=68
2019-02-16 06:34:17,050 DEBUG [org.apache.sshd.common.io.nio2.Nio2Session] 
(sshd-SshServer[5c704bd8]-nio2-thread-1) 
exceptionCaught(Nio2Session[local=/10.247.246.100:8345, 
remote=/141.137.237.205:58516]) caught InterruptedByTimeoutException[null] - 
calling handler
2019-02-16 06:34:17,050 WARN [org.apache.sshd.server.session.ServerSessionImpl] 
(sshd-SshServer[5c704bd8]-nio2-thread-1) 
exceptionCaught(ServerSessionImpl[administrator@/141.137.237.205:58516])[state=Opened]
 InterruptedByTimeoutException: null
2019-02-16 06:34:17,050 DEBUG 
[org.apache.sshd.server.session.ServerSessionImpl] 
(sshd-SshServer[5c704bd8]-nio2-thread-1) 
exceptionCaught(ServerSessionImpl[administrator@/141.137.237.205:58516])[state=Opened]
 details: java.nio.channels.InterruptedByTimeoutException
at 
sun.nio.ch.UnixAsynchronousSocketChannelImpl$1.run(UnixAsynchronousSocketChannelImpl.java:456)
 [rt.jar:1.8.0_172]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
[rt.jar:1.8.0_172]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_172]
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
 [rt.jar:1.8.0_172]
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
 [rt.jar:1.8.0_172]
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
[rt.jar:1.8.0_172]
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
[rt.jar:1.8.0_172]
at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_172]

2019-02-16 06:34:17,053 DEBUG 
[org.apache.sshd.common.session.helpers.SessionTimeoutListener] 
(sshd-SshServer[5c704bd8]-nio2-thread-1) 
sessionException(ServerSessionImpl[administrator@/141.137.237.205:58516]) 
InterruptedByTimeoutException: null
2019-02-16 06:34:17,053 DEBUG 
[org.apache.sshd.common.session.helpers.SessionTimeoutListener] 
(sshd-SshServer[5c704bd8]-nio2-thread-1) 
sessionClosed(ServerSessionImpl[administrator@/141.137.237.205:58516]) 
un-tracked
2019-02-16 06:34:17,053 DEBUG 
[org.apache.sshd.server.session.ServerSessionImpl] 
(sshd-SshServer[5c704bd8]-nio2-thread-1) 
close(ServerSessionImpl[administrator@/141.137.237.205:58516]) Closing 
immediately
2019-02-16 06:34:17,053 DEBUG 
[org.apache.sshd.server.session.ServerConnectionService] 
(sshd-SshServer[5c704bd8]-nio2-thread-1) 
close(ServerConnectionService[ServerSessionImpl[administrator@/141.137.237.205:58516]])
 Closing immediately
2019-02-16 06:34:17,054 DEBUG [org.apache.sshd.server.channel.ChannelSession] 
(sshd-SshServer[5c704bd8]-nio2-thread-1) close(ChannelSession[id=0, 
recipient=43]-ServerSessionImpl[administrator@/141.137.237.205:58516]) Closing 
immediately
2019-02-16 06:34:17,054 DEBUG [org.apache.sshd.server.channel.ChannelSession] 
(sshd-SshServer[5c704bd8]-nio2-thread-1) close(Channel:
{code}

And with respect to setting the state of sshd we are not able to access the 
state variable from ssh-server package as state varaible is made protected in 
ssh-common package

{code}
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.apache.sshd.common.util.closeable;

import java.util.concurrent.atomic.AtomicRef