plotly / plotly/dash

[BUG] Celery Background Callback Manager fails with Non-Key/Value-Backends

Open
#3,729 7 comments 0 reactions 1 assignee View on GitHub

@datenzauberai is already working on this.

Since Apr 8, 2026.

bug P3 size: 5
Dominant language
Python
Stars
24.4k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
13

Description

Describe your context

This applies to background callbacks using the Celery Background Callback Manager. This should be reproducible using the latest version of dash as well.

dash                                     3.3.0
dash-ag-grid                             33.3.3
dash-iconify                             0.1.2
dash-mantine-components                  2.5.1
dash-testing-stub                        0.0.2

Describe the bug

Celery supports multiple backends that are not a BaseKeyValueStoreBackend:

  • CassandraBackend
  • DatabaseBackend
  • MongoBackend
  • RPCBackend

However, Dash's CeleryManager assumes the backend to be a BaseKeyValueStoreBackend having the methods set and get.

Configuring any of the backends above will result in an error similar to AttributeError: 'DatabaseBackend' object has no attribute 'get' when triggering a background callback.

Backends that that implement BaseKeyValueStoreBackend might also fail, when the parameters passed to set and get do not comply with the backend's requirements (e.g. the FilesystemBackend expects a byte-like object for the key resulting in an error similar to TypeError: sequence item 1: expected a bytes-like object, str found, also see https://github.com/plotly/dash/issues/3116).

Expected behavior

The CeleryManager should either

  • support all Celery backends by using get_result and store_result from BaseBackend instead of get and set and using byte-like objects for keys or
  • make the restriction more explicit by additional documentation and erroring early on when the configured backend does not implement BaseKeyValueStoreBackend or is otherwise not supported.

Especially the DatabaseBackend and FilesystemBackend would be accessible options without the need for additional infrastructure to execute background callbacks.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.