Skip to content
Latchkey

Celery worker "Unable to load celery application" in CI

The celery CLI could not import the application you pointed it at with -A. Either the module path is wrong, it isn’t on sys.path, or importing it raises - so the worker never starts.

What this error means

Running celery -A proj worker (or beat) in CI exits with Error: Unable to load celery application. The module proj was not found or a traceback from inside the app module. The worker process doesn’t come up.

celery output
Error:
Unable to load celery application.
The module proj.celery was not found.
# or
Unable to load celery application.
While trying to load the module proj.celery the following error occurred:
ModuleNotFoundError: No module named 'config'

Common causes

Wrong -A application path

The -A proj or -A proj.celery:app target doesn’t match where the Celery app object actually lives, so the CLI can’t find it.

Module not importable / errors at import

The project isn’t installed (sys.path doesn’t include it) or the app module raises at import - a missing settings module, env var, or broker URL.

How to fix it

Verify the app import and target

Import the Celery app directly to confirm the path before starting the worker.

Terminal
python -c "from proj.celery import app; print(app)"
celery -A proj.celery:app worker --loglevel=info

Make the project importable in CI

  1. Run from the repo root or pip install -e . so the app module is on sys.path.
  2. Set required env (DJANGO_SETTINGS_MODULE, broker URL) the app reads at import.
  3. Match the -A target to the actual module:attribute of the app object.

How to prevent it

  • Use an explicit -A module:app target and verify it with a direct import.
  • Install the project (editable) so Celery can import it from any directory.
  • Provide broker/settings env vars in CI before starting the worker.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →