Celery Beat stuck on starting it

The Problem: I have issue with celery beat it only show starting on the terminal and not run any tasks also when I deploy it on heroku it do the same behavior.

Here is the Terminal it only show starting:

                                                                                                                                                                                                                               (shap-backend-venv) mahmoudnasser@Mahmouds-MacBook-Pro rest.shab.ch % celery -A server beat -l info --logfile=celery.beat.log --detach 
(shap-backend-venv) mahmoudnasser@Mahmouds-MacBook-Pro rest.shab.ch % celery -A server worker  --beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler
Secure redis scheme specified (rediss) with no ssl options, defaulting to insecure SSL behaviour.
[2023-01-25 13:00:29,570: WARNING/MainProcess] Secure redis scheme specified (rediss) with no ssl options, defaulting to insecure SSL behaviour.
[2023-01-25 13:00:29,571: WARNING/MainProcess] Secure redis scheme specified (rediss) 
Setting ssl_cert_reqs=CERT_NONE when connecting to redis means that celery will not validate the identity of the redis broker when connecting. This leaves you vulnerable to man in the middle attacks.

 
 -------------- celery@Mahmouds-MacBook-Pro.local v5.1.2 (sun-harmonics)
--- ***** ----- 
-- ******* ---- macOS-12.6-arm64-arm-64bit 2023-01-25 13:00:29
- *** --- * --- 
- ** ---------- [config]
- ** ---------- .> app:         server:0x106872730
- ** ---------- .> transport:   rediss://127.0.0.1:6379/0
- ** ---------- .> results:     rediss://127.0.0.1:6379/0
- *** --- * --- .> concurrency: 8 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** ----- 
 -------------- [queues]
                .> celery           exchange=celery(direct) key=celery
                

[tasks]
  . server.shab.tasks.scheduled_requests.handle_drivers_requests
  . server.shab.tasks.scheduled_requests.send_notification_to_user_have_scheduled_requests
[2023-01-25 13:00:30,386: INFO/Beat] beat: Starting...
[2023-01-25 13:00:30,421: WARNING/Beat] Secure redis scheme specified (rediss) with no ssl options, defaulting to insecure SSL behaviour.

my procfile:

worker: celery -A server worker  --beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler

here is the celery.py:

from __future__ import absolute_import
import os
from celery import Celery
from django.conf import settings
from celery.schedules import crontab

# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'server.settings')

app = Celery('server')

# Using a string here means the worker will not have to
# pickle the object when using Windows.
app.config_from_object('django.conf:settings', namespace='CELERY')
app.conf.redis_backend_use_ssl = {"ssl_cert_reqs": "none"}
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)

settings.py:

# Celery
CELERY_BROKER_URL = config('REDIS_URL')
CELERY_RESULT_BACKEND = config('REDIS_URL')
CELERY_RESULT_EXPIRES = 30
CELERY_TASK_RESULT_EXPIRES = 30

CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_IMPORTS = [
    'server.shab.tasks.scheduled_requests',
]
Back to Top