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.

send_config_set problem: Timed-out reading channel, data not available.

See original GitHub issue

Thanks a lot @ktbyers for this excellent library and your work on this!

I have an issue when using send_config_set using a Cisco IOS 88x router. We got a template that has around 65 commands, they work fine on cli, and netmiko delivers all commands successfully to the router (yes, all commands are present in the running config).

But netmiko is stuck in waiting the router to be finished, this is the exception that I get:

` Traceback (most recent call last): File “/usr/local/lib/python3.7/site-packages/paramiko/channel.py”, line 699, in recv out = self.in_buffer.read(nbytes, self.timeout) File “/usr/local/lib/python3.7/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 “/usr/local/lib/python3.7/site-packages/netmiko/base_connection.py”, line 541, in _read_channel_expect new_data = self.remote_conn.recv(MAX_BUFFER) File “/usr/local/lib/python3.7/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 “/Users/…/conf.py”, line 161, in <module> conn.send_config_set(tmpl1config, delay_factor=100, max_loops=1000) File “/usr/local/lib/python3.7/site-packages/netmiko/base_connection.py”, line 1726, in send_config_set new_output = self.read_until_pattern(pattern=re.escape(cmd.strip())) File “/usr/local/lib/python3.7/site-packages/netmiko/base_connection.py”, line 618, in read_until_pattern return self._read_channel_expect(*args, **kwargs) File “/usr/local/lib/python3.7/site-packages/netmiko/base_connection.py”, line 552, in _read_channel_expect “Timed-out reading channel, data not available.” netmiko.ssh_exception.NetmikoTimeoutException: Timed-out reading channel, data not available. `

I already tried several things:

  • In the ConnectHandler, added ‘blocking_timeout’: 100
  • In send_config_set added the options: delay_factor=5, delay_factor=100, max_loops=16, max_loops=1000

Cheers

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
ktbyerscommented, Jan 21, 2020

You can also in send_config_set set the following argument to False:

      cmd_verify=True,

This will turn of that command verification and fallback to the old Netmiko 2.X behavior.

Of course, I am pretty interested to see why it is failing so it would be very helpful to look at your session_log and see why the command verification is not working 😃

1reaction
martininkacommented, Jan 22, 2020

You can also in send_config_set set the following argument to False:

      cmd_verify=True,

This will turn of that command verification and fallback to the old Netmiko 2.X behavior.

Of course, I am pretty interested to see why it is failing so it would be very helpful to look at your session_log and see why the command verification is not working 😃

hey, it works with cmd_verify=False 😃

About the script flow:

  • open text file containing config template
  • parse it with string.Template and fill in some variables
  • pass the result to send_config_set

Maybe the problem is somewhere there? One long string? PrettyPrinter result of the substituted text:

('snmp-server contact phase1\n'
 'no event manager applet start-up authorization bypass\n'
 'clock summer-time CEST recurring last Sun Mar 2:00 last Sun Oct 3:00\n'
 'service timestamps debug datetime localtime show-timezone msec year\n'
 'service timestamps log datetime localtime show-timezone msec year\n'
.....
Read more comments on GitHub >

github_iconTop Results From Across the Web

Netmiko "Timed-out reading channel, data not available." for ...
I am using netmiko ConnectionHandler to push simple config ...
Read more >
Issue with a NetMiko script : r/networking - Reddit
It's not a STP issue as I statically configured S1 to be the ... NetMikoTimeoutException: Timed-out reading channel, data not available.
Read more >
Netmiko timing out after sending command - Python Forum
The script works as it it transfers the file, but it then times out and I can't ... NetmikoTimeoutException: Timed-out reading channel, data...
Read more >
Netmiko is not finding the prompt when entering banner exec ...
NetmikoTimeoutException: Timed-out reading channel, data not available. I debugged this and it looks like it is waiting for the R1_Router# ...
Read more >
Network Automation Appliance with netmiko - Support | GNS3
1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. ... "Timed-out reading channel, data not available." netmiko.
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