Can't connect to Nexus, how to tshoot?

Hi guys,

I’m trying to apply configuration to a nexus switch (using nxos_ssh method), my script can’t connect to it - ‘Timed-out reading channel, data not available.’
I am using this group with all devices, which supposed to use global_delay_factor: 8 - it doesn’t help.

global:
  connection_options:
    netmiko:
      extras:
        global_delay_factor: 8

I’m trying to get some (meaningful) debug:

nr = InitNornir(
    config_file="nornir.yaml", dry_run=False,
    logging={"file": "nornir.log", "level": "debug"}
)

But my nornir.log file doesn’t help as well - it basically contains the same traceback, as I am getting when running the script. How do you tshoot such situations? How can I get the actual output from the switch cli? Any gotchas?

Thanks.

Here’s the traceback, if that helps:

configure_radius****************************************************************

  • ded1-nas1 ** changed : False *************************************************
    vvvv configure_radius ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ERROR
    Subtask: <function napalm_configure at 0x10ea13b00> (failed)

---- Configuring ** changed : False -------------------------------------------- INFO
radius-server radius-ise.isis.net key “key” auth-port 1814 acct-port 1815 authentication accounting timeout 3 retransmit 2
!
aaa group server radius RADAAA-ISE
server radius-ise.isis.net
deadtime 10
source-interface mgmt0
!
aaa authentication login default group RADAAA-ISE local
aaa authentication login console local
---- Loading config on the device ** changed : False --------------------------- ERROR
Traceback (most recent call last):
File “/Users/allarm/.virtualenvs/p3_venv/lib/python3.7/site-packages/paramiko/channel.py”, line 699, in recv
out = self.in_buffer.read(nbytes, self.timeout)
File “/Users/allarm/.virtualenvs/p3_venv/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 “/Users/allarm/.virtualenvs/p3_venv/lib/python3.7/site-packages/netmiko/base_connection.py”, line 541, in _read_channel_expect
new_data = self.remote_conn.recv(MAX_BUFFER)
File “/Users/allarm/.virtualenvs/p3_venv/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/allarm/.virtualenvs/p3_venv/lib/python3.7/site-packages/napalm/nxos/nxos.py”, line 146, in _commit_merge
output = self._send_config(self.merge_candidate)
File “/Users/allarm/.virtualenvs/p3_venv/lib/python3.7/site-packages/napalm/nxos_ssh/nxos_ssh.py”, line 467, in _send_config
return self.device.send_config_set(commands)
File “/Users/allarm/.virtualenvs/p3_venv/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 “/Users/allarm/.virtualenvs/p3_venv/lib/python3.7/site-packages/netmiko/base_connection.py”, line 618, in read_until_pattern
return self._read_channel_expect(*args, **kwargs)
File “/Users/allarm/.virtualenvs/p3_venv/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.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Users/allarm/.virtualenvs/p3_venv/lib/python3.7/site-packages/nornir/core/task.py”, line 85, in start
r = self.task(self, **self.params)
File “/Users/allarm/.virtualenvs/p3_venv/lib/python3.7/site-packages/nornir/plugins/tasks/networking/napalm_configure.py”, line 37, in napalm_configure
device.commit_config()
File “/Users/allarm/.virtualenvs/p3_venv/lib/python3.7/site-packages/napalm/nxos/nxos.py”, line 225, in commit_config
self._commit_merge()
File “/Users/allarm/.virtualenvs/p3_venv/lib/python3.7/site-packages/napalm/nxos/nxos.py”, line 154, in _commit_merge
raise MergeConfigException(merge_error)
napalm.base.exceptions.MergeConfigException: Configuration merge failed; automatic rollback attempted:
‘Timed-out reading channel, data not available.’

^^^^ END configure_radius ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Can you try testing this with the Netmiko develop branch and see if you see the same issue?

This is where it is failing. Basically Netmiko is expecting the command to be echoed and it is not getting echoed correctly.

File “/Users/allarm/.virtualenvs/p3_venv/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()))