Netmiko on Cisco NCS router not reliable #2170
Unanswered
somebody78
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm using Nornir with Netmiko to configure some Cisco NCS router running IOS-XR and having some trouble with that.
Every now and then the configuration fails.
Unfortunately the error messages indicate the current problem but not the underlying reason. I suspect that some the router's output contains some unexpected characters or something is missing.
When I try the same script or another script again after some minutes everything is working fine and as expected.
Unfortunately I cannot pinpoint the problem. Is there anything I can do to get some details about what is going on?
This is the last error message I received:
_2021-03-01 16:38:27 paramiko.transport DEBUG starting thread (client mode): 0x9fb34d68
2021-03-01 16:38:27 paramiko.transport DEBUG Local version/idstring: SSH-2.0-paramiko_2.7.2
2021-03-01 16:38:27 paramiko.transport DEBUG starting thread (client mode): 0x9fab88d0
2021-03-01 16:38:27 paramiko.transport DEBUG starting thread (client mode): 0x9fab8fd0
2021-03-01 16:38:27 paramiko.transport DEBUG Local version/idstring: SSH-2.0-paramiko_2.7.2
2021-03-01 16:38:27 paramiko.transport DEBUG Local version/idstring: SSH-2.0-paramiko_2.7.2
2021-03-01 16:38:27 paramiko.transport DEBUG Remote version/idstring: SSH-2.0-Cisco-2.0
2021-03-01 16:38:27 paramiko.transport INFO Connected (version 2.0, client Cisco-2.0)
2021-03-01 16:38:27 paramiko.transport DEBUG Remote version/idstring: SSH-2.0-Cisco-2.0
2021-03-01 16:38:27 paramiko.transport INFO Connected (version 2.0, client Cisco-2.0)
2021-03-01 16:38:27 paramiko.transport DEBUG kex algos:['ecdh-sha2-nistp521', 'ecdh-sha2-nistp384', 'ecdh-sha2-nistp256', 'diffie-hellman-group14-sha1'] server key:['ssh-rsa'] client encrypt:['aes128-ctr', 'aes192-ctr', 'aes256-ctr', '[email protected]', '[email protected]'] server encrypt:['aes128-ctr', 'aes192-ctr', 'aes256-ctr', '[email protected]', '[email protected]'] client mac:['hmac-sha2-512', 'hmac-sha2-256', 'hmac-sha1'] server mac:['hmac-sha2-512', 'hmac-sha2-256', 'hmac-sha1'] client compress:['none'] server compress:['none'] client lang:[''] server lang:[''] kex follows?False
2021-03-01 16:38:27 paramiko.transport DEBUG Kex agreed: ecdh-sha2-nistp256
2021-03-01 16:38:27 paramiko.transport DEBUG HostKey agreed: ssh-rsa
2021-03-01 16:38:27 paramiko.transport DEBUG Cipher agreed: aes128-ctr
2021-03-01 16:38:27 paramiko.transport DEBUG MAC agreed: hmac-sha2-256
2021-03-01 16:38:27 paramiko.transport DEBUG Compression agreed: none
2021-03-01 16:38:27 paramiko.transport DEBUG kex algos:['ecdh-sha2-nistp521', 'ecdh-sha2-nistp384', 'ecdh-sha2-nistp256', 'diffie-hellman-group14-sha1'] server key:['ssh-rsa'] client encrypt:['aes128-ctr', 'aes192-ctr', 'aes256-ctr', '[email protected]', '[email protected]'] server encrypt:['aes128-ctr', 'aes192-ctr', 'aes256-ctr', '[email protected]', '[email protected]'] client mac:['hmac-sha2-512', 'hmac-sha2-256', 'hmac-sha1'] server mac:['hmac-sha2-512', 'hmac-sha2-256', 'hmac-sha1'] client compress:['none'] server compress:['none'] client lang:[''] server lang:[''] kex follows?False
2021-03-01 16:38:27 paramiko.transport DEBUG Kex agreed: ecdh-sha2-nistp256
2021-03-01 16:38:27 paramiko.transport DEBUG HostKey agreed: ssh-rsa
2021-03-01 16:38:27 paramiko.transport DEBUG Cipher agreed: aes128-ctr
2021-03-01 16:38:27 paramiko.transport DEBUG MAC agreed: hmac-sha2-256
2021-03-01 16:38:27 paramiko.transport DEBUG Compression agreed: none
2021-03-01 16:38:27 paramiko.transport DEBUG kex engine KexNistp256 specified hash_algo
2021-03-01 16:38:27 paramiko.transport DEBUG Switch to new keys ...
2021-03-01 16:38:27 paramiko.transport DEBUG Adding ssh-rsa host key for 10.10.10.22: b'08111dbdc9b91d684cacb07a89b1998f'
2021-03-01 16:38:27 paramiko.transport DEBUG userauth is OK
2021-03-01 16:38:27 paramiko.transport DEBUG kex engine KexNistp256 specified hash_algo
2021-03-01 16:38:27 paramiko.transport DEBUG Switch to new keys ...
2021-03-01 16:38:27 paramiko.transport DEBUG Adding ssh-rsa host key for 10.10.10.20: b'e3a153becfc2b89fabf2e9e86b3e30da'
2021-03-01 16:38:27 paramiko.transport DEBUG userauth is OK
2021-03-01 16:38:27 paramiko.transport INFO Authentication (password) successful!
2021-03-01 16:38:27 paramiko.transport DEBUG [chan 0] Max packet in: 32768 bytes
2021-03-01 16:38:27 paramiko.transport DEBUG [chan 0] Max packet out: 32768 bytes
2021-03-01 16:38:27 paramiko.transport DEBUG Secsh channel 0 opened.
2021-03-01 16:38:28 paramiko.transport DEBUG [chan 0] Sesch channel 0 request ok
2021-03-01 16:38:28 paramiko.transport DEBUG [chan 0] Sesch channel 0 request ok
2021-03-01 16:38:29 paramiko.transport INFO Authentication (password) successful!
2021-03-01 16:38:29 paramiko.transport DEBUG [chan 0] Max packet in: 32768 bytes
2021-03-01 16:38:29 paramiko.transport DEBUG [chan 0] Max packet out: 32768 bytes
2021-03-01 16:38:29 paramiko.transport DEBUG Secsh channel 0 opened.
2021-03-01 16:38:29 paramiko.transport DEBUG [chan 0] Sesch channel 0 request ok
2021-03-01 16:38:29 paramiko.transport DEBUG [chan 0] Sesch channel 0 request ok
2021-03-01 16:38:32 paramiko.transport ERROR Exception: Error reading SSH protocol banner[Errno 9] Bad file descriptor
2021-03-01 16:38:32 paramiko.transport ERROR Traceback (most recent call last):
2021-03-01 16:38:32 paramiko.transport ERROR File "/home/users/ggcninetsdms/nornir-3.0.0/nornir-venv/lib64/python3.6/site-packages/paramiko/transport.py", line 2211, in _check_banner
2021-03-01 16:38:32 paramiko.transport ERROR buf = self.packetizer.readline(timeout)
2021-03-01 16:38:32 paramiko.transport ERROR File "/home/users/ggcninetsdms/nornir-3.0.0/nornir-venv/lib64/python3.6/site-packages/paramiko/packet.py", line 380, in readline
2021-03-01 16:38:32 paramiko.transport ERROR buf += self._read_timeout(timeout)
2021-03-01 16:38:32 paramiko.transport ERROR File "/home/users/ggcninetsdms/nornir-3.0.0/nornir-venv/lib64/python3.6/site-packages/paramiko/packet.py", line 607, in _read_timeout
2021-03-01 16:38:32 paramiko.transport ERROR x = self.__socket.recv(128)
2021-03-01 16:38:32 paramiko.transport ERROR OSError: [Errno 9] Bad file descriptor
2021-03-01 16:38:32 paramiko.transport ERROR
2021-03-01 16:38:32 paramiko.transport ERROR During handling of the above exception, another exception occurred:
2021-03-01 16:38:32 paramiko.transport ERROR
2021-03-01 16:38:32 paramiko.transport ERROR Traceback (most recent call last):
2021-03-01 16:38:32 paramiko.transport ERROR File "/home/users/ggcninetsdms/nornir-3.0.0/nornir-venv/lib64/python3.6/site-packages/paramiko/transport.py", line 2039, in run
2021-03-01 16:38:32 paramiko.transport ERROR self._check_banner()
2021-03-01 16:38:32 paramiko.transport ERROR File "/home/users/ggcninetsdms/nornir-3.0.0/nornir-venv/lib64/python3.6/site-packages/paramiko/transport.py", line 2216, in check_banner
2021-03-01 16:38:32 paramiko.transport ERROR "Error reading SSH protocol banner" + str(e)
2021-03-01 16:38:32 paramiko.transport ERROR paramiko.ssh_exception.SSHException: Error reading SSH protocol banner[Errno 9] Bad file descriptor
And some details for my setup:
Network device: Cisco NCS 540 with IOS-XR 6.6.3 (side note: ASR9k with IOS-XR 6.5.3 is working fine)
Nornir: 3.0.0
Netmiko: 3.3.2
Paramiko: 2.7.2
I know, the error message is coming from paramiko, but I hope you can point me in the right direction to trouble shoot this issue.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions