-
Notifications
You must be signed in to change notification settings - Fork 13.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.1.0rc1 celery issue - Received unregistered task of type 'reports.scheduler'. #29708
Comments
Hey there, @padbk! 👋 I'm here to assist with any bugs, questions, or contributions you have regarding the repository. Let's tackle this together! To resolve the issue with Celery 4.1.0rc1 on Kubernetes where you receive an error about an unregistered task 'reports.scheduler' every minute on the worker node, you need to ensure that the task is properly registered in your Celery configuration. The error indicates that the task 'reports.scheduler' is not recognized by the worker, which suggests that it might not be included in the Here is an example of how you can configure your Celery settings to include the 'reports.scheduler' task: configOverrides:
celery_conf: |
from celery.schedules import crontab
class CeleryConfig:
broker_url = f"redis://{env('REDIS_HOST')}:{env('REDIS_PORT')}/0"
imports = (
"superset.sql_lab",
"superset.tasks.cache",
"superset.tasks.scheduler", # Ensure this line is included
)
result_backend = f"redis://{env('REDIS_HOST')}:{env('REDIS_PORT')}/0"
task_annotations = {
"sql_lab.get_sql_results": {
"rate_limit": "100/s",
},
}
beat_schedule = {
"reports.scheduler": {
"task": "reports.scheduler",
"schedule": crontab(minute="*", hour="*"),
},
"reports.prune_log": {
"task": "reports.prune_log",
'schedule': crontab(minute=0, hour=0),
},
'cache-warmup-hourly': {
"task": "cache-warmup",
"schedule": crontab(minute="*/30", hour="*"),
"kwargs": {
"strategy_name": "top_n_dashboards",
"top_n": 10,
"since": "7 days ago",
},
}
}
CELERY_CONFIG = CeleryConfig Make sure that the from superset.extensions import celery_app
@celery_app.task(name="reports.scheduler")
def scheduler() -> None:
"""
Celery beat main scheduler for reports
"""
# Task implementation This should ensure that the task is recognized and properly registered by the Celery worker [1][2]. |
Please feel free to mention this on the official vote thread if you'd like to draw more attention to it, and see if others are experiencing the same. The release is currently in testing/voting, so it'd be appreciated :) Let me know if you're not on the developer mailing list and I can provide more instructions. |
Turns out the imports line I was using was out of date and it needs to be changed. Now mine reads:
Not sure what has changed to make "superset.tasks" no longer work in 4.1.0, but the docs seem up to date. |
I had the same issue and it went away after making that one-line change you suggest. Thanks! I have been using this same config without issues since 2.0.0, I guess something changed for 4.1.0 that made it finally not work. |
closes #29708 About the change in `superset/utils/json.py`, I was somehow getting a pre-commit hook to trigger
I noticed warnings around this in docker-compose last week, and connected this issue when looking at 4.1 blockers. I think I should be fixing the root cause here -> #29862 |
Bug description
Getting the following every minute on the worker node:
And no reports run at all.
I don't have this issue in 4.0.2 with the same config
How to reproduce the bug
Installed 4.1.0rc1-py310 on k8s
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.10
Node version
Not applicable
Browser
Not applicable
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: