salt icon indicating copy to clipboard operation
salt copied to clipboard

Custom grains does not seem to update even when running saltutil.sync_grains

Open wongster80 opened this issue 12 years ago • 10 comments

I have a custom grain creating a list:

['hadoop', 'vm-instance', 'ev1'] <type 'list'>

...then stores the list into a dictionary and returns it: {'NODEGROUPS': ['hadoop', 'vm-instance', 'ev1']} <type 'dict'>

running salt 'minion' grains.items does not return the NODEGROUPS grain. Restarting the minion service refreshes the grain and grains.items returns the custom grain.

wongster80 avatar Jun 03 '14 07:06 wongster80

Have you tried running salt '*' saltutil.sync_grains or salt '*' saltutil.sync_all to see if that will force a reload of your grains?

basepi avatar Jun 04 '14 16:06 basepi

Yes tried both and the custom grains isn't available until a minion restart

wongster80 avatar Jun 04 '14 21:06 wongster80

Thanks. We'll investigate this.

basepi avatar Jun 05 '14 17:06 basepi

Could we please have a --versions-report for your master/minion?

cachedout avatar Jun 05 '14 17:06 cachedout

I cannot replicate this in develop. Creating a custom grain, running saltutil.sync_all and then calling grains.items shows the NODEGROUPS meeting as expected.

Please provide a --versions-report and let us know what version you're seeing this on. Thanks!

cachedout avatar Jun 06 '14 20:06 cachedout

Closing for lack of response. If we can get additional information on this problem, we'll happily re-open this and investigate. Thanks.

cachedout avatar Jun 17 '14 22:06 cachedout

Not sure about windows, but I can confirm this is still an issue for minions running linux with 2014.1.11. Can provide more details if required.

           Salt: 2014.1.11
         Python: 2.7.8 (default, Oct  2 2014, 17:06:07)
         Jinja2: 2.7.3
       M2Crypto: 0.22
 msgpack-python: 0.4.2
   msgpack-pure: Not Installed
       pycrypto: 2.6.1
         PyYAML: 3.11
          PyZMQ: 14.3.1
            ZMQ: 4.0.4

spo0nman avatar Nov 27 '14 12:11 spo0nman

@spo0nman We had a serious regression issue in 2014.1.11 and we ended up needed to cut a 2014.1.13 release. Is this still an issue there? We also have an even newer packages with 2014.7.0. I would suggest giving either of those a try, especially 2014.7.0 because it included MANY improvements across the board to see if this is still an issue for you.

rallytime avatar Dec 01 '14 18:12 rallytime

@rallytime I tested with 2014.7.0. the issue is fixed. Custom grains reflect when you do a sync_all

salt '*' saltutil.sync_all


$ salt-call --versions 
           Salt: 2014.7.0
         Python: 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
         Jinja2: 2.2.1
       M2Crypto: 0.20.2
 msgpack-python: 0.1.13
   msgpack-pure: Not Installed
       pycrypto: 2.6.1
        libnacl: Not Installed
         PyYAML: 3.10
          ioflo: Not Installed
          PyZMQ: 14.4.1
           RAET: Not Installed
            ZMQ: 3.2.4
           Mako: Not Installed

spo0nman avatar Dec 03 '14 09:12 spo0nman

Excellent! Glad that is working for you. :)

rallytime avatar Dec 03 '14 15:12 rallytime