Repository navigation
Description
Description of Issue/Question
From time to time, when executing a specific function against a groups of network devices managed through proxy minions using the NAPALM proxy, we encounter the following error:
# salt edge01.yyz01 ntp.peers
edge01.yyz01:
'ntp.peers' is not available.
ERROR: Minions returned with non-zero exit codeIn the example above, I have executed the function peers from the napalm_ntp module, having the virtual name ntp: https://github.com/saltstack/salt/blob/develop/salt/modules/napalm_ntp.py#L77
Executing the same function against a different target:
# salt edge01.akl01 ntp.peers
edge01.akl01:
----------
comment:
out:
- 172.17.17.1
- 172.17.17.2
result:
True(I have obfuscated the IP addresses in previous output, otherwise nothing was changed).
But executing a different function (e.g. snmp.config - soon to be published) against the same minion as previously:
# salt edge01.akl01 snmp.config
edge01.akl01:
'snmp.config' is not available.Setup
The setup is the same as described in #34446, without the changes from #35178.
Steps to Reproduce Issue
Unfortunately I am not sure how to reproduce this issue. Given that I am still not aware of deeper Salt internals, I would need your guidance to identify the steps.
Initially I thought it is a caching issue - but the modules are cached in only one place for all proxies and they become unavailable only for some of them.
Restarting the proxy process fixes the problem, but this is not a comfortable solution since this kind of events are not deterministic (or, at least, I was not able to identify a pattern).
Sometimes we get the message * is not available a couple of hours after the proxy is started, sometimes after a couple of days.
Versions Report
# salt --versions-report
Salt Version:
Salt: 2016.3.1
Dependency Versions:
cffi: 1.6.0
cherrypy: Not Installed
dateutil: 2.2
gitdb: 0.6.4
gitpython: 2.0.5
ioflo: Not Installed
Jinja2: 2.8
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: 0.21.1
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.7
mysql-python: 1.2.5
pycparser: 2.14
pycrypto: 2.6.1
pygit2: Not Installed
Python: 2.7.9 (default, Mar 1 2015, 12:57:24)
python-gnupg: 0.3.8
PyYAML: 3.11
PyZMQ: 15.2.0
RAET: Not Installed
smmap: 0.9.0
timelib: Not Installed
Tornado: 4.3
ZMQ: 4.0.5
System Versions:
dist: debian 8.5
machine: x86_64
release: 4.1.3-cloudflare
system: Linux
version: debian 8.5
Activity
Ch3LL commentedon Aug 15, 2016
ping @cro could I get your input on this issue? Any advice as to why this might be occuring? Or maybe somewhere he can look to track this issue down?
My only suggestion for right now is to check the debug logs when this occurs and see if there is any relevant logs. Thanks
mirceaulinic commentedon Aug 15, 2016
Hi @Ch3LL,
Being in a production environment, the log level was set to warning therefore the logs did not catch anything suspicious. I decreased to debug level and I will wait till this happens again when I will provide some more data for this ticket.
Thanks,
Mircea
Ch3LL commentedon Aug 16, 2016
Sounds great thanks @mirceaulinic
mirceaulinic commentedon Aug 19, 2016
This issue happened today again.
Please find the logs section below:
Is there any other information I can provide?
mirceaulinic commentedon Aug 22, 2016
@Ch3LL @cro
I confirm that's all the information provided in the logs:
Executing:
Logs:
Although the minion replied for other requests such:
cro commentedon Aug 22, 2016
@mirceaulinic I will look into this tomorrow.
mirceaulinic commentedon Aug 22, 2016
Thanks @cro!
cro commentedon Aug 22, 2016
@mirceaulinic I've been looking over this and I know that pre #35178 proxies cache all the modules in the same place, but I am suspicious that #35178 might alleviate this. Is there any way for you to try that?
(as an aside, thank you for the excellent bug reports.)
mirceaulinic commentedon Aug 22, 2016
Great! Anyway I had in mind to put this week in the production the code from #35178 - most probably on Wednesday. Then I will come back with a feedback. Thank you!
@cro thanks for appreciation! I am glad I can provide useful information :)
mirceaulinic commentedon Aug 23, 2016
As a followup, I installed the code on a testing platform and I confirm it works as expected:
One directory per minion - nice!
Tomorrow I will push it into production.
mirceaulinic commentedon Aug 24, 2016
Hi @cro,
Today I upgraded our Salt production instance - please find versions report below:
$ sudo salt --versions-report Salt Version: Salt: 2016.3.2-104-g962e493 Dependency Versions: cffi: 1.7.0 cherrypy: Not Installed dateutil: 2.2 gitdb: 0.6.4 gitpython: 2.0.5 ioflo: Not Installed Jinja2: 2.8 libgit2: Not Installed libnacl: Not Installed M2Crypto: 0.21.1 Mako: Not Installed msgpack-pure: Not Installed msgpack-python: 0.4.8 mysql-python: 1.2.5 pycparser: 2.14 pycrypto: 2.6.1 pygit2: Not Installed Python: 2.7.9 (default, Mar 1 2015, 12:57:24) python-gnupg: 0.3.8 PyYAML: 3.11 PyZMQ: 15.4.0 RAET: Not Installed smmap: 0.9.0 timelib: Not Installed Tornado: 4.4.1 ZMQ: 4.1.5 System Versions: dist: debian 8.5 machine: x86_64 release: 4.1.3-cloudflare system: Linux version: debian 8.5As on the testing server, the changes from #35178 created separate caching directories for each minion - which confirms yet again that works as expected (truncated output):
Unfortunately, just a few minutes ago, a colleague paste me the following:
I do not have any log entries (as the log level has been increased again to warning), but I assume it should be similar as above.
What would you suggest to do now, in order to help debugging?
Also, upgrading to this version, on can notice that
DeprecationWarningis raised whenever a command is executed. Is there a way to turn it off?Thank you!
cro commentedon Aug 24, 2016
Hi @mirceaulinic,
Quick idea as I dive into this a little more--is the
transitmodule located in /srv/salt/_modules? If so, did you do a sync_modules?mirceaulinic commentedon Aug 24, 2016
The source modules are located under
/etc/salt/proxy-master/, which is specified in the master config file as:I will expand a bit more on the steps I performed earlier today:
pip install -U git+https://github.com/saltstack/[email protected]#egg=saltinside the Salt venvI did not run sync_modules, but I was able to execute the modules immediately after restarting the proxy processes.
Please let me know if that was correct. If not, what is the right way to sync_modules? I would like to remind you that this box is also a straight minion itself and
salt-call saltutil.sync_moduleswould synchronise its modules instead of the proxy modules.Sometimes I use
salt <proxy_name> saltutil.sync_modules, but my understanding was that will sync only for<proxy_name>. I am not sure about this though, would be actually quite good news if I am wrong :)Thank you!
49 remaining items
mirceaulinic commentedon May 26, 2017
@cro After the discussion from #41024, I am wondering if this may be related by any chance to the way we are defining the
__virtual__function. Do you think there could be a slight possibility to:proxykey no longer available in the__opts__(theproxykey is defined in the pillar.). Would you assume there might be a possibility that while the proxy process is alive, it can loose the pillar data merged in the opts?But in that case why does
sync_allreload the modules, as in my comment above #35443 (comment)mirceaulinic commentedon Jun 7, 2017
As a followup (obivously to myself): checked when this happens and the
proxykey still exists in the__opts__(verified usingtest.get_opts).mirceaulinic commentedon Jul 25, 2017
Is this issue still scheduled to be solved in Nitrogen?
Once again, I am happy to help, but I really don't know where to start from and awaiting an expert's input on this.
mirceaulinic commentedon Nov 30, 2017
This Pull Request #39948 might finally solve this issue.
stale commentedon Mar 25, 2019
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.