Skip to content

beacon enable from state is failing #30994

Closed

Description

@onorua

versions:

dpkg -l | grep salt
ii  salt-common                     2015.8.5+ds-1                    all          shared libraries that salt requires for all packages
ii  salt-master                     2015.8.5+ds-1                    all          remote manager to administer servers via salt
ii  salt-minion                     2015.8.5+ds-1                    all          client package for salt, the distributed remote execution system

dpkg -l | grep inoti
ii  python-pyinotify                0.9.4-1build1                    all          simple Linux inotify Python bindings

state.sls

inotify-requirements:
  pkg.installed:
    - pkgs:
      - python-pyinotify

watch_sudoers:
  beacon.present:
    - name: inotify
    - enabled: true
    - /etc/sudoers:
        mask:
          - modify
          - create
          - delete
          - moved_to
          - close_write
          - attrib
          - move_self
          - delete_self

it's failing with following error message:

[INFO    ] Running state [inotify] at time 09:32:15.366417
[INFO    ] Executing state beacon.present for inotify
[DEBUG   ] SaltEvent PUB socket URI: ipc:///var/run/salt/minion/minion_event_149afc8ff5_pub.ipc
[DEBUG   ] SaltEvent PULL socket URI: ipc:///var/run/salt/minion/minion_event_149afc8ff5_pull.ipc
[DEBUG   ] SaltEvent PUB socket URI: ipc:///var/run/salt/minion/minion_event_149afc8ff5_pub.ipc
[DEBUG   ] SaltEvent PULL socket URI: ipc:///var/run/salt/minion/minion_event_149afc8ff5_pull.ipc
[DEBUG   ] Sending event - data = {'_stamp': '2016-02-08T09:32:15.368247', 'func': 'list'}
[TRACE   ] get_event() received = {'tag': '/salt/minion/minion_beacons_list_complete', 'data': {'beacons': {'enabled': True, 'inotify': {'/etc/sudoers': {'auto_add': True, 'mask': ['modify', 'create', 'delete', 'moved_to', 'close_write', 'attrib', 'move_self', 'delete_self']}}}, '_stamp': '2016-02-08T09:32:15.369220', 'complete': True}}
[DEBUG   ] event_ret {'beacons': {'enabled': True, 'inotify': {'/etc/sudoers': {'auto_add': True, 'mask': ['modify', 'create', 'delete', 'moved_to', 'close_write', 'attrib', 'move_self', 'delete_self']}}}, '_stamp': '2016-02-08T09:32:15.369220', 'complete': True}
[DEBUG   ] SaltEvent PUB socket URI: ipc:///var/run/salt/minion/minion_event_149afc8ff5_pub.ipc
[DEBUG   ] SaltEvent PULL socket URI: ipc:///var/run/salt/minion/minion_event_149afc8ff5_pull.ipc
[DEBUG   ] SaltEvent PUB socket URI: ipc:///var/run/salt/minion/minion_event_149afc8ff5_pub.ipc
[DEBUG   ] SaltEvent PULL socket URI: ipc:///var/run/salt/minion/minion_event_149afc8ff5_pull.ipc
[DEBUG   ] Sending event - data = {'_stamp': '2016-02-08T09:32:15.422529', 'func': 'list'}
[TRACE   ] get_event() received = {'tag': '/salt/minion/minion_beacons_list_complete', 'data': {'beacons': {'enabled': True, 'inotify': {'/etc/sudoers': {'auto_add': True, 'mask': ['modify', 'create', 'delete', 'moved_to', 'close_write', 'attrib', 'move_self', 'delete_self']}}}, '_stamp': '2016-02-08T09:32:15.423439', 'complete': True}}
[DEBUG   ] event_ret {'beacons': {'enabled': True, 'inotify': {'/etc/sudoers': {'auto_add': True, 'mask': ['modify', 'create', 'delete', 'moved_to', 'close_write', 'attrib', 'move_self', 'delete_self']}}}, '_stamp': '2016-02-08T09:32:15.423439', 'complete': True}
[DEBUG   ] Successfully imported beacon.
[INFO    ] Configuration for inotify beacon must be a dictionary of dictionaries.
[ERROR   ] An exception occurred in this state: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1624, in call
    **cdata['kwargs'])
  File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1491, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/salt/states/beacon.py", line 70, in present
    ret['changes'] = result['changes']
KeyError: 'changes'

[INFO    ] Completed state [inotify] at time 09:32:15.501020
[DEBUG   ] File /var/cache/salt/minion/accumulator/139954555719568 does not exist, no need to cleanup.
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'ubuntu-14-04', 'tcp://172.17.0.3:4506', 'aes')
[DEBUG   ] Initializing new SAuth for ('/etc/salt/pki/minion', 'ubuntu-14-04', 'tcp://172.17.0.3:4506')
[DEBUG   ] LazyLoaded highstate.output
[TRACE   ] data = {'local': {'beacon_|-watch_sudoers_|-inotify_|-present': {'comment': u'An exception occurred in this state: Traceback (most recent call last):\n  File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1624, in call\n    **cdata[\'kwargs\'])\n  File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1491, in wrapper\n    return f(*args, **kwargs)\n  File "/usr/lib/python2.7/dist-packages/salt/states/beacon.py", line 70, in present\n    ret[\'changes\'] = result[\'changes\']\nKeyError: \'changes\'\n', 'name': 'inotify', 'start_time': '09:32:15.366417', 'result': False, 'duration': u'134.603 ms', '__run_num__': 1, 'changes': {}}, 'pkg_|-inotify-requirements_|-inotify-requirements_|-installed': {'comment': u'All specified packages are already installed', 'name': 'python-pyinotify', 'start_time': '09:32:13.430094', 'result': True, 'duration': u'1935.617 ms', '__run_num__': 0, 'changes': {}}}}

meanwhile, if I remove enabled: True from state, and do

salt '*' beacon.enable 

I got

salt '*' beacons.list              
ubuntu-14-04:
    beacons:
      enabled: true
      inotify:
        /etc/sudoers:
          auto_add: true
          mask:
          - modify
          - create
          - delete
          - moved_to
          - close_write
          - attrib
          - move_self
          - delete_self

There is definitely something wrong with it.

Activity

  1. added
    bug
    severity-medium
    P3
    Platform
    on Feb 8, 2016
  2. added this to the Approved milestone on Feb 8, 2016
  3. jfindlay commented on Feb 8, 2016

    @jfindlay
    Contributor

    @onorua, thanks for the report.

  4. cachedout commented on Feb 11, 2016

    @cachedout
    Contributor
  5. garethgreenaway commented on Feb 12, 2016

    @garethgreenaway
    Contributor

    @cachedout will take a look.

  6. garethgreenaway commented on Feb 12, 2016

    @garethgreenaway
    Contributor

    Believe I've found the issue, working on a fix now.

  7. cachedout commented on Feb 12, 2016

    @cachedout
    Contributor

    Awesome! Thank you, @garethgreenaway

  8. added
    fixed-pls-verify
    on Feb 12, 2016
  9. garethgreenaway commented on Feb 12, 2016

    @garethgreenaway
    Contributor

    @cachedout no worries :) Need to prep a similar PR for develop, as those changes will break some of the beacons that are in develop and not 2015.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Platformbugfixed-pls-verifyseverity-medium

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions