You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
grains.get can't get minion's /etc/salt/grains value in multi-master set up #25040
[root@test-master~]# salt "*tst03*" grains.setval yiTest test
tst03.domain.com:
----------
yiTest:
test
[root@test-master salt]# cat /etc/salt/grains
OSSize: 30G
RAMSize: 2G
yiTest: test
[root@test-master ~]# salt "*tst03*" grains.get yiTest
tst03.domain.com:
Versions report:
[root@test-master ~]# salt "*tst03*" test.versions_report
Salt: 2015.5.2
Python: 2.6.6 (r266:84292, Jan 22 2014, 01:49:05)
Jinja2: 2.2.1
M2Crypto: 0.20.2
msgpack-python: 0.4.6
msgpack-pure: Not Installed
pycrypto: 2.6.1
libnacl: Not Installed
PyYAML: 3.10
ioflo: Not Installed
PyZMQ: 14.5.0
RAET: Not Installed
ZMQ: 4.0.5
Mako: Not Installed
As you can see, grains.get can't retrieve the grain's value which is already set up in minion successfully. In our minion configuration file, we define the multiple masters as below. We think the error was because grains master function can't return list, but only return one value.
@jfindlay Just wanted to point out that the grains get populated correctly after salt-minion is restarted on the minion. Grains retrieval works fine in that case on both masters.
the docs show refresh=True as the default but this doesnt refresh the grain data for me. The only way I can see that grain data is to restart the minion. This becomes a problem where we store our program version as a grain and update the grain at the end of a setup. Now with multi master we have to restart the entire minion.
This has been a High severity issue and a bug that exists in the Core reported in July 2015 and the issue still seems to exist in the latest stable version of Salt. Has anyone been working on this from the Salt team?
@cachedout@jfindlay i don't know who is managing the backlog now that @basepi decided to try something else but i think this is issue should be looked at asap.
I'm getting the same issue on latest v 2015.8.8.-2 where the new value is present in the minion's /etc/salt/grains file but but pulling the data from master using grains.get even after a salt-run cache.clear_all OR saltutil.sync_all OR restart minion service no change.
I should mentioned i'm not in a multi-master setup (hence pls let me know if you feel i've hijacked the thread) ...if i did, sorry about it, let me know and i'll open a new issue
Wow, apologies. I haven't had this issue brought to my attention. Yes, this needs to be fixed ASAP. Thank you for pinging me, @DanyC97 . I'm on the case!
Activity
yi9 commentedon Jun 29, 2015
Sorry, the grains cat result should be below, was changing host name so it won't show our real host-name
jfindlay commentedon Jul 1, 2015
@yi9, thanks for the report. As a workaround you can try
salt "*tst03*" saltutil.reload_modules.yi9 commentedon Jul 1, 2015
there is no "reload+modules" function. We tried
saltutil.refresh_modules, still doesn't work.
Thanks,
Yi
On 7/1/15 4:27 PM, Justin Findlay wrote:
nmadhok commentedon Jul 8, 2015
@jfindlay Just wanted to point out that the grains get populated correctly after salt-minion is restarted on the minion. Grains retrieval works fine in that case on both masters.
basepi commentedon Aug 3, 2015
@yi9 What happens if you run a
salt '*' saltutil.sync_grainson each of the masters?basepi commentedon Aug 3, 2015
Interesting,
refresh=Trueisn't the default? I think maybe it should be...FeatherKing commentedon Aug 17, 2015
the docs show refresh=True as the default but this doesnt refresh the grain data for me. The only way I can see that grain data is to restart the minion. This becomes a problem where we store our program version as a grain and update the grain at the end of a setup. Now with multi master we have to restart the entire minion.
mgresser commentedon Jan 12, 2016
I'm also seeing this issue in 2015.8.3. I only see the grain info after minions are restarted.
nmadhok commentedon Mar 2, 2016
This has been a High severity issue and a bug that exists in the Core reported in July 2015 and the issue still seems to exist in the latest stable version of Salt. Has anyone been working on this from the Salt team?
basepi commentedon Mar 2, 2016
As far as I know it hasn't been on anyone's radar.
DanyC97 commentedon May 10, 2016
@cachedout @jfindlay i don't know who is managing the backlog now that @basepi decided to try something else but i think this is issue should be looked at asap.
I'm getting the same issue on latest v 2015.8.8.-2 where the new value is present in the minion's
/etc/salt/grainsfile but but pulling the data from master usinggrains.geteven after asalt-run cache.clear_allORsaltutil.sync_allOR restart minion service no change.I should mentioned i'm not in a multi-master setup (hence pls let me know if you feel i've hijacked the thread) ...if i did, sorry about it, let me know and i'll open a new issue
cachedout commentedon May 10, 2016
Holy cow!
Wow, apologies. I haven't had this issue brought to my attention. Yes, this needs to be fixed ASAP. Thank you for pinging me, @DanyC97 . I'm on the case!
Hash fileclients by opts
cachedout commentedon May 10, 2016
OK, give #33142 a try. Fixes this in my testing.
Apologies for letting this sit for so long!
Hash fileclients by opts (#33142)
DanyC97 commentedon May 17, 2016
thanks a bunch @cachedout !!
linshaoyong commentedon May 24, 2016
problem still exists, Multi-Master, 2015.8.10