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.

Cisco IOS device fails to enter config mode properly

See original GitHub issue

I’ve error when using send_config_set method in Netmiko with cisco_ios and but other methods are working normally, Thanks for your kind support . [Noted that : this is virtual LAB ]

`from netmiko import ConnectHandler from getpass import getpass

password = getpass()

cisco = { ‘device_type’: ‘cisco_ios’, ‘host’:‘192.168.100.10’, ‘username’:‘R1’, ‘password’:password,

}

net_connect = ConnectHandler(**cisco)

output = net_connect.send_command(‘show ip int brief’) print(output)

config_commands = [‘config t’, ‘int loop 1’, ‘ip address 1.1.1.1 255.255.255.255’] output = net_connect.send_config_set(config_commands=cisco) print (output)

cisco.disconnect()

===================================================================================================

C:\Users\engmo>python C:/Users/engmo/PycharmProjects/Netmiko/Netmiko.py Password:

Interface IP-Address OK? Method Status Protocol Ethernet0/0 unassigned YES NVRAM administratively down down Ethernet0/1 192.168.100.10 YES NVRAM up up Ethernet0/2 unassigned YES NVRAM administratively down down Ethernet0/3 unassigned YES NVRAM administratively down down Ethernet1/0 unassigned YES NVRAM administratively down down Ethernet1/1 unassigned YES NVRAM administratively down down Ethernet1/2 unassigned YES NVRAM administratively down down Ethernet1/3 unassigned YES NVRAM administratively down down Serial2/0 unassigned YES NVRAM administratively down down Serial2/1 unassigned YES NVRAM administratively down down Serial2/2 unassigned YES NVRAM administratively down down Serial2/3 unassigned YES NVRAM administratively down down Serial3/0 unassigned YES NVRAM administratively down down Serial3/1 unassigned YES NVRAM administratively down down Serial3/2 unassigned YES NVRAM administratively down down Serial3/3 unassigned YES NVRAM administratively down down Traceback (most recent call last): File “C:\Program Files (x86)\Python38-32\lib\site-packages\paramiko\channel.py”, line 699, in recv out = self.in_buffer.read(nbytes, self.timeout) File “C:\Program Files (x86)\Python38-32\lib\site-packages\paramiko\buffered_pipe.py”, line 164, in read raise PipeTimeout() paramiko.buffered_pipe.PipeTimeout

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “C:\Users\engmo\AppData\Roaming\Python\Python38\site-packages\netmiko\base_connection.py”, line 569, in _read_channel_expect new_data = self.remote_conn.recv(MAX_BUFFER) File “C:\Program Files (x86)\Python38-32\lib\site-packages\paramiko\channel.py”, line 701, in recv raise socket.timeout() socket.timeout

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “C:/Users/engmo/PycharmProjects/Netmiko/Netmiko.py”, line 22, in <module> output = net_connect.send_config_set(config_commands=cisco) File “C:\Users\engmo\AppData\Roaming\Python\Python38\site-packages\netmiko\base_connection.py”, line 1853, in send_config_set output += self.config_mode(*cfg_mode_args) File “C:\Users\engmo\AppData\Roaming\Python\Python38\site-packages\netmiko\cisco_base_connection.py”, line 48, in config_mode return super().config_mode( File “C:\Users\engmo\AppData\Roaming\Python\Python38\site-packages\netmiko\base_connection.py”, line 1737, in config_mode if not self.check_config_mode(): File “C:\Users\engmo\AppData\Roaming\Python\Python38\site-packages\netmiko\cisco\cisco_ios.py”, line 32, in check_config_mode return super().check_config_mode(check_string=check_string, pattern=pattern) File “C:\Users\engmo\AppData\Roaming\Python\Python38\site-packages\netmiko\cisco_base_connection.py”, line 38, in check_config_mode return super().check_config_mode(check_string=check_string, pattern=pattern) File “C:\Users\engmo\AppData\Roaming\Python\Python38\site-packages\netmiko\base_connection.py”, line 1721, in check_config_mode output = self.read_until_pattern(pattern=pattern) File “C:\Users\engmo\AppData\Roaming\Python\Python38\site-packages\netmiko\base_connection.py”, line 651, in read_until_pattern return self._read_channel_expect(*args, **kwargs) File “C:\Users\engmo\AppData\Roaming\Python\Python38\site-packages\netmiko\base_connection.py”, line 579, in _read_channel_expect raise NetmikoTimeoutException( netmiko.ssh_exception.NetmikoTimeoutException: Timed-out reading channel, data not available. `

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vimrichiecommented, Apr 2, 2021

Your debugging shows success. It looks like you are going all the way up to “show version”.

The code you posted when you opened the issue does not report a “show version”. Are you running this with the latest version of Netmiko?

0reactions
ktbyerscommented, Apr 10, 2021

Closing as there was no additional response on this. Just re-open if you have more info on the problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Guide for Cisco Configuration Engine
In router configuration mode, enter cns?. If the cns command list is displayed, the device is agent-enabled. If the device is not agent-enabled,...
Read more >
Troubleshooting [Support] - Cisco Systems
Use the set command to check your configuration. Router in Boot Mode: Router (boot)>. If the router is in boot mode, it means...
Read more >
Troubleshooting the Software Configuration - Cisco
This module describes how to identify and resolve software problems related to the Cisco IOS software on the switch. Depending on the nature...
Read more >
Troubleshoot Switch Port and Interface Problems - Cisco
This document describes how to determine why a port or interface experiences problems.
Read more >
System Management Configuration Guide, Cisco IOS XE ...
Recovering from a Software Failure ; Step 5. Press the Mode button, and at the same time, reconnect the power cord to the...
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