-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReadTimeout with open() #66
Comments
Just FYI, cDev.unlock() is something I added to see if thats the issue. But the timeout happens with or without it. |
Made some progress. Used lock = False option to avoid locking the config db.
changed the _XML_SHELL command to 'xml echo format' (tried 'xml echo' too).
Now I am getting XML parse error
Here is the netmiko session log.
Any ideas? |
I printed the response for the CLI. Looks like there are 2 XML declaration at the top. One for request and other for response. It is probably why XML parsing is failing.
|
I am getting following read timeout exception when I run my script
Processing Host: usgrx107-bbisp-gw1
Traceback (most recent call last):
File "/Users/nileshkhambal/Documents/GIT_REPO/PIE/edge-bgp-peer-verification/all-route-verification/bgp_group_peer_verification_iosxr_native.py", line 164, in
cDev.open()
File "/Users/nileshkhambal/Documents/GIT_REPO/PIE/edge-bgp-peer-verification/all-route-verification/venv/lib/python3.9/site-packages/pyIOSXR/iosxr.py", line 176, in open
self._enter_xml_mode()
File "/Users/nileshkhambal/Documents/GIT_REPO/PIE/edge-bgp-peer-verification/all-route-verification/venv/lib/python3.9/site-packages/pyIOSXR/iosxr.py", line 239, in _enter_xml_mode
self.lock()
File "/Users/nileshkhambal/Documents/GIT_REPO/PIE/edge-bgp-peer-verification/all-route-verification/venv/lib/python3.9/site-packages/pyIOSXR/iosxr.py", line 477, in lock
self._execute_rpc(rpc_command)
File "/Users/nileshkhambal/Documents/GIT_REPO/PIE/edge-bgp-peer-verification/all-route-verification/venv/lib/python3.9/site-packages/pyIOSXR/iosxr.py", line 366, in _execute_rpc
response = self._send_command(xml_rpc_command, delay_factor=delay_factor)
File "/Users/nileshkhambal/Documents/GIT_REPO/PIE/edge-bgp-peer-verification/all-route-verification/venv/lib/python3.9/site-packages/pyIOSXR/iosxr.py", line 271, in _send_command
last_read = self.device.send_command_expect(command,
File "/Users/nileshkhambal/Documents/GIT_REPO/PIE/edge-bgp-peer-verification/all-route-verification/venv/lib/python3.9/site-packages/netmiko/base_connection.py", line 1820, in send_command_expect
return self.send_command(*args, **kwargs)
File "/Users/nileshkhambal/Documents/GIT_REPO/PIE/edge-bgp-peer-verification/all-route-verification/venv/lib/python3.9/site-packages/netmiko/utilities.py", line 592, in wrapper_decorator
return func(self, *args, **kwargs)
File "/Users/nileshkhambal/Documents/GIT_REPO/PIE/edge-bgp-peer-verification/all-route-verification/venv/lib/python3.9/site-packages/netmiko/base_connection.py", line 1740, in send_command
new_data = self.command_echo_read(cmd=cmd, read_timeout=10)
File "/Users/nileshkhambal/Documents/GIT_REPO/PIE/edge-bgp-peer-verification/all-route-verification/venv/lib/python3.9/site-packages/netmiko/base_connection.py", line 1452, in command_echo_read
new_data = self.read_until_pattern(
File "/Users/nileshkhambal/Documents/GIT_REPO/PIE/edge-bgp-peer-verification/all-route-verification/venv/lib/python3.9/site-packages/netmiko/base_connection.py", line 721, in read_until_pattern
raise ReadTimeout(msg)
netmiko.exceptions.ReadTimeout:
Pattern not detected: '<\?xml\ version="1\.0"\ encoding="UTF\-8"\?><Request\ MajorVersion="1"\ MinorVersion="0">' in output.
Things you might try to fix this:
many situations the pattern is automatically based on the network device's prompt.
You can also look at the Netmiko session_log or debug log for more information.
Script is pretty simple
here is the netmiko session log
The text was updated successfully, but these errors were encountered: