salt: spurious warnings from event.wait when event is not fired
The following works dandily. Various parts of the state tree install listen bits.
HTTP_ipt_update_notification:
event.wait:
- name: resin/iptables/seed-02.mysql.proxymesh.020.lab.rackspace.ord/HTTP/update
- data:
access:
- 192.237.167.224
- 10.208.136.119
services:
- sshd:
address: 0.0.0.0
port: 22
proto: tcp
- nginx:
address: 0.0.0.0
port: 443
proto: tcp
When a change triggers mod_watch:
----------
ID: HTTP_ipt_update_notification
Function: event.wait
Name: resin/iptables/seed-02.mysql.proxymesh.020.lab.rackspace.ord/HTTP/update
Result: True
Comment: Event fired
Started: 01:23:40.598193
Duration: 32.448 ms
Changes:
----------
data:
None
tag:
resin/iptables/seed-02.mysql.proxymesh.020.lab.rackspace.ord/HTTP/update
And the event: (are the accompanying reqs bits supposed to be tagging along?)
Tag: resin/iptables/seed-02.mysql.proxymesh.020.lab.rackspace.ord/HTTPS/update
Data:
{ 'cmd': '_minion_event',
'data': { '__reqs__': { 'onchanges': [],
'onfail': [],
'prereq': [],
'prerequired': [],
'require': [],
'watch': [ { '__env__': 'base',
'__id__': 'HTTPS_iptables_tcp_ipv6',
'__sls__': 'services.https',
'chain': 'HTTPS',
'comment': 'https - saltstack 2015.5.0',
'ctstate': 'NEW',
'family': 'ipv6',
'fun': 'insert',
'jump': 'ACCEPT',
'listen_in': [...],
'match': [...],
'name': 'HTTPS_iptables_tcp_ipv6',
'order': 10051,
'position': 1,
'proto': 'tcp',
'require': [...],
'require_in': [...],
'source': '::1',
'state': 'iptables',
'table': 'filter',
'watch_in': [...]},
{ '__env__': 'base',
'__id__': 'HTTPS_iptables_tcp_ipv4',
[lots more of this],
}],
'access': ['192.237.167.224', '10.208.136.119'],
'services': [ { 'address': '0.0.0.0',
'port': 22,
'proto': 'tcp',
'sshd': None},
{ 'address': '0.0.0.0',
'nginx': None,
'port': 443,
'proto': 'tcp'}],
'sfun': 'wait'},
'id': 'seed-02.mysql.proxymesh.020.lab.rackspace.ord',
'pretag': None,
Subsequent runs of this state tree elicit the following.
----------
ID: HTTP_ipt_update_notification
Function: event.wait
Name: resin/iptables/seed-02.mysql.proxymesh.020.lab.rackspace.ord/HTTP/update
Result: True
Comment:
Started: 01:21:27.775560
Duration: 1.714 ms
Changes:
Warnings: 'access', 'services' and 'data' are invalid keyword arguments for
'event.wait'. If you were trying to pass additional data to be
used in a template context, please populate 'context' with 'key:
value' pairs. Your approach will work until Salt Carbon is out.
Please update your state files.
This does not occur with event.send.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 4
- Comments: 28 (17 by maintainers)
I got the same issue, with Salt 2016.11
Doesn’t look stale…
This is still happening with 2016.11.3.
I’ve followed the documentation for event.wait and have the following states:
When there are changes applied during the highstate and the
apache2
service is reloaded then I see this on the event bus:However, when the
apache2
state does not need to be reloaded and therefore theapi-checks
state is not run, I receive a warning:In preparation for https://github.com/saltstack/community/blob/master/doc/Community-Message.pdf I’m getting all of our hosts running the 2019.2.x series of Salt and I just hit this. Ouch! Now I remember why I couldn’t upgrade…
Thanks @waynew and @corywright for both investigating and confirming that
**kwargs
really was all that was required.Doing some research on this:
wait
was created in this commitNoop . The state system will call the mod_watch function instead
”. The documentation also indicated that supplying arbitrary data was A-OK.Additionally, I can send this:
Which results in this event:
If I add a
**kwargs
parameter tostates/event.py wait
and then use this state:Running
state.apply
results in this event:If you remove the extra bits,
data
contains the exact same information.Based on this, the correct fix is to add
**kwargs
tostates.event.wait
.For a current workaround, I would recommend doing something like:
As @bicofino says the event.wait function is broken in 2019.2.0. It stops running the state on minion and returns:
Passed invalid arguments: 'data' is an invalid keyword argument for 'event.wait'.
This is critical for us, we have a lot of installations using event.wait as event.send can’t handle the watch function.
With the new salt-minion version(salt-2019.2.0-1) it broke.
Passed invalid arguments: 'data' is an invalid keyword argument for 'event.wait'.
The docs are not clear https://docs.saltstack.com/en/latest/ref/states/all/salt.states.event.html