You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Guillaume Nodet (JIRA)" <ji...@apache.org> on 2015/04/16 11:35:59 UTC

[jira] [Resolved] (KARAF-3656) SSH message channel closed too early

     [ https://issues.apache.org/jira/browse/KARAF-3656?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet resolved KARAF-3656.
------------------------------------
    Resolution: Fixed

https://git-wip-us.apache.org/repos/asf?p=karaf.git;a=commitdiff;h=6cf9a4d29f1698f14d2eed06cd728d31c9e7870c

https://git-wip-us.apache.org/repos/asf?p=karaf.git;a=commitdiff;h=863fb2f675ef296f55b2d9a06d2433c2dbe75b77

https://git-wip-us.apache.org/repos/asf?p=karaf.git;a=commitdiff;h=cda2721a2306d3ef7373b557b452f12a62cfeb92

https://git-wip-us.apache.org/repos/asf?p=karaf.git;a=commitdiff;h=502aeea752cf1bd8f77aca8addc69631facb7390

> SSH message channel closed too early
> ------------------------------------
>
>                 Key: KARAF-3656
>                 URL: https://issues.apache.org/jira/browse/KARAF-3656
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-shell
>    Affects Versions: 3.0.3, 2.4.1, 2.3.10, 4.0.0.M2
>            Reporter: Jan-Peter Nilsson
>            Assignee: Guillaume Nodet
>            Priority: Minor
>             Fix For: 2.4.2, 3.0.4, 2.3.12, 4.0.0.M3
>
>         Attachments: 0001-KARAF-3656-Spawn-a-new-thread-for-ShellCommand.start.patch
>
>
> Using SSH exec with Karaf 2.3.10 SSH_MSG_CHANNEL_SUCCESS is sent after SSH_MSG_CHANNEL_CLOSE in the response.
> This causes problems when trying to use the Paramiko SSH client library as it will close the channel on receiving SSH_MSG_CHANNEL_CLOSE and considers it a failure if SSH_MSG_CHANNEL_SUCCESS was not received.
> {code:title=reproduce.py|borderStyle=solid}
> #!/usr/bin/python
> import paramiko
> client = paramiko.SSHClient()
> client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
> client.load_system_host_keys()
> client.connect('localhost', port=8101, username="karaf", password="karaf")
> client.exec_command('help')
> # Throws SSHException "Channel closed." for affected versions.
> {code}
> The reason SUCCESS and CLOSE come out of order seems to be that start in the ShellCommand class does not spawn a separate thread but calls the onExit callback from within the same thread, see [SSHD-295|https://issues.apache.org/jira/browse/SSHD-295] and the [Apache MINA SSHD API|http://mina.apache.org/sshd-project/apidocs/org/apache/sshd/server/Command.html#start-org.apache.sshd.server.Environment-].



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)