salt icon indicating copy to clipboard operation
salt copied to clipboard

slack returner issue

Open ksmitdevops opened this issue 11 years ago • 5 comments

I'm trying set up a slack returner, but salt-master isn't finding it. My master config for this returner is set up like so:

slack:
  api_key:   [munged]
  channel:   saltstack-alerts
  from_name: saltstack

but when I configure my master to use event_return: slack, it blows up /var/log/salt/master with errors indicating: slack returner not found. I get the error using event_return: slack_returner as well, since i wasn't sure if the name was other than slack.

Using --return slack does not work either, though i'm unable to find errors for it. It seems to silently do nothing.

salt-master --versions-report
           Salt: 2015.5.3
         Python: 2.7.3 (default, Mar 13 2014, 11:03:55)
         Jinja2: 2.7.3
       M2Crypto: 0.22
 msgpack-python: 0.4.6
   msgpack-pure: Not Installed
       pycrypto: 2.6.1
        libnacl: Not Installed
         PyYAML: 3.11
          ioflo: Not Installed
          PyZMQ: 14.6.0
           RAET: Not Installed
            ZMQ: 4.0.5
           Mako: Not Installed
        Tornado: 4.2
salt-minion --versions-report
           Salt: 2015.5.3
         Python: 2.7.3 (default, Mar 13 2014, 11:03:55)
         Jinja2: 2.7.3
       M2Crypto: 0.22
 msgpack-python: 0.4.6
   msgpack-pure: Not Installed
       pycrypto: 2.6.1
        libnacl: Not Installed
         PyYAML: 3.11
          ioflo: Not Installed
          PyZMQ: 14.6.0
           RAET: Not Installed
            ZMQ: 4.0.5
           Mako: Not Installed
        Tornado: 4.2

ksmitdevops avatar Aug 05 '15 19:08 ksmitdevops

@schlagify, thanks for the report. Is it possible for you to provide the full, scrubbed master debug log?

jfindlay avatar Aug 06 '15 18:08 jfindlay

yep, i'm unsure what you mean by scrubbed aside from us just protecting private info, but here you go

http://pastebin.com/nRCXqPe2

ksmitdevops avatar Aug 06 '15 20:08 ksmitdevops

Thanks, @schlagify. There doesn't seem to be anything in the log that indicates the reason for the failure. It says it cannot store the events, but it does not say why. Do you have any ideas, @garethgreenaway?

2015-08-06 16:07:30,426 [salt.utils.lazy ][DEBUG ][17247] Could not LazyLoad slack.event_return
2015-08-06 16:07:30,427 [salt.utils.event ][ERROR ][17247] Could not store return for event(s)
[{'tag': 'salt/event_listen/start', 'data': {'_stamp': '2015-08-06T20:07:15.325898'}},
 {'tag': 'salt/event/new_client', 'data': {'_stamp': '2015-08-06T20:07:15.341193'}},
...
 {'tag': 'salt/event/new_client', 'data': {'_stamp': '2015-08-06T20:07:27.490795'}},
 {'tag': 'salt/auth', 'data': {'_stamp': '2015-08-06T20:07:30.422131', 'act': 'accept', 'id': 'lnprscweb02', 'pub':
'-----BEGIN PUBLIC KEY-----\\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAsahw987vLnlmeTxLwSKU\\nAR53MBg3ToeELbQE1IEdGNzH87QYc/zyr3YfMaj/RO4Y2nm0FxDeqdvkwTulPIvH\\nxvoao0guYHmpFul1IaKekqUAnVtsRzRVDrGpJhkUGq7PHxJo5f2jmTY3slyeMEHj\\nzO1jj1Fr+RQt/mUSkZ8zL2DLySfNvVSPy37BfhD6QOMWjFEccF5glBzLVRhW0h/v\\nSxWEx1/fB3gBsqTijSpC95yu1uSbp7bf/DVF707AIaP8dd0ksW8g7okw938ShSjW\\nWTcEZgKTTIc1MjVnB04axlXJc0JbhDL5KllmDwRnLsafra1dwBg0TpGOuHpijtMy\\neATTsFAvt/bTcsqGg0o+HB3K5tvtGzqc3J7ze02osB1marrEV0Rs3ECpkhfVyEbH\\n0sQnP30+5taBWRPt/4EY9hEAQWeaO9CSScJNH7EXUVQPD7fYm1SwZWy7xp/7S73i\\nknZmvobkTQptGRhDi090+wrq8KyWF4wCJf2zQl+miFmTrBsvrlQR73ZHSn6K1PnV\\nvju+LQ4eh+tvBaeNpB89cipkLbrKHTTJ7mCACo4U8AOcD70FYKt0N7HEaPM/V9h6\\nclZqDTqix9v8e3/nMULaomDpa/R3aaaPQWr34TggAs601YZxBRPrsN9rnBxhCTEv\\nVgnIQ9YxJU4NXTTPq1I3PZMCAwEAAQ==\\n-----END PUBLIC KEY-----\\n', 'result': True}}]. Returner 'slack' not found.\n

jfindlay avatar Aug 07 '15 00:08 jfindlay

This is because the event_return function has not be defined for the slack module. However, that's designed to forward all events, which probably isn't what you want to do. (Unless you really want that in your Slack channel for some reason.) Thusly, it's only been written thus far for storage-oriented returners, like MySQL.

The config option you may be looking for instead is master_job_cache (to have the master store returns).

cachedout avatar Aug 10 '15 15:08 cachedout

cool, yeah i had no idea what the output was going to look like. thx for the explanation.

ksmitdevops avatar Aug 10 '15 16:08 ksmitdevops