{"id":231,"library":"celery","title":"Celery","description":"Distributed task queue for Python. Current version is 5.6.2 (Jan 2026). Requires Python >=3.9. A broker (Redis or RabbitMQ) is always required — there is no built-in broker. Old lowercase config settings (CELERY_TASK_SERIALIZER etc.) removed in Celery 5.0. SQS transport: pycurl→urllib3 in 5.5, then reverted in 5.6 — SQS users need pycurl reinstalled after 5.5→5.6 upgrade. Security fix: broker URL passwords were logged in plaintext before 5.6.","status":"active","version":"5.6.2","language":"python","source_language":"en","source_url":"https://docs.celeryq.dev/en/stable/","tags":["task-queue","distributed","async","redis","rabbitmq","workers","scheduling"],"install":[{"cmd":"pip install celery","lang":"bash","label":"Core (no broker included)"},{"cmd":"pip install celery[redis]","lang":"bash","label":"With Redis broker/backend support"},{"cmd":"pip install celery[rabbitmq]","lang":"bash","label":"With RabbitMQ (librabbitmq) support"},{"cmd":"pip install celery[sqs]","lang":"bash","label":"With AWS SQS transport"}],"dependencies":[{"reason":"Required. Message transport abstraction. Installed automatically.","package":"kombu>=5.3.0","optional":false},{"reason":"Required. Multiprocessing fork. Installed automatically.","package":"billiard>=4.2.0","optional":false},{"reason":"Required. CLI framework. Installed automatically.","package":"click>=8.1.2","optional":false},{"reason":"Required for Redis broker/backend. Install via celery[redis].","package":"redis>=4.5.2","optional":true},{"reason":"Required for SQS transport in Celery 5.6+. Was replaced by urllib3 in 5.5 then reverted — must reinstall manually if upgrading from 5.5.","package":"pycurl","optional":true}],"imports":[{"note":"Old uppercase CELERY_* config keys were deprecated in 4.0 and fully removed in 5.0. Use lowercase keys: task_serializer, result_backend, broker_url.","wrong":"# Old Celery 4.x lowercase config — removed in Celery 5.0:\napp.config_from_object({\n    'CELERY_TASK_SERIALIZER': 'json',     # removed — KeyError or ignored\n    'CELERY_RESULT_BACKEND': 'redis://...',  # removed\n    'CELERY_BROKER_URL': 'redis://...',      # removed\n})","symbol":"Celery","correct":"from celery import Celery\n\napp = Celery(\n    'myapp',\n    broker='redis://localhost:6379/0',\n    backend='redis://localhost:6379/0'\n)\n\n# Correct: use @app.task decorator\n@app.task\ndef add(x, y):\n    return x + y\n\n# Call async\nresult = add.delay(4, 6)\nprint(result.get(timeout=10))"}],"quickstart":{"code":"# tasks.py\nfrom celery import Celery\n\napp = Celery(\n    'tasks',\n    broker='redis://localhost:6379/0',\n    backend='redis://localhost:6379/0'\n)\n\napp.conf.update(\n    task_serializer='json',\n    accept_content=['json'],\n    result_serializer='json',\n    timezone='UTC',\n)\n\n@app.task\ndef add(x, y):\n    return x + y\n\n@app.task(bind=True, max_retries=3)\ndef fetch_data(self, url):\n    try:\n        import requests\n        return requests.get(url).json()\n    except Exception as exc:\n        raise self.retry(exc=exc, countdown=5)\n\n# --- Run worker ---\n# celery -A tasks worker --loglevel=info\n\n# --- Call from client ---\n# result = add.delay(4, 6)\n# print(result.get(timeout=10))  # 10","lang":"python","description":"Requires Redis running. Start worker in separate terminal: celery -A tasks worker --loglevel=info"},"warnings":[{"fix":"Replace all CELERY_* uppercase keys with lowercase equivalents: CELERY_BROKER_URL → broker_url, CELERY_RESULT_BACKEND → result_backend, CELERY_TASK_SERIALIZER → task_serializer. See the Celery 4.0 migration guide.","message":"All old uppercase CELERY_* config keys (CELERY_BROKER_URL, CELERY_RESULT_BACKEND, CELERY_TASK_SERIALIZER, etc.) were deprecated in Celery 4.0 and removed in Celery 5.0. Using them silently does nothing or raises errors.","severity":"breaking","affected_versions":">= 5.0"},{"fix":"Pin celery<5.6 for Python 3.8 environments.","message":"Python 3.8 support dropped in Celery 5.6.0. Minimum is now Python 3.9.","severity":"breaking","affected_versions":">= 5.6"},{"fix":"Ensure libcurl development headers are installed before pip installing pycurl. For Alpine-based environments (like python:3.13-alpine), this means running 'apk add curl-dev'. Then, pip install pycurl before upgrading to celery 5.6 if you use the SQS transport.","message":"SQS transport: pycurl was replaced by urllib3 in Celery 5.5, then reverted back to pycurl in 5.6 due to critical issues. Users who uninstalled pycurl after upgrading to 5.5 must reinstall it before upgrading to 5.6. Note: 'pycurl' often requires system-level development headers (e.g., libcurl-dev or curl-devel) to be installed before 'pip install pycurl' can succeed.","severity":"breaking","affected_versions":"5.5 → 5.6 upgrade"},{"fix":"Upgrade to celery>=5.6.0. Audit existing logs for exposed credentials.","message":"Security: broker URLs containing passwords were logged in plaintext by the delayed delivery mechanism before 5.6. Credentials visible in log files.","severity":"breaking","affected_versions":"< 5.6"},{"fix":"Start Redis locally: docker run -d -p 6379:6379 redis. Then set broker='redis://localhost:6379/0' in your Celery app.","message":"Celery requires a broker — there is no built-in broker. Without a running Redis or RabbitMQ instance, all .delay() and .apply_async() calls raise kombu.exceptions.OperationalError.","severity":"gotcha","affected_versions":"all"},{"fix":"Set backend= in Celery() constructor or result_backend in app.conf. For Redis: backend='redis://localhost:6379/0'.","message":"The result backend is separate from the broker. Without a configured result_backend, result.get() blocks forever or raises NotImplementedError. Many tutorials configure the broker but forget the backend.","severity":"gotcha","affected_versions":"all"},{"fix":"Convert task arguments to JSON-serializable types before calling .delay(). For datetime: pass .isoformat() string, parse inside the task.","message":"Task serializer defaults to json in Celery 5.x. Using pickle=True or passing non-JSON-serializable objects to tasks raises kombu.exceptions.EncodeError. Complex Python objects (datetime, custom classes) must be serialized manually.","severity":"gotcha","affected_versions":">= 5.0"},{"fix":"Define the Celery app in a separate module file (e.g. tasks.py). Start worker with: celery -A tasks worker","message":"In notebooks and scripts using multiprocessing, Accelerator() or notebook_launcher patterns: the Celery app must be importable as a module — it cannot be defined inline in a __main__ block. Workers import the app from the module path passed to -A.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-12T12:08:23.359Z","next_check":"2026-06-27T00:00:00.000Z","problems":[{"fix":"Ensure your broker (Redis or RabbitMQ) is running and accessible from where your Celery worker is trying to connect. Verify the `broker_url` in your Celery configuration is correct (e.g., `redis://localhost:6379/0` or `amqp://guest:guest@localhost:5672//`).","cause":"Celery cannot connect to its message broker (e.g., Redis or RabbitMQ), often because the broker is not running, is inaccessible at the specified address, or network connectivity issues exist.","error":"kombu.exceptions.OperationalError: [Errno 111] Connection refused"},{"fix":"Install the missing dependency using pip, for example, `pip install boto3` if you are using an S3 backend or SQS transport, or the appropriate package for your chosen backend/transport.","cause":"This error occurs when a Celery backend or transport (like S3 for result storage or SQS for the broker) is configured but its required Python client library (e.g., 'boto3' for AWS services) is not installed in the environment.","error":"celery.exceptions.ImproperlyConfigured: The 'boto3' package is not installed."},{"fix":"Update your Celery configuration to use the new style settings, for example, change `CELERY_TASK_SERIALIZER` to `task_serializer` in your `celeryconfig.py` or directly in `app.conf.update()`.","cause":"In Celery 5.0 and later, the configuration settings were unified and now use uppercase and are prefixed with `task_`, `broker_`, `result_`, etc. Old lowercase settings like `CELERY_TASK_SERIALIZER` are removed and attempting to access them directly as attributes will raise an `AttributeError`.","error":"AttributeError: 'celery' object has no attribute 'CELERY_TASK_SERIALIZER'"},{"fix":"Upgrade Celery to version 5.6 or later, as this version includes a security fix to properly sanitize broker URL passwords in log output. Also, ensure your broker's logs are secured.","cause":"This warning indicates that your broker URL, which contains a password, was logged without being sanitized, posing a security risk by exposing sensitive credentials in logs. This was a known issue in versions prior to Celery 5.6.","error":"celery.exceptions.SecurityWarning: A broker url with password was logged in plaintext"},{"fix":"Ensure the module containing your task is imported by the Celery worker (e.g., by listing it in `CELERY_IMPORTS` or `app.autodiscover_tasks()`). Verify the task function is correctly decorated with `@app.task` and that the task name used for calling (`.delay()` or `.apply_async()`) exactly matches the registered name.","cause":"Celery cannot find or load the specified task, usually because the module containing the task was not imported by the worker, the task function is not decorated with `@app.task`, or there's a typo in the task name or path.","error":"celery.exceptions.NotRegistered: Task 'my_app.tasks.my_task' is not registered"}],"ecosystem":"pypi","meta_description":null,"install_score":100,"install_tag":"verified","quickstart_score":80,"quickstart_tag":"verified","pypi_latest":null,"cli_name":"celery","install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.38,"mem_mb":10.5,"disk_size":"34.0M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"rabbitmq","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.36,"mem_mb":10.5,"disk_size":"34.0M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"redis","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.36,"mem_mb":10.5,"disk_size":"36.6M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"sqs","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.28,"mem_mb":10.5,"disk_size":"34M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"rabbitmq","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.27,"mem_mb":10.5,"disk_size":"34M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"redis","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.27,"mem_mb":10.5,"disk_size":"37M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"sqs","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.28,"mem_mb":10.5,"disk_size":"79M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.49,"mem_mb":11.8,"disk_size":"37.7M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"rabbitmq","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.48,"mem_mb":11.8,"disk_size":"37.7M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"redis","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.5,"mem_mb":11.8,"disk_size":"40.8M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"sqs","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.43,"mem_mb":11.8,"disk_size":"38M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"rabbitmq","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.42,"mem_mb":11.8,"disk_size":"38M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"redis","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.43,"mem_mb":11.8,"disk_size":"41M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"sqs","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.43,"mem_mb":11.8,"disk_size":"84M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.45,"mem_mb":11.6,"disk_size":"29.0M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"rabbitmq","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.43,"mem_mb":11.6,"disk_size":"29.0M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"redis","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.46,"mem_mb":11.6,"disk_size":"32.0M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"sqs","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.45,"mem_mb":11.6,"disk_size":"30M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"rabbitmq","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.45,"mem_mb":11.6,"disk_size":"30M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"redis","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.46,"mem_mb":11.6,"disk_size":"32M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"sqs","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.43,"mem_mb":11.6,"disk_size":"75M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.4,"mem_mb":11.9,"disk_size":"28.6M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"rabbitmq","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.41,"mem_mb":11.9,"disk_size":"28.6M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"redis","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.4,"mem_mb":11.9,"disk_size":"31.6M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"sqs","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.41,"mem_mb":11.9,"disk_size":"29M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"rabbitmq","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.41,"mem_mb":11.9,"disk_size":"29M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"redis","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.42,"mem_mb":11.9,"disk_size":"32M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"sqs","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.41,"mem_mb":11.9,"disk_size":"75M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.33,"mem_mb":9.9,"disk_size":"33.3M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"rabbitmq","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.32,"mem_mb":9.9,"disk_size":"33.3M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"redis","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.33,"mem_mb":9.9,"disk_size":"35.9M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"sqs","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.3,"mem_mb":9.9,"disk_size":"34M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"rabbitmq","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.31,"mem_mb":9.9,"disk_size":"34M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"redis","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.32,"mem_mb":9.9,"disk_size":"36M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"sqs","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.34,"mem_mb":9.9,"disk_size":"79M"}]},"quickstart_checks":{"last_tested":"2026-04-23","tag":"verified","tag_description":"quickstart runs on critical runtimes, recently tested","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}}