Repository navigation
Description
Description of Issue
The salt mine is not updated when mine.update is called with module.run. Calling mine.update directly with salt-call updates the data in the salt mine, though.
Setup
- Configure the minion you're testing with to use a newer version of
module.runby putting the following lines into the minion configuration file (usually/etc/salt/minion):
use_superseded:
- module.run
- Add to the pillar data for the minion you're testing this with:
mine_functions:
uptime:
mine_function: status.uptime
- Run
salt-call saltutil.refresh_pillaron the minion you're testing this with. - Ensure there aren't any leftovers in the salt mine by running
salt-call mine.flushon the minion you're testing this with. - Put the following into a state file, e.g.
test/m.sls:
mine.update:
module.run
- Apply the state
salt-call state.apply test.min the minion you're testing this with. - Check what, if anything, got into the salt mine when the state was applied by running
salt-call mine-get.get '<this minion>' uptime. Voilà, if your setup works like mine, you get no data from the salt mine. - To ensure it's not just your salt mine that is broken, run
salt-call mine.update && salt-call mine-get '<this-inion>' uptimeon the minion you're testing this with.
Running salt-call mine.update && salt-call mine-get '<this-inion>' uptime multiple times should show that the seconds value in the salt mine data for this minion is updated oh every subsequent run of salt-call mine.update. However, when running salt-call state.apply m.test repeatedly the values in the salt mine don't change (if your setup works like mine does).
Steps to Reproduce Issue
Steps to reproduce the issue have been combined with the section "Setup" above.
Versions Report
Salt Master Version Report
Salt Version:
Salt: 2017.7.5
Dependency Versions:
cffi: 1.5.2
cherrypy: 3.5.0
dateutil: 2.4.2
docker-py: 1.9.0
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.8
libgit2: 0.24.0
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: Not Installed
pycparser: 2.14
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: 0.24.0
Python: 2.7.12 (default, Dec 4 2017, 14:50:18)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.2.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4
System Versions:
dist: Ubuntu 16.04 xenial
locale: ISO-8859-1
machine: x86_64
release: 4.4.0-122-generic
system: Linux
version: Ubuntu 16.04 xenial
Salt Minion Version Report
Salt Version:
Salt: 2017.7.5
Dependency Versions:
cffi: 1.5.2
cherrypy: 3.5.0
dateutil: 2.4.2
docker-py: 1.9.0
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.8
libgit2: 0.24.0
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: Not Installed
pycparser: 2.14
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: 0.24.0
Python: 2.7.12 (default, Dec 4 2017, 14:50:18)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.2.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4
System Versions:
dist: Ubuntu 16.04 xenial
locale: ISO-8859-1
machine: x86_64
release: 4.4.0-122-generic
system: Linux
version: Ubuntu 16.04 xenial
Additional Information
It appears that calling mine.send with module.run in a state file fails to update the salt mine in a similar fashion. However, to keep the length of this issue report within the limits of "readable", I left the details concerning mine.send out of it as I am fairly certain that fixing one will result in both getting fixed.
Activity
Ch3LL commentedon May 16, 2018
i'm not able to replicate this. it is working fine for me. Here is my use case. please correct me if you see something different you are doing in your scenario:
Did you just see this after an upgrade? I wonder if your cache has been corrupt by chance? maybe wipe out the cache?
Ch3LL commentedon May 17, 2018
ahh thanks for updating.
So it seems with the new syntax of
module.runyou cannot simply run:with the function as the state id:
Here is a workaround in the meantime:
ping @isbm is this on purpose? this seems to break expected functionality to be able to set the id as the function name as well.
Reiner030 commentedon Jan 15, 2019
In many issues it's interesting to monitor what on "your" side get's a "Cannot Reproduce" ...
To be prepared for Sodium I changed my states to actual "module.run" version.
For all other calls it works fine so I found this bug only now because on one developer VM it was called and this state is required in other states (and normally called as module.wait).
Tested first with (not updated Dev VM saltstack version):
and then with my actual saltstack version for all instances:
Simplified state file system/minion.sls:
... and the result is "CAN Reproduce":
The interesting part here is that I migrated to "new version" but still get complains about using "deprecated version"... so my setup which is equal to your posted workaround isn't working ?!?!?
Btw. mine.update is working fine for both versions:
Ch3LL commentedon Jan 17, 2019
I was able to replicate the issue after the initial reporter verified he was using the new version of module.run. To verify do you have this set in your minion config?
the error you are seeing means its trying to load the state_id as a function which is the old usage of module.run.
also bump @isbm for my initial question in my comment above.
Reiner030 commentedon Jan 25, 2019
yes with this modification this state is also working correctly. thx.
But there are still several (documentation) bugs because:
without telling the user that he needs modification to activate the new version
but fails in new variant "without parameters" like above:
which is a very weird behavior... Else it works for none or for both setups ?!?
This was the main problem because only one state out of 27 was failing in my case so I reported it in this issue as still open bug.
Improvement: The documentation for
module.runis missing - onlymodule.waitis defined at https://docs.saltstack.com/en/2017.7/ref/states/all/salt.states.module.html#salt.states.module.waitImprovement: Also in https://docs.saltstack.com/en/2017.7/ref/states/all/salt.states.module.html
there are a huge of examples (> 3 screen pages) for the new variant without having a recognizable note (as eye-catcher) that the user has to modify its config to get it active.
The "small" hint at the very very end:
By default this behaviour is not turned on. In order to do so, please add the following configuration to the minion:just before the definition ofmodule.wait(withmodule.rundefinition missing) can only be found if you look for your mentioneduse_supersededentry.Bests ;)
Ch3LL commentedon Feb 12, 2019
thanks i'll label this a documentation bug so we can get this cleaned up.
dwoz commentedon Jul 2, 2026
Fix merged and shipped in a supported release. Closing per bulk triage. Reopen if this reproduces on a currently supported release (3006.x, 3007.x, 3008.x, master).