crflynn / celery-slack Goto Github PK
View Code? Open in Web Editor NEWA Slack messaging extension for Celery.
Home Page: http://celery-slack.readthedocs.io/en/latest/
License: MIT License
A Slack messaging extension for Celery.
Home Page: http://celery-slack.readthedocs.io/en/latest/
License: MIT License
@crflynn I can't update to celery-slack v0.4.0
throws the following error:
Collecting celery-slack Using cached https://files.pythonhosted.org/packages/b3/c4/9c2c7e0e2633f2b573c1fcb7f0df333ece14f1af5a9d343b91649a2bef9e/celery_slack-0.4.0-py2.py3-none-any.whl Requirement already satisfied: ephem<4.0,>=3.7 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from celery-slack) (3.7.7.0) Collecting celery<3.2,<5.0,>=3.1,>=4.0 (from celery-slack) ERROR: Could not find a version that satisfies the requirement celery<3.2,<5.0,>=3.1,>=4.0 (from celery-slack) (from versions: 0.1.2, 0.1.4, 0.1.6, 0.1.7, 0.1.8, 0.1.10, 0.1.11, 0.1.12, 0.1.13, 0.1.14, 0.1.15, 0.2.0, 0.3.0, 0.3.7, 0.3.20, 0.4.0, 0.4.1, 0.6.0, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 2.2.6, 2.2.7, 2.2.8, 2.2.9, 2.2.10, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.5, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.8, 3.0.9, 3.0.10, 3.0.11, 3.0.12, 3.0.13, 3.0.14, 3.0.15, 3.0.16, 3.0.17, 3.0.18, 3.0.19, 3.0.20, 3.0.21, 3.0.22, 3.0.23, 3.0.24, 3.0.25, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.8, 3.1.9, 3.1.10, 3.1.11, 3.1.12, 3.1.13, 3.1.14, 3.1.15, 3.1.16, 3.1.17, 3.1.18, 3.1.19, 3.1.20, 3.1.21, 3.1.22, 3.1.23, 3.1.24, 3.1.25, 3.1.26.post1, 3.1.26.post2, 4.0.0rc3, 4.0.0rc4, 4.0.0rc5, 4.0.0rc6, 4.0.0rc7, 4.0.0, 4.0.1, 4.0.2, 4.1.0, 4.1.1, 4.2.0rc1, 4.2.0rc2, 4.2.0rc3, 4.2.0rc4, 4.2.0, 4.2.1, 4.2.2, 4.3.0rc1, 4.3.0rc2, 4.3.0rc3, 4.3.0, 4.4.0rc1, 4.4.0rc2, 4.4.0rc3) ERROR: No matching distribution found for celery<3.2,<5.0,>=3.1,>=4.0 (from celery-slack)
What changed between v0.3 and v0.4 ?
Originally posted by @UtsavPreet in #19 (comment)
How can I set requests default timeout?
in celery-slack/celery_slack/slack.py
I find:
RETRY_AFTER = 0
RATE_LIMITED = False
TIMEOUT = 1
Sometimes you may want to raise an exception, but not being notified.
I mean, you can have a task that is "normal" that it raises exceptions frequently and you don't want to be notified, but you want to raise to set the task in a failed state and let the caller know the task has
failed and let it access the traceback.
Currently, I do not know how to do it, because I want to exclude exceptions by task, not globally but the on_failure method has no direct access to the task.
When you are running celery workers on multiple servers and an exception occurs, you can not know what sever it was.
In my company, when we are not using Celery, we send exceptions manually to Slack, and we send the exception with a custom username, like "service_name@sever_name". It is nice and helpful.
Could you add the ability to change the username or simply add hostname in the message body?
Referencing this comment which requested Slack message for when no connection is available to the broker and the task fails to send.
another question, how can i catch Exception from Celery's broker and send to slack.
like my broker(e.g. RabbitMQ ) suddenly shutdown, but it could not send message to Slack though i got the connection error in logs
Firstly, thank you for an awesome too.
I have a small issue where normal @task
are successfully sent to slack but @periodic_task
are not being sent. Any ideas why this might be happening?
I was just trying to use this library, and following the documentation through this error.
Versions
Python: 3.6
Celery: 4.3
Redis: 3.3
Kombu: 4.4
Celery-Slack: 0.3.0
Code Snippet
options = { 'flower_base_url': 'http://localhost:5555', 'show_broker': True, } SLACK_WEBHOOK = 'https://hooks.slack.com/services/xxxxxx/xxxx/xxxxxxxx' app = Celery('tasks') slack_app = Slackify(app, SLACK_WEBHOOK, **options) app.config_from_object('django.conf:settings') app.autodiscover_tasks()
Error Trace:
[2019-10-12 12:26:38,452: CRITICAL/MainProcess] Unrecoverable error: TypeError("wrapped_func() got an unexpected keyword argument 'timeout'",) Traceback (most recent call last): File "/Users/utsav/Desktop/abc/venv/lib/python3.6/site-packages/celery/worker/worker.py", line 205, in start self.blueprint.start(self) File "/Users/utsav/Desktop/abc/venv/lib/python3.6/site-packages/celery/bootsteps.py", line 119, in start step.start(parent) File "/Users/utsav/Desktop/abc/venv/lib/python3.6/site-packages/celery/bootsteps.py", line 369, in start return self.obj.start() File "/Users/utsav/Desktop/abc/venv/lib/python3.6/site-packages/celery/worker/consumer/consumer.py", line 318, in start blueprint.start(self) File "/Users/utsav/Desktop/abc/venv/lib/python3.6/site-packages/celery/bootsteps.py", line 119, in start step.start(parent) File "/Users/utsav/Desktop/abc/venv/lib/python3.6/site-packages/celery/worker/consumer/connection.py", line 23, in start c.connection = c.connect() File "/Users/utsav/Desktop/abc/venv/lib/python3.6/site-packages/celery/worker/consumer/consumer.py", line 405, in connect conn = self.connection_for_read(heartbeat=self.amqheartbeat) File "/Users/utsav/Desktop/abc/venv/lib/python3.6/site-packages/celery/worker/consumer/consumer.py", line 412, in connection_for_read self.app.connection_for_read(heartbeat=heartbeat)) File "/Users/utsav/Desktop/abc/venv/lib/python3.6/site-packages/celery/worker/consumer/consumer.py", line 436, in ensure_connected callback=maybe_shutdown, File "/Users/utsav/Desktop/abc/venv/lib/python3.6/site-packages/kombu/connection.py", line 422, in ensure_connection callback, timeout=timeout) TypeError: wrapped_func() got an unexpected keyword argument 'timeout'
I fixed this error, by replacing **options
with options while initialising slack_app.
Is it a know issue ? or something I'm missing.
Thanks
It's fantastic to have the ability to disable successful messages but an option to disable start up/shut down messages would be much appreciated.
I recently found this sentry alert for your library.
Signal handler "<function slack_beat_init.<locals>.slack_beat_init_callback at 0x7fbacd9cb598>" raised: "TypeError('string indices must be integers',)"
http://sentry.engineer.ai/share/issue/9e6772f82d7d4cbd94a16dfa1122becd/
Is this intended?. For testing I'm using time_limit=3
on the task, which returns the following on a long running task:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/billiard/pool.py", line 684, in on_hard_timeout
raise TimeLimitExceeded(job._timeout)
billiard.exceptions.TimeLimitExceeded: TimeLimitExceeded(3,)
And the task is marked as a failure in Flower, but not getting a notification in Slack from celery-slack.
Using 0.3.0
.
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.