Repository navigation
Description
Description of Issue
When I run napalm.junos_cli commands, they have issues with a timeout not getting set. There are a couple variants of this and I'm not 100% sure they're related, but they look awfully close.
issue the first
It looks like there should be a timeout passed in for a cli command, and there isn't. I have tried setting -t <val> and --timeout=<val> both immediately after $RTR and at the endo of the command line and there's no difference.
salt@9bcd18b7855c:~$ salt $RTR napalm.junos_cli "show version"
cfr1.ix1.dfw:
The minion function caused an exception: Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/jnpr/junos/device.py", line 206, in timeout
self._conn.timeout = int(value)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/salt/metaproxy/proxy.py", line 480, in thread_return
opts, data, func, args, kwargs
File "/usr/lib/python3/dist-packages/salt/executors/direct_call.py", line 12, in execute
return func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/salt/utils/napalm.py", line 515, in func_wrapper
ret = func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/salt/modules/napalm_mod.py", line 930, in junos_cli
command, format=format, dev_timeout=dev_timeout, dest=dest, **kwargs
File "/usr/lib/python3/dist-packages/salt/modules/junos.py", line 174, in wrapper
conn.timeout = kwargs.pop("dev_timeout", None)
File "/usr/local/lib/python3.6/dist-packages/jnpr/junos/device.py", line 209, in timeout
"could not convert timeout value of %s to an " "integer" % (value)
RuntimeError: could not convert timeout value of None to an integer
ERROR: Minions returned with non-zero exit code
issue the second
Although some direct `napalm.junos_rpc' commands work, like this one:
salt@9bcd18b7855c:~$ salt $RTR napalm.junos_rpc get-system-information
cfr1.ix1.dfw:
----------
comment:
out:
----------
system-information:
----------
hardware-model:
mx10003
host-name:
cfr1.ix1.dfw
...
some of the more involved ones do not, and they have what looks like a similar timeout issue.
If I run the command salt $RTR net.cli "request vmhost snapshot" -t 120
the -t 120 timeout gets obeyed but there is an rpc timeout error:
salt@9bcd18b7855c:~$ salt $RTR net.cli "request vmhost snapshot" -t 120
cfr1.ix1.dfw:
----------
comment:
out:
----------
request vmhost snapshot:
invalid command: request vmhost snapshot: RpcTimeoutError(host: cfr1.ix1.dfw, cmd: command, timeout: 60)
result:
True
I have tried any number of --dev_timeout <val> and --dev_timeout=<val> and dev_timeout= parameters , at various places in the command line, and nothing I do makes this go away. Setting --dev-timeout to some value >60 always leaves me with the same error message, always displaying "timeout: 60". So whatever I'm trying to pass in isn't getting relayed down. One example:
salt@9bcd18b7855c:~$ time salt $RTR net.cli -t 120 "request vmhost snapshot" dev_timeout=5000
cfr1.ix1.dfw:
----------
comment:
out:
----------
request vmhost snapshot:
invalid command: request vmhost snapshot: RpcTimeoutError(host: cfr1.ix1.dfw, cmd: command, timeout: 60)
result:
True
real 1m1.384s
user 0m1.740s
sys 0m0.234s
Setup
I am running salt-master in one docker container and salt-proxy in another. All version 3001, freshly built.
Steps to Reproduce Issue
See above. I'm happy to run more tests, this is easy to reproduce.
Versions Report
Master and minion are build from the same container base:
salt@9bcd18b7855c:~$ salt --versions-report
Salt Version:
Salt: 3001
Dependency Versions:
cffi: 1.14.1
cherrypy: Not Installed
dateutil: 2.6.1
docker-py: Not Installed
gitdb: 2.0.3
gitpython: 2.1.8
Jinja2: 2.11.2
libgit2: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: 2.20
pycrypto: 2.6.1
pycryptodome: 3.4.7
pygit2: Not Installed
Python: 3.6.9 (default, Jul 17 2020, 12:50:27)
python-gnupg: 0.4.1
PyYAML: 5.3.1
PyZMQ: 17.1.2
smmap: 2.0.3
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.2.5
System Versions:
dist: ubuntu 18.04 Bionic Beaver
locale: ANSI_X3.4-1968
machine: x86_64
release: 5.3.0-1030-gcp
system: Linux
version: Ubuntu 18.04 Bionic Beaver
Activity
[-]Timeout value problem with napalm.junos_cli[/-][+]Timeout value problem with napalm.junos_cli and sometimes RPC[/+]cmcmarrow commentedon Aug 3, 2020
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'wasabi222 commentedon Oct 16, 2020
I just came across this. the correct argument is
dev_timeout- see below:This happens because the default argument for
dev_timeoutin the napalm.junos_cli function is None but it should be something sane like 60 instead. Line 931 in modules/napalm_mod.py:should be:
dmurphy18 commentedon Oct 16, 2020
Have the timeout issue for Junos fixed in native minions, waiting till after upcoming release to send in a PR post release
eosborne-vio commentedon Oct 19, 2020
I tried
dev_timeoutand that didn't work for me, please see the bottom of my initial report. Here it is again on 3001.1:With just
dev_timeout:With both
dev_timeoutand-t:wasabi222 commentedon Oct 19, 2020
I was referring to your "issue the first" above - the
RuntimeError: could not convert timeout value of None to an integerexception can be fixed by setting dev_timeout. The other two I'm not sure about.Fix Junos timeout wrappers crashing on dev_timeout=None (#58108)
dwoz commentedon Oct 15, 2026
Thanks for the original report. This issue has been open for more than three years without recent activity and carries a severity label below
severity-high. As part of a backlog cleanup, we're closing older low- and medium-severity issues so triage can focus on reports against currently supported releases.Closing isn't a judgement that the problem wasn't real — only that the codebase has moved through several releases since this was filed, and much of the surrounding code has changed.
If you — or anyone else — can still reproduce this on the 3008.x LTS release, please leave a comment with a reproduction and a maintainer will reopen. The original reporter can also reopen directly.
Fix Junos timeout wrappers crashing on dev_timeout=None (#58108)