Skip to content
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

2016.3.1 breaks diskusage beacon #33972

Closed
morganwillcock opened this issue Jun 13, 2016 · 8 comments
Closed

2016.3.1 breaks diskusage beacon #33972

morganwillcock opened this issue Jun 13, 2016 · 8 comments
Labels
cannot-reproduce cannot be replicated with info/context provided fixed-pls-verify fix is linked, bug author to confirm fix info-needed waiting for more info
Milestone

Comments

@morganwillcock
Copy link
Contributor

The disk usage beacon is working on a Windows minion (no errors and events are fired) but doesn't seem to be working on a Debian minion (I've not tested any other platforms). To re-create the problem:

/srv/pillar/top.sls

base:
  'linuxminion':
    - beacons

/srv/pillar/beacons.sls

beacons:
  diskusage:
    - interval: 60
    - /: 5%

(I've also tried quoting the forward slash)

salt linuxminion saltutil.refresh_pillar

(I've also tried restarting the minion process)

2016-06-13 14:08:43,808 [salt.beacons     ][TRACE   ][11953] Beacon processing: diskusage
2016-06-13 14:08:43,809 [salt.utils.lazy  ][DEBUG   ][11953] LazyLoaded diskusage.beacon
2016-06-13 14:08:43,810 [salt.beacons     ][DEBUG   ][11953] Unable to process beacon diskusage
2016-06-13 14:08:44,807 [salt.beacons     ][TRACE   ][11953] Beacon processing: diskusage
2016-06-13 14:08:44,808 [salt.utils.lazy  ][DEBUG   ][11953] LazyLoaded diskusage.beacon
2016-06-13 14:08:44,809 [salt.beacons     ][DEBUG   ][11953] Unable to process beacon diskusage
2016-06-13 14:08:45,807 [salt.beacons     ][TRACE   ][11953] Beacon processing: diskusage
2016-06-13 14:08:45,808 [salt.utils.lazy  ][DEBUG   ][11953] LazyLoaded diskusage.beacon
2016-06-13 14:08:45,809 [salt.beacons     ][DEBUG   ][11953] Unable to process beacon diskusage
2016-06-13 14:08:46,808 [salt.beacons     ][TRACE   ][11953] Beacon processing: diskusage
2016-06-13 14:08:46,809 [salt.utils.lazy  ][DEBUG   ][11953] LazyLoaded diskusage.beacon
2016-06-13 14:08:46,810 [salt.beacons     ][DEBUG   ][11953] Unable to process beacon diskusage
2016-06-13 14:08:47,808 [salt.beacons     ][TRACE   ][11953] Beacon processing: diskusage
2016-06-13 14:08:47,809 [salt.utils.lazy  ][DEBUG   ][11953] LazyLoaded diskusage.beacon
2016-06-13 14:08:47,810 [salt.beacons     ][DEBUG   ][11953] Unable to process beacon diskusage
2016-06-13 14:08:48,808 [salt.beacons     ][TRACE   ][11953] Beacon processing: diskusage
2016-06-13 14:08:48,808 [salt.utils.lazy  ][DEBUG   ][11953] LazyLoaded diskusage.beacon
2016-06-13 14:08:48,809 [salt.beacons     ][DEBUG   ][11953] Unable to process beacon diskusage

Tested on 2016.3.0

@Ch3LL
Copy link
Contributor

Ch3LL commented Jun 13, 2016

@morganwillcock I'm able to see beacon events from a centos7 minion while configuring beacons via pillar and minion config on centos7. What version of debian are you seeing this on? 7 or 8?

beacons:
  diskusage:
    - interval: 2
    - /: 5%

@Ch3LL Ch3LL added cannot-reproduce cannot be replicated with info/context provided info-needed waiting for more info labels Jun 13, 2016
@Ch3LL Ch3LL added this to the Blocked milestone Jun 13, 2016
@morganwillcock
Copy link
Contributor Author

@Ch3LL Thanks for looking at this. I tried it on 7 and 8, but only checked the logs on 8.

@morganwillcock
Copy link
Contributor Author

Just checked, the same error is logged on 7.

@cachedout
Copy link
Contributor

Possibly fixed here? #33474

@morganwillcock
Copy link
Contributor Author

I've just tried applying that, but still have the same result.

@morganwillcock
Copy link
Contributor Author

Sorry this was my fault. I had assumed that psutils was installed as standard dependency of the minion package, installing this lets the beacon process correctly.

@cachedout I had to revert #33474 as I was getting a traceback with it applied.

2016-06-15 11:29:39,287 [salt.minion      ][CRITICAL][20575] The beacon errored: 
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/minion.py", line 2022, in handle_beacons
    beacons = self.process_beacons(self.functions)
  File "/usr/lib/python2.7/dist-packages/salt/minion.py", line 380, in process_beacons
    return self.beacons.process(b_conf)  # pylint: disable=no-member
  File "/usr/lib/python2.7/dist-packages/salt/beacons/__init__.py", line 91, in process
    raw = self.beacons[fun_str](b_config[mod])
  File "/usr/lib/python2.7/dist-packages/salt/beacons/diskusage.py", line 74, in beacon
    _current_usage = psutil.disk_usage(mount)
  File "/usr/lib/python2.7/dist-packages/psutil/__init__.py", line 1690, in disk_usage
    return _psplatform.disk_usage(path)
  File "/usr/lib/python2.7/dist-packages/psutil/_psposix.py", line 121, in disk_usage
    st = os.statvfs(path)
TypeError: must be string, not dict

@morganwillcock morganwillcock changed the title Unable to process beacon diskusage 2016.3.1 breaks diskusage beacon Jun 17, 2016
@rallytime
Copy link
Contributor

@morganwillcock Thank you for you investigation and for the fix. Your PR has been merged, and I have back-ported your change in #34176 to the 2015.8 branch. Can this be closed now?

@rallytime rallytime added the fixed-pls-verify fix is linked, bug author to confirm fix label Jun 21, 2016
@morganwillcock
Copy link
Contributor Author

Yes, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cannot-reproduce cannot be replicated with info/context provided fixed-pls-verify fix is linked, bug author to confirm fix info-needed waiting for more info
Projects
None yet
Development

No branches or pull requests

4 participants