Bug description

When SQLLAB_BACKEND_PERSISTENCE: True (the default setting) is enabled, SQL Lab fails with error "'dict' object has no attribute 'set'" preventing any SQL Lab functionality. Setting to False resolves the issue but loses backend persistence features.

superset_bug_report_backend_persistence.md

Screenshots/recordings

No response

Superset version

5.0.0

Python version

3.10

Node version

Not applicable

Browser

Chrome

Additional context

No response

Checklist

  • [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
  • [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Comment From: dosubot[bot]

This error happens when the backend persistence for SQL Lab is configured with a plain Python dict instead of a cachelib backend object. Superset expects RESULTS_BACKEND (and related settings) to be set to an instantiated cachelib object (like RedisCache or MemcachedCache), not a dictionary. If a dict is used, Superset tries to call set() on it and fails, causing the "'dict' object has no attribute 'set'" error.

To fix this, make sure your config uses a cachelib backend object. For example, for Redis:

from cachelib.redis import RedisCache
RESULTS_BACKEND = RedisCache(host='localhost', port=6379, db=0)

You can find more details in the official caching configuration docs. This is not a regression or internal bug, but a common configuration pitfall. Double-check your config to ensure you're not passing a dict where a cache object is required.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X