Description of the Bug
There is a mismatch between the default Redis DB number for the Celery result backend in two places:
backend/app/celery_app.py (line ~7):
celery_app = Celery(
"app.tasks",
broker=os.getenv("CELERY_BROKER_URL", "redis://localhost:6379/0"),
backend=os.getenv("CELERY_RESULT_BACKEND", "redis://localhost:6379/0"), # ← DB 0
)
backend/app/config.py:
CELERY_RESULT_BACKEND: str = "redis://localhost:6379/1" # ← DB 1
If CELERY_RESULT_BACKEND environment variable is set, both use it consistently. But if neither is set:
celery_app.py defaults to redis://localhost:6379/0 (DB 0)
config.py defaults to redis://localhost:6379/1 (DB 1)
This means Celery stores task results in Redis DB 0 while the rest of the application (and any monitoring tools) expect results in DB 1. The celery_app.py is imported and configured before config.py settings take effect in certain code paths.
Steps to Reproduce
- Start the application without setting
CELERY_RESULT_BACKEND environment variable
- Submit a Celery task
- Check Redis DB 1 for the task result — it's empty
- Check Redis DB 0 — the result is stored there
Expected Behavior
Both defaults should use the same Redis DB number. The recommended fix is to align celery_app.py with config.py (use DB 1).
Affected File
backend/app/celery_app.py (line ~7)
Suggested Fix
Change the default in celery_app.py to match config.py:
backend=os.getenv("CELERY_RESULT_BACKEND", "redis://localhost:6379/1"),
Or better, import the default from config to ensure they never diverge.
GSSoC '26
Description of the Bug
There is a mismatch between the default Redis DB number for the Celery result backend in two places:
backend/app/celery_app.py(line ~7):backend/app/config.py:If
CELERY_RESULT_BACKENDenvironment variable is set, both use it consistently. But if neither is set:celery_app.pydefaults toredis://localhost:6379/0(DB 0)config.pydefaults toredis://localhost:6379/1(DB 1)This means Celery stores task results in Redis DB 0 while the rest of the application (and any monitoring tools) expect results in DB 1. The
celery_app.pyis imported and configured beforeconfig.pysettings take effect in certain code paths.Steps to Reproduce
CELERY_RESULT_BACKENDenvironment variableExpected Behavior
Both defaults should use the same Redis DB number. The recommended fix is to align
celery_app.pywithconfig.py(use DB 1).Affected File
backend/app/celery_app.py(line ~7)Suggested Fix
Change the default in
celery_app.pyto matchconfig.py:Or better, import the default from config to ensure they never diverge.
GSSoC '26