This document describes the current stable version of Celery (5.6). For development docs, go here.

# `celery.exceptions`

Celery error types.

## Error Hierarchy

- `Exception`
    - `celery.exceptions.CeleryError`

        - `ImproperlyConfigured`

        - `SecurityError`

        - `TaskPredicate`

            - `Ignore`

            - `Reject`

            - `Retry`

        - `TaskError`

            - `QueueNotFound`

            - `IncompleteStream`

            - `NotRegistered`

            - `AlreadyRegistered`

            - `TimeoutError`

            - `MaxRetriesExceededError`

            - `TaskRevokedError`

            - `InvalidTaskError`

            - `ChordError`

        - `BackendError`

            - `BackendGetMetaError`

            - `BackendStoreError`

    - `kombu.exceptions.KombuError`

        - `OperationalError`

          > Raised when a transport connection error occurs while sending a message (be it a task, remote control command error).

          > Note

          > This exception does not inherit from `CeleryError`.

    - billiard errors (prefork pool)

        - `SoftTimeLimitExceeded`

        - `TimeLimitExceeded`

        - `WorkerLostError`

        - `Terminated`

- `UserWarning`
    - `CeleryWarning`

        - `AlwaysEagerIgnored`

        - `DuplicateNodenameWarning`

        - `FixupWarning`

        - `NotConfigured`

        - `SecurityWarning`

- `BaseException`
    - `SystemExit`

        - `WorkerTerminate`

        - `WorkerShutdown`

exception celery.exceptions.AlreadyRegistered

  The task is already registered.

exception celery.exceptions.AlwaysEagerIgnored

  send_task ignores `task_always_eager` option.

exception celery.exceptions.BackendError

  An issue writing or reading to/from the backend.

exception celery.exceptions.BackendGetMetaError(*args, **kwargs)

  An issue reading from the backend.

exception celery.exceptions.BackendStoreError(*args, **kwargs)

  An issue writing to the backend.

exception celery.exceptions.CDeprecationWarning

  Warning of deprecation.

exception celery.exceptions.CPendingDeprecationWarning

  Warning of pending deprecation.

exception celery.exceptions.CeleryCommandException(message, exit_code)

  A general command exception which stores an exit code.

exception celery.exceptions.CeleryError

  Base class for all Celery errors.

exception celery.exceptions.CeleryWarning

  Base class for all Celery warnings.

exception celery.exceptions.ChordError

  A task part of the chord raised an exception.

exception celery.exceptions.DuplicateNodenameWarning

  Multiple workers are using the same nodename.

exception celery.exceptions.FixupWarning

  Fixup related warning.

exception celery.exceptions.Ignore

  A task can raise this to ignore doing state updates.

exception celery.exceptions.ImproperlyConfigured

  Celery is somehow improperly configured.

exception celery.exceptions.IncompleteStream

  Found the end of a stream of data, but the data isn’t complete.

exception celery.exceptions.InvalidTaskError

  The task has invalid data or ain’t properly constructed.

exception celery.exceptions.MaxRetriesExceededError(*args, **kwargs)

  The tasks max restart limit has been exceeded.

exception celery.exceptions.NotConfigured

  Celery hasn’t been configured, as no config module has been found.

exception celery.exceptions.NotRegistered

  The task is not registered.

exception celery.exceptions.OperationalError

  Recoverable message transport connection error.

exception celery.exceptions.QueueNotFound

  Task routed to a queue not in `conf.queues`.

exception celery.exceptions.Reject(reason=None, requeue=False)

  A task can raise this if it wants to reject/re-queue the message.

exception celery.exceptions.Retry(message=None, exc=None, when=None, is_eager=False, sig=None, **kwargs)

  The task is to be retried later.

  exc = None

    Exception (if any) that caused the retry to happen.

  humanize()
  message = None

    Optional message describing context of retry.

  when = None

    Time of retry (ETA), either `numbers.Real` or `datetime`.

exception celery.exceptions.SecurityError

  Security related exception.

exception celery.exceptions.SecurityWarning

  Potential security issue found.

exception celery.exceptions.SoftTimeLimitExceeded

  The soft time limit has been exceeded. This exception is raised to give the task a chance to clean up.

exception celery.exceptions.TaskError

  Task related errors.

exception celery.exceptions.TaskPredicate

  Base class for task-related semi-predicates.

exception celery.exceptions.TaskRevokedError

  The task has been revoked, so no result available.

exception celery.exceptions.Terminated

  The worker processing a job has been terminated by user request.

exception celery.exceptions.TimeLimitExceeded

  The time limit has been exceeded and the job has been terminated.

exception celery.exceptions.TimeoutError

  The operation timed out.

exception celery.exceptions.WorkerLostError

  The worker processing a job has exited prematurely.

exception celery.exceptions.WorkerShutdown

  Signals that the worker should perform a warm shutdown.

exception celery.exceptions.WorkerTerminate

  Signals that the worker should terminate immediately.

celery.exceptions.reraise(tp, value, tb=None)

  Reraise exception.