org.apache.sshd.common.SshException: Channel closed

Atlassian JIRA | Luuk van Raaij | 3 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    - Installed Bamboo version: 5.3 build 4101 - 10 Dec 13 - Bamboo is configured with Git repositories using "git@host.name:REPO/name" Repository URL's - Remote Git repository runs gitolite on a Gentoo server - Previously, that Gentoo gitolite server ran OpenSSH_5.9p1-hpn13v11, OpenSSL 1.0.1e 11 Feb 2013 as it's sshd - After upgrading the net-misc/openssh package on that machine to openssh-6.4_p1-r1, bamboo cannot check out any repository contained on that machine, failing with this message: {code} 2014-01-06 18:02:03,027 WARN [NioProcessor-1] [ClientSessionImpl] Exception caught java.lang.IllegalStateException: Unsupported command: SSH_MSG_KEXINIT at org.apache.sshd.client.session.ClientSessionImpl.doHandleMessage(ClientSessionImpl.java:440) at org.apache.sshd.client.session.ClientSessionImpl.handleMessage(ClientSessionImpl.java:307) at org.apache.sshd.common.session.AbstractSession.decode(AbstractSession.java:566) at org.apache.sshd.common.session.AbstractSession.messageReceived(AbstractSession.java:236) at org.apache.sshd.common.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:58) at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:716) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796) at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426) at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:697) at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:651) at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:640) at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:67) at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1111) at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) 2014-01-06 18:02:03,028 WARN [Connection monitoring thread - 9958077f-ce4f-4e46-9138-9fae93832b7b] [SshProxyCommand] While connecting to [git@host.name/host.ip.address:22]: Error opening exec channel org.apache.sshd.common.SshException: Channel closed at org.apache.sshd.client.channel.AbstractClientChannel.close(AbstractClientChannel.java:90) at org.apache.sshd.common.session.AbstractSession.close(AbstractSession.java:314) at org.apache.sshd.client.session.ClientSessionImpl.close(ClientSessionImpl.java:301) at org.apache.sshd.common.session.AbstractSession.exceptionCaught(AbstractSession.java:276) at org.apache.sshd.common.AbstractSessionIoHandler.exceptionCaught(AbstractSessionIoHandler.java:50) at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.exceptionCaught(DefaultIoFilterChain.java:697) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextExceptionCaught(DefaultIoFilterChain.java:483) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1100(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.exceptionCaught(DefaultIoFilterChain.java:791) at org.apache.mina.core.filterchain.IoFilterAdapter.exceptionCaught(IoFilterAdapter.java:111) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextExceptionCaught(DefaultIoFilterChain.java:483) at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireExceptionCaught(DefaultIoFilterChain.java:471) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:437) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796) at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426) at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:697) at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:651) at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:640) at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:67) at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1111) at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) 2014-01-06 18:02:03,030 INFO [4-BAM::PlanExec:pool-7-thread-4] [RetryingTaskExecutor] Task 'Collecting changes for XXXX-YYY' was unsuccessful. Run 2 / 2. Exception thrown when running task 'Collecting changes for XXXX-YYY', with message: com.atlassian.bamboo.plugins.git.GitCommandException: command /usr/bin/git ls-remote ssh://9958077f-ce4f-4e46-9138-9fae93832b7b@127.0.0.1:56820/XXXX/ZZZZ failed with code 128. Working directory was [.]., stderr: Error opening exec channel stdout: [BAMBOO-SSH-PROXY: [While connecting to [git@host.name/host.ip.address:22]: Error opening exec channel: Channel closed], fatal: The remote end hung up unexpectedly] 2014-01-06 18:02:03,030 ERROR [4-BAM::PlanExec:pool-7-thread-4] [RetryingTaskExecutor] Failed to run task 'Collecting changes for XXXX-YYY' after 2 attempts. Task was not executed. {code} This only occurs with Bamboo. Regular ssh and 'git ls-remote' commands from the CLI work as expected against the host. After downgrading the remote OpenSSH server back to 5.9 all is fine once more.

    Atlassian JIRA | 3 years ago | Luuk van Raaij
    org.apache.sshd.common.SshException: Channel closed
  2. 0

    - Installed Bamboo version: 5.3 build 4101 - 10 Dec 13 - Bamboo is configured with Git repositories using "git@host.name:REPO/name" Repository URL's - Remote Git repository runs gitolite on a Gentoo server - Previously, that Gentoo gitolite server ran OpenSSH_5.9p1-hpn13v11, OpenSSL 1.0.1e 11 Feb 2013 as it's sshd - After upgrading the net-misc/openssh package on that machine to openssh-6.4_p1-r1, bamboo cannot check out any repository contained on that machine, failing with this message: {code} 2014-01-06 18:02:03,027 WARN [NioProcessor-1] [ClientSessionImpl] Exception caught java.lang.IllegalStateException: Unsupported command: SSH_MSG_KEXINIT at org.apache.sshd.client.session.ClientSessionImpl.doHandleMessage(ClientSessionImpl.java:440) at org.apache.sshd.client.session.ClientSessionImpl.handleMessage(ClientSessionImpl.java:307) at org.apache.sshd.common.session.AbstractSession.decode(AbstractSession.java:566) at org.apache.sshd.common.session.AbstractSession.messageReceived(AbstractSession.java:236) at org.apache.sshd.common.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:58) at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:716) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796) at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426) at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:697) at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:651) at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:640) at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:67) at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1111) at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) 2014-01-06 18:02:03,028 WARN [Connection monitoring thread - 9958077f-ce4f-4e46-9138-9fae93832b7b] [SshProxyCommand] While connecting to [git@host.name/host.ip.address:22]: Error opening exec channel org.apache.sshd.common.SshException: Channel closed at org.apache.sshd.client.channel.AbstractClientChannel.close(AbstractClientChannel.java:90) at org.apache.sshd.common.session.AbstractSession.close(AbstractSession.java:314) at org.apache.sshd.client.session.ClientSessionImpl.close(ClientSessionImpl.java:301) at org.apache.sshd.common.session.AbstractSession.exceptionCaught(AbstractSession.java:276) at org.apache.sshd.common.AbstractSessionIoHandler.exceptionCaught(AbstractSessionIoHandler.java:50) at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.exceptionCaught(DefaultIoFilterChain.java:697) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextExceptionCaught(DefaultIoFilterChain.java:483) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1100(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.exceptionCaught(DefaultIoFilterChain.java:791) at org.apache.mina.core.filterchain.IoFilterAdapter.exceptionCaught(IoFilterAdapter.java:111) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextExceptionCaught(DefaultIoFilterChain.java:483) at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireExceptionCaught(DefaultIoFilterChain.java:471) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:437) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796) at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426) at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:697) at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:651) at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:640) at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:67) at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1111) at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) 2014-01-06 18:02:03,030 INFO [4-BAM::PlanExec:pool-7-thread-4] [RetryingTaskExecutor] Task 'Collecting changes for XXXX-YYY' was unsuccessful. Run 2 / 2. Exception thrown when running task 'Collecting changes for XXXX-YYY', with message: com.atlassian.bamboo.plugins.git.GitCommandException: command /usr/bin/git ls-remote ssh://9958077f-ce4f-4e46-9138-9fae93832b7b@127.0.0.1:56820/XXXX/ZZZZ failed with code 128. Working directory was [.]., stderr: Error opening exec channel stdout: [BAMBOO-SSH-PROXY: [While connecting to [git@host.name/host.ip.address:22]: Error opening exec channel: Channel closed], fatal: The remote end hung up unexpectedly] 2014-01-06 18:02:03,030 ERROR [4-BAM::PlanExec:pool-7-thread-4] [RetryingTaskExecutor] Failed to run task 'Collecting changes for XXXX-YYY' after 2 attempts. Task was not executed. {code} This only occurs with Bamboo. Regular ssh and 'git ls-remote' commands from the CLI work as expected against the host. After downgrading the remote OpenSSH server back to 5.9 all is fine once more.

    Atlassian JIRA | 3 years ago | Luuk van Raaij
    org.apache.sshd.common.SshException: Channel closed
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.apache.sshd.common.SshException

      Channel closed

      at org.apache.sshd.client.channel.AbstractClientChannel.close()
    2. Apache Mina SSHD :: Core
      AbstractSessionIoHandler.exceptionCaught
      1. org.apache.sshd.client.channel.AbstractClientChannel.close(AbstractClientChannel.java:90)
      2. org.apache.sshd.common.session.AbstractSession.close(AbstractSession.java:314)
      3. org.apache.sshd.client.session.ClientSessionImpl.close(ClientSessionImpl.java:301)
      4. org.apache.sshd.common.session.AbstractSession.exceptionCaught(AbstractSession.java:276)
      5. org.apache.sshd.common.AbstractSessionIoHandler.exceptionCaught(AbstractSessionIoHandler.java:50)
      5 frames
    3. Apache MINA Core
      AbstractPollingIoProcessor$Processor.run
      1. org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.exceptionCaught(DefaultIoFilterChain.java:697)
      2. org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextExceptionCaught(DefaultIoFilterChain.java:483)
      3. org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1100(DefaultIoFilterChain.java:46)
      4. org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.exceptionCaught(DefaultIoFilterChain.java:791)
      5. org.apache.mina.core.filterchain.IoFilterAdapter.exceptionCaught(IoFilterAdapter.java:111)
      6. org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextExceptionCaught(DefaultIoFilterChain.java:483)
      7. org.apache.mina.core.filterchain.DefaultIoFilterChain.fireExceptionCaught(DefaultIoFilterChain.java:471)
      8. org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:437)
      9. org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
      10. org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)
      11. org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)
      12. org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
      13. org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)
      14. org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:697)
      15. org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:651)
      16. org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:640)
      17. org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:67)
      18. org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1111)
      18 frames
    4. MINA
      NamePreservingRunnable.run
      1. org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
      1 frame
    5. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      3. java.lang.Thread.run(Thread.java:662)
      3 frames