chaostoolkit-incubator / chaostoolkit-slack Goto Github PK
View Code? Open in Web Editor NEWChaos Toolkit Plugin for Slack
License: Apache License 2.0
Chaos Toolkit Plugin for Slack
License: Apache License 2.0
I'm getting could not find Python plugin 'chaosslack.notification' for notification
when trying to send a notification from a container based on the image defined in https://github.com/vfarcic/chaostoolkit-container-image/blob/master/Dockerfile.
I double-checked that the plugin is installed.
pip install -U chaostoolkit-slack
Requirement already up-to-date: chaostoolkit-slack in /usr/local/lib/python3.8/site-packages (0.2.0)
Requirement already satisfied, skipping upgrade: slackclient in /usr/local/lib/python3.8/site-packages (from chaostoolkit-slack) (2.5.0)
Requirement already satisfied, skipping upgrade: logzero in /usr/local/lib/python3.8/site-packages (from chaostoolkit-slack) (1.5.0)
Requirement already satisfied, skipping upgrade: chaostoolkit-lib>=0.15.0 in /usr/local/lib/python3.8/site-packages (from chaostoolkit-slack) (1.8.1)
Requirement already satisfied, skipping upgrade: aiohttp>3.5.2 in /usr/local/lib/python3.8/site-packages (from slackclient->chaostoolkit-slack) (3.6.2)
Requirement already satisfied, skipping upgrade: pyyaml>=3.13 in /usr/local/lib/python3.8/site-packages (from chaostoolkit-lib>=0.15.0->chaostoolkit-slack) (5.3.1)
Requirement already satisfied, skipping upgrade: requests>=2.21 in /usr/local/lib/python3.8/site-packages (from chaostoolkit-lib>=0.15.0->chaostoolkit-slack) (2.23.0)
Requirement already satisfied, skipping upgrade: multidict<5.0,>=4.5 in /usr/local/lib/python3.8/site-packages (from aiohttp>3.5.2->slackclient->chaostoolkit-slack) (4.7.5)
Requirement already satisfied, skipping upgrade: yarl<2.0,>=1.0 in /usr/local/lib/python3.8/site-packages (from aiohttp>3.5.2->slackclient->chaostoolkit-slack) (1.4.2)
Requirement already satisfied, skipping upgrade: chardet<4.0,>=2.0 in /usr/local/lib/python3.8/site-packages (from aiohttp>3.5.2->slackclient->chaostoolkit-slack) (3.0.4)
Requirement already satisfied, skipping upgrade: attrs>=17.3.0 in /usr/local/lib/python3.8/site-packages (from aiohttp>3.5.2->slackclient->chaostoolkit-slack) (19.3.0)
Requirement already satisfied, skipping upgrade: async-timeout<4.0,>=3.0 in /usr/local/lib/python3.8/site-packages (from aiohttp>3.5.2->slackclient->chaostoolkit-slack) (3.0.1)
Requirement already satisfied, skipping upgrade: idna<3,>=2.5 in /usr/local/lib/python3.8/site-packages (from requests>=2.21->chaostoolkit-lib>=0.15.0->chaostoolkit-slack) (2.9)
Requirement already satisfied, skipping upgrade: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.8/site-packages (from requests>=2.21->chaostoolkit-lib>=0.15.0->chaostoolkit-slack) (1.25.8)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in /usr/local/lib/python3.8/site-packages (from requests>=2.21->chaostoolkit-lib>=0.15.0->chaostoolkit-slack) (2019.11.28)
cat /root/.chaostoolkit/settings.yaml
[token removed from the output]
notifications:
- type: plugin
module: chaosslack.notification
token: xoxb-...
channel: tests
Any idea what might be wrong?
in setup.py, there is a type mistake in the "extension" word for the desc variable
Line 14 in ec01b8f
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 ?
Other extensions have better contribution/development instructions. This repo should have the same, see the following for an example:
https://github.com/chaostoolkit/chaostoolkit-kubernetes#contribute
in the CTK cli, the extension summary is supposed to start with the prefix "Chaos Toolkit Extension for "
Hi, I'm trying to send notifications to slack when an experiment starts, ends, fails, etc. I installed chaostoolkit-slack on my kubernetes environment (using the chaos toolkit kubernetes operator). When I run an experiment, I don't get any notification on slack and I don't see any error in the logs either.
This is my setttings.yaml file:
-
type: plugin
module: chaosslack.notification
token: xoxb-xxxxxxxxxxx
channel: chaos-toolkit
I don't think it's an issue with the kubernetes operator, as I've also installed it locally. Do I need to do more configurations?
I test the slack token and it works fine, I also tried using the notifications type: http
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.