Repository navigation
Closed
Labels
bugbroken, incorrect, or confusing behavior
Milestone
Description
What happened?
Brand new "clean" RHEL/OL9.7 Minimal OS install with 3006.23 salt-minion
used salt-pip install napalm
no errors during install also rebuild VM and tried pip3 install napalm from /opt/saltstack/salt/bin
salt-proxy --proxyid=n9ktest
then:
[root@tri-net-proxy-01 extras-3.10]# salt-proxy --proxyid=n9ktest
[ERROR ] Proxymodule napalm is missing an init() or a shutdown() or both. Check your proxymodule. Salt-proxy aborted.
[ERROR ] Proxymodule napalm is missing an init() or a shutdown() or both. Check your proxymodule. Salt-proxy aborted.
The Salt ProxyMinion is shutdown.
Proxymodule napalm is missing an init() or a shutdown() or both. Check your proxymodule. Salt-proxy aborted.
[root@tri-net-proxy-01 extras-3.10]#
Attempted restarts of the salt-minion
pillar file on master: /srv/pillar/n9ktest.sls
proxy:
id: n9ktest
proxytype: napalm
driver: nxos
host: 192.168.1.1
user: admin
username: admin
password: password
passwd: password
key_accept: True
optional_args:
secret: password
keepalive: 30
/etc/salt/proxy contains:
master: <salt-master-here>
mine_enabled: true
multiprocessing: false
I've followed all the guides and the same error occurs... any help appreciated.
Type of salt install
Official rpm
Major version
3006.x
What supported OS are you seeing the problem on? Can select multiple. (If bug appears on an unsupported OS, please open a GitHub Discussion instead)
oraclelinux-9
salt --versions-report output
# salt-minion --versions-report
Salt Version:
Salt: 3006.23
Python Version:
Python: 3.10.19 (main, Feb 17 2026, 23:32:03) [GCC 11.2.0]
Dependency Versions:
cffi: 2.0.0
cherrypy: 18.10.0
cryptography: 46.0.5
dateutil: 2.8.1
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 3.1.6
libgit2: Not Installed
looseversion: 1.0.2
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 1.0.2
msgpack-pure: Not Installed
mysql-python: Not Installed
packaging: 24.0
pycparser: 2.21
pycrypto: Not Installed
pycryptodome: 3.19.1
pygit2: Not Installed
python-gnupg: 0.4.8
PyYAML: 6.0.3
PyZMQ: 23.2.0
relenv: 0.22.4
smmap: Not Installed
timelib: 0.3.0
Tornado: 4.5.3
ZMQ: 4.3.4
System Versions:
dist: oracle 9.7
locale: utf-8
machine: x86_64
release: 6.12.0-200.74.27.1.el9uek.x86_64
system: Linux
version: Oracle Linux Server 9.7
salt-pip list
...
napalm 5.1.0
...Metadata
Metadata
Assignees
Labels
bugbroken, incorrect, or confusing behavior
Activity
z900collector commentedon May 13, 2026
ls -la /opt/saltstack/salt/extras-3.10/
z900collector commentedon May 14, 2026
Some progress on this, rebuilt a new VM OS is RHEL 9.7 with salt 3007.13
There appears to be some versioning issues:
/opt/saltstack/salt/bin/python3 -m pip uninstall setuptools
/opt/saltstack/salt/bin/python3 -m pip install setuptools==81.0.0
/opt/saltstack/salt/bin/python3 -m pip uninstall -y ssh paramiko netmiko napalm
/opt/saltstack/salt/bin/python3 -m pip install paramiko==2.12.0 netmiko==4.3.0 napalm
Edit napalm.py (Need to recheck this):
vi /opt/saltstack/salt/lib/python3.10/site-packages/salt/proxy/napalm.pyStill need to test out the rest of the functionality but installing specific packages appears to be a "fix".
Surface real cause when a proxymodule fails to load
Surface real cause when a proxymodule fails to load
Surface real cause when a proxymodule fails to load
Surface real cause when a proxymodule fails to load
Surface real cause when a proxymodule fails to load
ggiesen commentedon Jul 11, 2026
I hit this same "Proxymodule napalm is missing an init()" on 3006.x and traced it to a Salt loader bug rather than a napalm/paramiko version problem. The clearer error text from #69330 helped confirm it: the real failure is that
import napalmraises insidesalt.utils.napalm, soHAS_NAPALMis False and the napalm proxy/execution modules never pass their__virtual__gate.Root cause. Salt's LazyLoader puts its own source directories on the global
sys.pathwhile a module body executes (salt/loader/lazy.py:__populate_sys_path, and thefpath_dirnameappend in_load_module). Whensalt.utils.napalmruns its top-levelimport napalm, that pulls injnpr.junos -> ncclient.transport, and ncclient does a bareimport sshto detect ssh-python (libssh). Withsalt/utilsonsys.path, that bareimport sshbinds to Salt's ownsalt/utils/ssh.py(a plain module, not the ssh-python package) and gets cached insys.modules['ssh']. ncclient then runsfrom ssh.channel import Channeland hits:which aborts
import napalm.HAS_NAPALMis then False for the life of the process, and the proxy reports "missing an init()".Two things line up to trigger it:
ncclient==0.7.0, and ncclient 0.7.0 is the first release to probe for libssh withtry: import ssh(ncclient PR saltutil module documentation missing from RTD #639). Salt'ssshshadow turns that probe into a false positive, so ncclient imports its libssh transport, which then fails on the shadowed module. ncclient 0.7.1 switched the probe toimportlib.metadata(ncclient PR Add ability to set PKG_PATH env var before running FreeBSD pkg state #652) and is immune to the shadow, but the junos-eznc pin keeps 0.7.0 in place.ncclient[libssh]extra, so it is normally absent. Without Salt's shadow, the bareimport sshwould just ImportError and ncclient would skip libssh cleanly.The workaround in this thread (downgrade paramiko/netmiko, remove ssh-python) works because it stops anything from wanting the libssh path. But the underlying bug is the loader shadowing top-level imports, and it is general: any
salt/utils/*.py(orsalt/modules/*.py, etc.) whose stem matches a top-level package that some third-party library imports can shadow it the same way.sshis just the one that bites napalm.Fix. Stop the loader from putting Salt-internal directories on
sys.path. Salt-internal modules are imported via their fully-qualifiedsalt.*names, so they never neededsys.path; only external/custom module dirs do (so a custom module's bare sibling imports still resolve). Two small edits insalt/loader/lazy.py, gated onSALT_BASE_PATH:__populate_sys_path: skip anydirectoryunderSALT_BASE_PATH._load_module: only appendfpath_dirnamewhenfpathis not underSALT_BASE_PATH.I validated this on a real 3006.26 onedir install (Rocky 9) running a napalm deltaproxy against live Junos devices: with the loader fix applied and the pinned, still-"broken" ncclient 0.7.0 in place, napalm loads and the sub-proxies initialize with no
KeyError: 'napalm.init'. Reverting the two edits reproduces the failure.Happy to open a PR with the two edits plus a loader regression test (load an internal module whose import chain does a bare
import <stem>matching asalt/utilsfile, and assertsys.modules['<stem>']stays the real package). Since this is the actual root cause and the loader shadow affects more than just napalm, it may be worth reopening this or tracking it separately from the message fix in #69330.ggiesen commentedon Jul 11, 2026
Opened #69787 with the loader fix (skip Salt-internal dirs when populating
sys.path) plus a regression test. Validated on a real 3006.26 onedir + live-Junos napalm deltaproxy with the pinned ncclient 0.7.0 still in place.Stop the loader from shadowing top-level imports via sys.path (saltst…
Stop the loader from shadowing top-level imports via sys.path (saltst…
Add functional regression test for the loader sys.path shadow (saltst…
Stop the loader from shadowing top-level imports via sys.path (saltst…
Add functional regression test for the loader sys.path shadow (saltst…
Stop the loader from shadowing top-level imports via sys.path (saltst…
Add functional regression test for the loader sys.path shadow (saltst…
Stop the loader from shadowing top-level imports via sys.path (#69139)
Add functional regression test for the loader sys.path shadow (#69139)
Stop the loader from shadowing top-level imports via sys.path (#69139)
Add functional regression test for the loader sys.path shadow (#69139)