question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

We have switch: EDGE-CORE ECS3510-52T When we try to connect, we see “Channel closed.

image

Logs:

wssh --address='***' --port=80 --logging=debug --debug
[D 200127 16:29:51 selector_events:54] Using selector: EpollSelector
[D 200127 16:29:51 policy:29] {'autoaddpolicy': <class 'webssh.policy.AutoAddPolicy'>, 'rejectpolicy': <class 'paramiko.client.RejectPolicy'>, 'warningpolicy': <class 'paramiko.client.WarningPolicy'>}
[I 200127 16:29:51 settings:98] WarningPolicy
[I 200127 16:29:51 main:39] Listening on ***:80 (http)
[I 200127 16:30:17 web:2246] 200 GET /?hostname=10.221.185.62&username=***&password=*** (***) 3.20ms
[D 200127 16:30:17 handler:224] netloc: ***
[D 200127 16:30:17 handler:227] host: ***
[D 200127 16:30:17 handler:409] ('10.221.185.62', 22, '***', '***', None)
[I 200127 16:30:17 handler:442] Connecting to 10.221.185.62:22
[D 200127 16:30:17 transport:1819] starting thread (client mode): 0xc1684c18
[D 200127 16:30:17 transport:1819] Local version/idstring: SSH-2.0-paramiko_2.7.1
[D 200127 16:30:17 transport:1819] Remote version/idstring: SSH-1.99-SSH_0.2
[I 200127 16:30:17 transport:1819] Connected (version 1.99, client SSH_0.2)
[D 200127 16:30:17 transport:1819] kex algos:['diffie-hellman-group1-sha1'] server key:['ssh-dss'] client encrypt:['aes128-cbc', '3des-cbc', 'blowfish-cbc', 'aes192-cbc', 'aes256-cbc', 'des-cbc@ssh.com', 'des-cbc'] server encrypt:['aes128-cbc', '3des-cbc', 'blowfish-cbc', 'aes192-cbc', 'aes256-cbc', 'des-cbc@ssh.com', 'des-cbc'] client mac:['hmac-md5', 'hmac-sha1'] server mac:['hmac-md5', 'hmac-sha1'] client compress:['none'] server compress:['none'] client lang:[''] server lang:[''] kex follows?False
[D 200127 16:30:17 transport:1819] Kex agreed: diffie-hellman-group1-sha1
[D 200127 16:30:17 transport:1819] HostKey agreed: ssh-dss
[D 200127 16:30:17 transport:1819] Cipher agreed: aes128-cbc
[D 200127 16:30:17 transport:1819] MAC agreed: hmac-sha1
[D 200127 16:30:17 transport:1819] Compression agreed: none
[D 200127 16:30:17 transport:1819] kex engine KexGroup1 specified hash_algo <built-in function openssl_sha1>
[D 200127 16:30:17 transport:1819] Switch to new keys ...
[I 200127 16:30:17 handler:87] Trying password authentication
[D 200127 16:30:17 transport:1819] userauth is OK
[I 200127 16:30:18 transport:1819] Authentication (password) successful!
[D 200127 16:30:18 channel:1212] [chan 0] Max packet in: 32768 bytes
[D 200127 16:30:18 channel:1212] [chan 0] Max packet out: 32768 bytes
[D 200127 16:30:18 transport:1819] Secsh channel 0 opened.
[D 200127 16:30:18 channel:1212] [chan 0] Sesch channel 0 request ok
[D 200127 16:30:18 channel:1212] [chan 0] Sesch channel 0 request ok
[D 200127 16:30:18 channel:1212] [chan 1] Max packet in: 32768 bytes
[D 200127 16:30:18 channel:1212] [chan 1] Max packet out: 32768 bytes
[D 200127 16:30:18 transport:1819] Secsh channel 1 opened.
[D 200127 16:30:18 channel:1212] [chan 1] Sesch channel 1 request ok
[D 200127 16:30:18 channel:1212] [chan 1] EOF sent (1)
[E 200127 16:30:18 handler:505] Traceback (most recent call last):
      File "/usr/local/lib/python3.6/site-packages/webssh-1.5.0-py3.6.egg/webssh/handler.py", line 503, in post
        worker = yield future
      File "/usr/local/lib64/python3.6/site-packages/tornado-6.0.3-py3.6-linux-x86_64.egg/tornado/gen.py", line 735, in run
        value = future.result()
      File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 425, in result
        return self.__get_result()
      File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 384, in __get_result
        raise self._exception
      File "/usr/lib64/python3.6/concurrent/futures/thread.py", line 56, in run
        result = self.fn(*self.args, **self.kwargs)
      File "/usr/local/lib/python3.6/site-packages/webssh-1.5.0-py3.6.egg/webssh/handler.py", line 459, in ssh_connect
        worker.encoding = self.get_default_encoding(ssh)
      File "/usr/local/lib/python3.6/site-packages/webssh-1.5.0-py3.6.egg/webssh/handler.py", line 429, in get_default_encoding
        _, stdout, _ = ssh.exec_command(command, get_pty=True)
      File "/usr/local/lib/python3.6/site-packages/paramiko-2.7.1-py3.6.egg/paramiko/client.py", line 514, in exec_command
        chan.exec_command(command)
      File "/usr/local/lib/python3.6/site-packages/paramiko-2.7.1-py3.6.egg/paramiko/channel.py", line 72, in _check
        return func(self, *args, **kwds)
      File "/usr/local/lib/python3.6/site-packages/paramiko-2.7.1-py3.6.egg/paramiko/channel.py", line 257, in exec_command
        self._wait_for_event()
      File "/usr/local/lib/python3.6/site-packages/paramiko-2.7.1-py3.6.egg/paramiko/channel.py", line 1226, in _wait_for_event
        raise e
    paramiko.ssh_exception.SSHException: Channel closed.

[I 200127 16:30:18 web:2246] 200 POST /?hostname=10.221.185.62&username=***&password=*** (***) 934.57ms

Can we fix it or some workaround?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
huashengduncommented, Feb 13, 2020

Cool. Just added an option for specifying the default character encoding of your ssh servers. You can start the server like below,

wssh --encoding='utf-8'
1reaction
huashengduncommented, Jan 31, 2020

I guess maybe the ssh server on your device EDGE-CORE ECS3510-52T cannot handle multiple channels.

Try changing file handler.py by replacing the line worker.encoding = self.get_default_encoding(ssh) with worker.encoding = 'utf-8' to see if that change fixes it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Gracefully Close Channels - Go 101
One general principle of using Go channels is don't close a channel from the receiver side and don't close a channel if the...
Read more >
Closing Channels - Go by Example
Closing a channel indicates that no more values will be sent on it. This can be useful to communicate completion to the channel's...
Read more >
How to check a channel is closed or not without reading it?
So I think the best way to solve this is worker() close channel when exits, if the controller finds a channel closed, it...
Read more >
Check if a Go Channel is open or closed - gists · GitHub
Check if a Go Channel is open or closed. ... Testing some fucntion that SHOULD close the channel ... Make sure that the...
Read more >
Channel (Java Platform SE 7 ) - Oracle Help Center
A channel is either open or closed. A channel is open upon creation, and once closed it remains closed. Once a channel is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found