Async Queries redis connection error #34650
Replies: 1 comment 6 replies
-
Hi @MorieeLM! I'm Dosu and I’m helping the superset team. Your error happens because Superset is trying to connect to Redis at localhost:6379, but in Kubernetes, Redis usually runs in its own pod and should be accessed via its service name, not localhost. This causes connection refused errors unless Redis is running in the same container, which is not typical for Kubernetes setups. The UI hangs with "waiting for postgresql" because async queries and Celery workers can't connect to Redis, so queries never complete and results aren't cached or returned. To fix this, make sure your REDIS_HOST environment variable is set to your Redis service name (for example, superset-redis-master or superset-redis-headless), not localhost. You can check the current value by running kubectl exec on a Superset pod and running env | grep REDIS. Update your Helm values.yaml or Kubernetes manifests to set REDIS_HOST using extraEnv or extraSecretEnv, and reference it in your configOverrides. For example: extraEnv:
REDIS_HOST: superset-redis-master
REDIS_PORT: "6379"
REDIS_DB: "0"
REDIS_CELERY_DB: "1" Then, in your configOverrides, use os.environ.get("REDIS_HOST") and similar for all Redis-related config. After updating, redeploy Superset and the workers so the new settings take effect. If Redis requires authentication, include the username and password in your Redis URLs. References:
To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have hosted superset on kubernetes and keep getting these errors when trying to generate charts on superset web; the user interface hangs with a display message of "waiting for postgresql" and no charts are gemerated: kubectl logs -n superset -l app=superset-worker --tail=20
Defaulted container "superset" out of: superset, wait-for-postgres-redis (init)
R = retval = fun(*args, kwargs)
File "/app/superset/initialization/init.py", line 114, in call
return task_base.call(self, *args, kwargs)
File "/app/.venv/lib/python3.10/site-packages/celery/app/trace.py", line 736, in protected_call
return self.run(args, **kwargs)
File "/app/superset/tasks/async_queries.py", line 110, in load_chart_data_into_cache
async_query_manager.update_job(
File "/app/superset/async_events/async_query_manager.py", line 306, in update_job
self._cache.xadd(scoped_stream_name, event_data, "", self._stream_limit)
File "/app/superset/async_events/cache_backend.py", line 71, in xadd
return self._cache.xadd(stream_name, event_data, event_id, maxlen)
File "/app/.venv/lib/python3.10/site-packages/redis/commands/core.py", line 3534, in xadd
return self.execute_command("XADD", name, *pieces)
File "/app/.venv/lib/python3.10/site-packages/redis/client.py", line 1266, in execute_command
conn = self.connection or pool.get_connection(command_name, **options)
File "/app/.venv/lib/python3.10/site-packages/redis/connection.py", line 1461, in get_connection
connection.connect()
File "/app/.venv/lib/python3.10/site-packages/redis/connection.py", line 713, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting to localhost:6379. Connection refused.
please assist with a workaround for this.
I have configOverrides defined as follows: # Proxy and feature flags
ENABLE_PROXY_FIX = True
FEATURE_FLAGS = {
"DASHBOARD_NATIVE_FILTERS": True,
"DASHBOARD_CROSS_FILTERS": True,
"GLOBAL_ASYNC_QUERIES": True,
}
Beta Was this translation helpful? Give feedback.
All reactions