-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2015.8.3 pillar beacons bugged? #29451
Comments
might be related to #27949, but this is from the documentation |
@githubcdr, thanks for the report. |
Confirmed;
borks; it will be passed on to
Changing it to
Works around the problem for now, passing on:
Which works as expected |
I have to say I'm not entirely sure what the exact problem is here; the first OTOH wasn't that first syntax suppposed to deliver an |
But basically, this makes it impossible to use beacons when defined in pillar (which is extremely useful). Am I right? Has anyone found a fix or a workaround? |
@fredrikaverpil negative, just one of the syntaxes is broken. Use the 'alternative' syntax outlined earlier (which is the 'workaround' we use in production). |
I can't get this to generate anything in the event bus, which is from the docs:
...and changing it into the following still doesn't make anything show in the event bus:
I'm viewing the event bus in order to catch any such event: |
the diskusage beacon expects a list of dictionaries instead of a dict, this is inconsistent with the other beacon configs, although seems to be fixed in the v2016 |
This state generates a unexpected configuration file.
The following file is created when using the beacons.save module, notice the list changed to a dict here.
End result is a non working setup, with a critical error as showed below.
This makes the diskusage beacon as described in the docs practically unusable :( |
I get errors in either case on # /srv/pillar/top.sls
base:
'*':
- schedule.sls
- beacons.sls (schedule.sls runs just fine) Alternative 1# /srv/pillar/beacons.sls
beacons:
diskusage:
- /: 5% Minion log: 2016-05-24 16:07:31,593 [salt.utils.lazy ][DEBUG ][10453] LazyLoaded diskusage.beacon
2016-05-24 16:07:31,593 [salt.minion ][CRITICAL][10453] The beacon errored:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/salt/minion.py", line 1750, in handle_beacons
beacons = self.process_beacons(self.functions)
File "/usr/lib/python2.7/site-packages/salt/minion.py", line 364, in process_beacons
return self.beacons.process(b_conf)
File "/usr/lib/python2.7/site-packages/salt/beacons/__init__.py", line 55, in process
interval = self._determine_beacon_config(mod, 'interval', b_config)
File "/usr/lib/python2.7/site-packages/salt/beacons/__init__.py", line 105, in _determine_beacon_config
config = config_mod[mod].get(val, False)
AttributeError: 'list' object has no attribute 'get' Alternative 2# /srv/pillar/beacons.sls
beacons:
diskusage:
/: 5% Minion log: 2016-05-24 15:53:38,752 [salt.minion ][CRITICAL][1079] The beacon errored:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/salt/minion.py", line 1750, in handle_beacons
beacons = self.process_beacons(self.functions)
File "/usr/lib/python2.7/site-packages/salt/minion.py", line 364, in process_beacons
return self.beacons.process(b_conf)
File "/usr/lib/python2.7/site-packages/salt/beacons/__init__.py", line 73, in process
raw = self.beacons[fun_str](b_config[mod])
File "/usr/lib/python2.7/site-packages/salt/beacons/diskusage.py", line 66, in beacon
mount = diskusage.keys()[0]
AttributeError: 'str' object has no attribute 'keys' Any idea of a workaround? |
Looks like the diskusage beacon was completely broken. I have submitted a patch to fix it here: #33474 Apologies for that. |
With the new patch, and using the syntax from the beacons:
diskusage:
- /: 5% 2016-05-24 16:55:01,775 [salt.minion ][CRITICAL][14648] The beacon errored:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/salt/minion.py", line 1750, in handle_beacons
beacons = self.process_beacons(self.functions)
File "/usr/lib/python2.7/site-packages/salt/minion.py", line 364, in process_beacons
return self.beacons.process(b_conf)
File "/usr/lib/python2.7/site-packages/salt/beacons/__init__.py", line 55, in process
interval = self._determine_beacon_config(mod, 'interval', b_config)
File "/usr/lib/python2.7/site-packages/salt/beacons/__init__.py", line 105, in _determine_beacon_config
config = config_mod[mod].get(val, False)
AttributeError: 'list' object has no attribute 'get' |
@fredrikaverpil Yes, that is the same stacktrace as the original report. This appears to be related to the way the configuration is coming in from pillar. |
@cachedout Ok! Also, not sure if related or not, but when you perform a |
@fredrikaverpil Sounds related to this one. Let's fix this one first and if that issue persists after that, I'll ask you to open a separate issue. Thanks! |
@cachedout Sounds great, thank you! It's possible that that was intended behavior, as the beacons do turn up when you run a |
OK @githubcdr and @fredrikaverpil give this a try: #33476 |
@cachedout so I've downloaded the new myminion
----------
beacons:
- beacons.__init__
- becons.diskusage I can also see them being synced in the minion log:
I then restarted the salt service on 2016-05-25 08:04:00,646 [salt.utils.lazy ][DEBUG ][11398] LazyLoaded diskusage.beacon
2016-05-25 08:04:00,647 [salt.minion ][CRITICAL][11398] The beacon errored:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/salt/minion.py", line 1750, in handle_beacons
beacons = self.process_beacons(self.functions)
File "/usr/lib/python2.7/site-packages/salt/minion.py", line 364, in process_beacons
return self.beacons.process(b_conf)
File "/usr/lib/python2.7/site-packages/salt/beacons/__init__.py", line 55, in process
interval = self._determine_beacon_config(mod, 'interval', b_config)
File "/usr/lib/python2.7/site-packages/salt/beacons/__init__.py", line 105, in _determine_beacon_config
config = config_mod[mod].get(val, False)
AttributeError: 'list' object has no attribute 'get' So I checked the diff on What am I missing or doing wrong since these new patched files in |
The |
@cachedout I copied the files in place by hand, per your instructions, and after restarting the salt-minion service I now get this on the minion: 2016-05-26 10:50:09,252 [salt.minion ][CRITICAL][7636] The beacon errored:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/salt/minion.py", line 1750, in handle_beacons
beacons = self.process_beacons(self.functions)
File "/usr/lib/python2.7/site-packages/salt/minion.py", line 364, in process_beacons
return self.beacons.process(b_conf)
File "/usr/lib/python2.7/site-packages/salt/beacons/__init__.py", line 73, in process
raw = self.beacons[fun_str](b_config[mod])
File "/var/cache/salt/minion/extmods/beacons/diskusage.py", line 69, in beacon
_current_usage = psutil.disk_usage(mount)
File "/usr/lib64/python2.7/site-packages/psutil/__init__.py", line 1787, in disk_usage
return _psplatform.disk_usage(path)
File "/usr/lib64/python2.7/site-packages/psutil/_psposix.py", line 122, in disk_usage
st = os.statvfs(path)
TypeError: must be string, not dict |
Hi @cachedout, Some errors here too after replacing "/usr/lib/python2.7/site-packages/salt/beacons/init.py"
using this state
|
@cachedout is there anything I can do to test this further? I got the feeling that a big part of the beacon functionality is broken on a low level, preventing any use. It would be really nice if beacons received some love, because this is what makes salt dynamic compared to other systems. |
Hi, Sorry for re-opening this issue, but it seems the beacon emit function causes a critical error, the config part is loading correctly now. I see this in /var/log/salt/minion
I removed all .pyc leftovers and double checked the logs. |
Hi,
After upgrading to 2015.8.3 I get the following error spamming journald; My beacons are configured in pillar and worker in previous versions.
I tried changing the config and clearing the cache but the error stays.
The text was updated successfully, but these errors were encountered: