chaostoolkit-incubator / chaostoolkit-slack

Chaos Toolkit Plugin for Slack
Apache License 2.0
6 stars 2 forks source link

Notification silently fails when slack has not enough permissions #11

Open dmartin35 opened 3 years ago

dmartin35 commented 3 years ago

in verbose mode, (which is not visible otherwhise), CTK does not indicate any warning neither error indicating the notification has not been sent

[2020-10-19 10:01:14 DEBUG] [notification:229] Slack client call failed: The request to the Slack API failed.
    The server responded with: {'ok': False, 'error': 'missing_scope', 'needed': 'chat:write:bot', 'provided': 'identify,incoming-webhook'}
    Traceback (most recent call last):
      File "/Users/dmartin/Sources/chaostoolkit/chaostoolkit-slack/chaosslack/notification.py", line 225, in notify
        attachments=attachments
      File "/Users/dmartin/.pyenv/versions/3.7.4/envs/chaostk/lib/python3.7/site-packages/slack/web/client.py", line 1077, in chat_postMessage
        return self.api_call("chat.postMessage", json=kwargs)
      File "/Users/dmartin/.pyenv/versions/3.7.4/envs/chaostk/lib/python3.7/site-packages/slack/web/base_client.py", line 150, in api_call
        return self._sync_send(api_url=api_url, req_args=req_args)
      File "/Users/dmartin/.pyenv/versions/3.7.4/envs/chaostk/lib/python3.7/site-packages/slack/web/base_client.py", line 248, in _sync_send
        additional_headers=headers,
      File "/Users/dmartin/.pyenv/versions/3.7.4/envs/chaostk/lib/python3.7/site-packages/slack/web/base_client.py", line 377, in _urllib_api_call
        use_sync_aiohttp=False,
      File "/Users/dmartin/.pyenv/versions/3.7.4/envs/chaostk/lib/python3.7/site-packages/slack/web/slack_response.py", line 194, in validate
        raise e.SlackApiError(message=msg, response=self)
    slack.errors.SlackApiError: The request to the Slack API failed.
    The server responded with: {'ok': False, 'error': 'missing_scope', 'needed': 'chat:write:bot', 'provided': 'identify,incoming-webhook'}

Do we want to indicate any potential error to the user ?