2022-08-15 19:46:58,096 [salt.loader :1156][CRITICAL][1065324] Failed to load grains defined in grain file napalm.version in function <LoadedFunc name='napalm.version'>, error:
Traceback (most recent call last):
File "salt/loader/__init__.py", line 1150, in grains
ret = funcs[key](**kwargs)
File "salt/loader/lazy.py", line 149, in __call__
return self.loader.run(run_func, *args, **kwargs)
File "salt/loader/lazy.py", line 1228, in run
return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
File "salt/loader/lazy.py", line 1243, in _run_as
return _func_or_method(*args, **kwargs)
File "/opt/saltstack/salt/run/salt/grains/napalm.py", line 156, in version
return {"version": _get_grain("os_version", proxy=proxy)}
File "/opt/saltstack/salt/run/salt/grains/napalm.py", line 98, in _get_grain
grains = _retrieve_grains_cache(proxy=proxy)
File "/opt/saltstack/salt/run/salt/grains/napalm.py", line 71, in _retrieve_grains_cache
GRAINS_CACHE = proxy["napalm.get_grains"]()
File "salt/loader/lazy.py", line 149, in __call__
return self.loader.run(run_func, *args, **kwargs)
File "salt/loader/lazy.py", line 1228, in run
return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
File "salt/loader/lazy.py", line 1243, in _run_as
return _func_or_method(*args, **kwargs)
File "/opt/saltstack/salt/run/salt/proxy/napalm.py", line 258, in get_grains
return call("get_facts", **{})
File "/opt/saltstack/salt/run/salt/proxy/napalm.py", line 348, in call
__context__["napalm_device"]["network_device"], method, *args, **kwargs
File "salt/loader/context.py", line 78, in __getitem__
return self.value()[item]
File "salt/utils/context.py", line 221, in __getitem__
return self._dict()[key]
KeyError: 'napalm_device'
Description
Latest dev build from this pipeline: https://gitlab.com/saltstack/open/salt-pkg/-/pipelines/613600623
napalm proxy grains is throwing an error related to napalm.version
This is a follow on from #62393
Setup
(Please provide relevant configs and/or SLS files (be sure to remove sensitive info. There is no general set-up of Salt.)
Latest dev build from this pipeline: https://gitlab.com/saltstack/open/salt-pkg/-/pipelines/613600623
a working device to connect to salt-proxy
Steps to Reproduce the behavior
https://github.com/napalm-automation/napalm-salt/tree/master/saltstack - a quick example of a salt setup with napalm
install napalm with salt pip (salt-pip install napalm)
Start a proxy module and watch /var/log/salt/proxy. the following error will appear
Expected behavior
No errors related to proxy process
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)