Nokia SR OS/Alcatel AOS - randomly returned ValueError: router prompt not found
See original GitHub issueI have a problem with randomly returned ValueError and router prompt not found message for Alcatel/Nokia devices. Error occurs totally randomly. When I’m running my script once again after error occurs everything goes fine.
Part of my connection settings (I noticed that the only changes I made before the problem started was increasing the following parameters value):
connection_credentials = {
[...]
"banner_timeout": 60,
"timeout": 300,
"session_timeout": 180
}
Stack trace:
[...]
File "/path/to/file/file.py", line 54, in connect_to_host
self.connection = ConnectHandler(**connection_credentials)
File "/usr/local/lib/python3.6/site-packages/netmiko/ssh_dispatcher.py", line 259, in ConnectHandler
return ConnectionClass(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/netmiko/base_connection.py", line 327, in __init__
self._open()
File "/usr/local/lib/python3.6/site-packages/netmiko/base_connection.py", line 333, in _open
self._try_session_preparation()
File "/usr/local/lib/python3.6/site-packages/netmiko/base_connection.py", line 756, in _try_session_preparation
self.session_preparation()
File "/usr/local/lib/python3.6/site-packages/netmiko/nokia/nokia_sros_ssh.py", line 38, in session_preparation
self.set_base_prompt()
File "/usr/local/lib/python3.6/site-packages/netmiko/nokia/nokia_sros_ssh.py", line 52, in set_base_prompt
cur_base_prompt = super().set_base_prompt(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/netmiko/base_connection.py", line 1081, in set_base_prompt
raise ValueError(f"Router prompt not found: {repr(prompt)}")
ValueError: Router prompt not found: 'A:'
Logs when the problem doesn’t occur:
09/17/2020 09:30:38:DEBUG:paramiko.transport:userauth is OK
09/17/2020 09:30:38:INFO:paramiko.transport:Authentication (password) successful!
09/17/2020 09:30:38:DEBUG:paramiko.transport:[chan 0] Max packet in: 32768 bytes
09/17/2020 09:30:38:DEBUG:paramiko.transport:[chan 0] Max packet out: 32768 bytes
09/17/2020 09:30:38:DEBUG:paramiko.transport:Secsh channel 0 opened.
09/17/2020 09:30:38:DEBUG:paramiko.transport:[chan 0] Sesch channel 0 request ok
09/17/2020 09:30:38:DEBUG:paramiko.transport:[chan 0] Sesch channel 0 request ok
09/17/2020 09:30:39:DEBUG:netmiko:read_channel: ^M
^M
A:HOST1#
09/17/2020 09:30:39:DEBUG:netmiko:read_channel:
09/17/2020 09:30:41:DEBUG:netmiko:read_channel:
09/17/2020 09:30:41:DEBUG:netmiko:read_channel:
09/17/2020 09:30:41:DEBUG:netmiko:write_channel: b'\n'
09/17/2020 09:30:41:DEBUG:netmiko:read_channel: ^M
A:HOST1#
09/17/2020 09:30:41:DEBUG:netmiko:read_channel:
09/17/2020 09:30:41:DEBUG:netmiko:[find_prompt()]: prompt is A:HOST1#
09/17/2020 09:30:42:DEBUG:netmiko:read_channel:
09/17/2020 09:30:42:DEBUG:netmiko:In disable_paging
09/17/2020 09:30:42:DEBUG:netmiko:Command: environment no more
Logs when the problem occurs:
09/17/2020 09:42:16:DEBUG:paramiko.transport:userauth is OK
09/17/2020 09:42:17:INFO:paramiko.transport:Authentication (password) successful!
09/17/2020 09:42:17:DEBUG:paramiko.transport:[chan 0] Max packet in: 32768 bytes
09/17/2020 09:42:17:DEBUG:paramiko.transport:[chan 0] Max packet out: 32768 bytes
09/17/2020 09:42:17:DEBUG:paramiko.transport:Secsh channel 0 opened.
09/17/2020 09:42:17:DEBUG:paramiko.transport:[chan 0] Sesch channel 0 request ok
09/17/2020 09:42:17:DEBUG:paramiko.transport:[chan 0] Sesch channel 0 request ok
09/17/2020 09:42:18:DEBUG:netmiko:read_channel:
A:HOST2#
09/17/2020 09:42:18:DEBUG:netmiko:read_channel:
09/17/2020 09:42:20:DEBUG:netmiko:read_channel:
09/17/2020 09:42:20:DEBUG:netmiko:read_channel:
09/17/2020 09:42:20:DEBUG:netmiko:write_channel: b'\n'
09/17/2020 09:42:20:DEBUG:netmiko:read_channel:
A:
09/17/2020 09:42:20:DEBUG:netmiko:read_channel: HOST2#
09/17/2020 09:42:20:DEBUG:netmiko:Clear buffer detects data in the channel
09/17/2020 09:42:21:DEBUG:netmiko:read_channel:
09/17/2020 09:42:21:DEBUG:netmiko:[find_prompt()]: prompt is A:
09/17/2020 09:42:21:DEBUG:netmiko:write_channel: b'logout\n'
09/17/2020 09:42:21:DEBUG:paramiko.transport:EOF in transport thread
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
7750 SR OS Basic System Configuration Guide
7750 SR OS Router Configuration Guide. This guide describes logical IP routing interfaces and associated attributes such as an IP.
Read more >7750 SR OS Router Configuration Guide - Nokia Documentation
7750 SR OS Basic System Configuration Guide. This guide describes basic system configurations and operations. • 7750 SR OS System Management Guide.
Read more >Basic CLI Commands - Nokia Documentation
For example, if the current level is the config router ospf context, the back command moves the cursor to the config router context...
Read more >CLI Usage - Nokia Documentation
Alcatel -Lucent's SR OS CLI is a command-driven interface accessible through the ... For example, the prompt: A:ALA-1>config>router>if# indicates the active ...
Read more >BGP - Nokia Documentation
In SR-OS a BGP session is configured using the neighbor command. ... if it did not already exist; the ORIGINATOR_ID indicates the BGP...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Adding @hellt also.
I will probably look at this, but it might be next week. Not sure I am going to get to it this week.
Okay, it seems like the generally issue is that in some situations find_prompt() is failing to get the last character i.e. the
#
and that is causing problems.I will have to look into why that is happening.