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

Guillaume Nodet edited comment on SSHD-290 at 2/12/14 3:34 PM:
---------------------------------------------------------------

The problem is your client really.  It may work on openssh but it still does 
not follow the SSH protocol correctly.

A workaround could be to hack the following file:
https://github.com/apache/mina-sshd/blob/master/sshd-core/src/main/java/org/apache/sshd/common/session/AbstractConnectionService.java#L61

Instead of 
{code}
protected static final AtomicInteger nextChannelId = new AtomicInteger(100);
{code}
you can try with
{code}
protected final AtomicInteger nextChannelId = new AtomicInteger(0);
{code}

It should work better, but the client is still broken and other use cases could 
fail, for example if using port forwarding where the client does not control 
channels.


was (Author: gnt):
A workaround could be to hack the following file:
https://github.com/apache/mina-sshd/blob/master/sshd-core/src/main/java/org/apache/sshd/common/session/AbstractConnectionService.java#L61

Instead of 
{code}
protected static final AtomicInteger nextChannelId = new AtomicInteger(100);
{code}
you can try with
{code}
protected final AtomicInteger nextChannelId = new AtomicInteger(0);
{code}

It should work better, but the client is still broken and other use cases could 
fail, for example if using port forwarding where the client does not control 
channels.

> Received SSH_MSG_CHANNEL_REQUEST on unknown channel 0
> -----------------------------------------------------
>
>                 Key: SSHD-290
>                 URL: https://issues.apache.org/jira/browse/SSHD-290
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 0.9.0
>            Reporter: Tuan Do
>         Attachments: SSHD_Error.txt
>
>
> SSHD Server closing session after Received SSH_MSG_CHANNEL_REQUEST on unknown 
> channel 0.
> org.apache.sshd.common.SshException: Received SSH_MSG_CHANNEL_REQUEST on 
> unknown channel 0
>       at 
> org.apache.sshd.common.session.AbstractSession.getChannel(AbstractSession.java:1110)
>  ~[sshd-core-0.9.0.jar:0.9.0]
>       at 
> org.apache.sshd.common.session.AbstractSession.channelRequest(AbstractSession.java:1082)
>  ~[sshd-core-0.9.0.jar:0.9.0]
>       at 
> org.apache.sshd.server.session.ServerSession.running(ServerSession.java:240) 
> ~[sshd-core-0.9.0.jar:0.9.0]
>       at 
> org.apache.sshd.server.session.ServerSession.handleMessage(ServerSession.java:216)
>  ~[sshd-core-0.9.0.jar:0.9.0]
>       at 
> org.apache.sshd.common.session.AbstractSession.decode(AbstractSession.java:587)
>  ~[sshd-core-0.9.0.jar:0.9.0]
>       at 
> org.apache.sshd.common.session.AbstractSession.messageReceived(AbstractSession.java:253)
>  ~[sshd-core-0.9.0.jar:0.9.0]
>       at 
> org.apache.sshd.common.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:54)
>  ~[sshd-core-0.9.0.jar:0.9.0]
>       at 
> org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:231) 
> [sshd-core-0.9.0.jar:0.9.0]
>       at 
> org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:217) 
> [sshd-core-0.9.0.jar:0.9.0]
>       at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126) [na:1.7.0_21]
>       at sun.nio.ch.Invoker$2.run(Invoker.java:206) [na:1.7.0_21]
>       at 
> sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
>  [na:1.7.0_21]
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>  [na:1.7.0_21]
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>  [na:1.7.0_21]
>       at java.lang.Thread.run(Thread.java:722) [na:1.7.0_21]



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to