Skip to content

superset < > redis connectivity issue #3581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sarath-tfs opened this issue Apr 2, 2025 · 7 comments
Closed

superset < > redis connectivity issue #3581

sarath-tfs opened this issue Apr 2, 2025 · 7 comments
Assignees

Comments

@sarath-tfs
Copy link

sarath-tfs commented Apr 2, 2025

Following is the log, Redis is running in K8s as Pod ( redis://supersest-redis-service?db=0 )

tried in multiple ways.. no luck..

Upgrading DB schema...
Loaded your LOCAL configuration at [/app/pythonpath/superset_config.py]
2025-04-02 00:55:07,965:ERROR:superset.app:Failed to create app
Traceback (most recent call last):
File "/app/superset/app.py", line 40, in create_app
app_initializer.init_app()
File "/app/superset/initialization/init.py", line 484, in init_app
self.configure_cache()
File "/app/superset/initialization/init.py", line 541, in configure_cache
cache_manager.init_app(self.superset_app)
File "/app/superset/utils/cache_manager.py", line 90, in init_app
self._init_cache(app, self._cache, "CACHE_CONFIG")
File "/app/superset/utils/cache_manager.py", line 87, in _init_cache
cache.init_app(app, cache_config)
File "/usr/local/lib/python3.10/site-packages/flask_caching/init.py", line 145, in init_app
self._set_cache(app, config)
File "/usr/local/lib/python3.10/site-packages/flask_caching/init.py", line 177, in _set_cache
app.extensions["cache"][self] = cache_factory(
File "/usr/local/lib/python3.10/site-packages/flask_caching/backends/rediscache.py", line 87, in factory
kwargs["host"] = redis_from_url(redis_url, db=kwargs.pop("db", None))
File "/usr/local/lib/python3.10/site-packages/redis/utils.py", line 32, in from_url
return Redis.from_url(url, **kwargs)
File "/usr/local/lib/python3.10/site-packages/redis/client.py", line 910, in from_url
connection_pool = ConnectionPool.from_url(url, **kwargs)
File "/usr/local/lib/python3.10/site-packages/redis/connection.py", line 1349, in from_url
url_options = parse_url(url)
File "/usr/local/lib/python3.10/site-packages/redis/connection.py", line 1243, in parse_url
raise ValueError(
ValueError: Redis URL must specify one of the following schemes (redis://, rediss://, unix://)
Traceback (most recent call last):
File "/usr/local/bin/superset", line 8, in
sys.exit(superset())
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1685, in invoke
super().invoke(ctx)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/flask/cli.py", line 355, in decorator
app = __ctx.ensure_object(ScriptInfo).load_app()
File "/usr/local/lib/python3.10/site-packages/flask/cli.py", line 309, in load_app
app = locate_app(import_name, name)
File "/usr/local/lib/python3.10/site-packages/flask/cli.py", line 238, in locate_app
return find_app_by_string(module, app_name)
File "/usr/local/lib/python3.10/site-packages/flask/cli.py", line 166, in find_app_by_string
app = attr(*args, **kwargs)
File "/app/superset/app.py", line 40, in create_app
app_initializer.init_app()
File "/app/superset/initialization/init.py", line 484, in init_app
self.configure_cache()
File "/app/superset/initialization/init.py", line 541, in configure_cache
cache_manager.init_app(self.superset_app)
File "/app/superset/utils/cache_manager.py", line 90, in init_app
self._init_cache(app, self._cache, "CACHE_CONFIG")
File "/app/superset/utils/cache_manager.py", line 87, in _init_cache
cache.init_app(app, cache_config)
File "/usr/local/lib/python3.10/site-packages/flask_caching/init.py", line 145, in init_app
self._set_cache(app, config)
File "/usr/local/lib/python3.10/site-packages/flask_caching/init.py", line 177, in _set_cache
app.extensions["cache"][self] = cache_factory(
File "/usr/local/lib/python3.10/site-packages/flask_caching/backends/rediscache.py", line 87, in factory
kwargs["host"] = redis_from_url(redis_url, db=kwargs.pop("db", None))
File "/usr/local/lib/python3.10/site-packages/redis/utils.py", line 32, in from_url
return Redis.from_url(url, **kwargs)
File "/usr/local/lib/python3.10/site-packages/redis/client.py", line 910, in from_url
connection_pool = ConnectionPool.from_url(url, **kwargs)
File "/usr/local/lib/python3.10/site-packages/redis/connection.py", line 1349, in from_url
url_options = parse_url(url)
File "/usr/local/lib/python3.10/site-packages/redis/connection.py", line 1243, in parse_url
raise ValueError(
ValueError: Redis URL must specify one of the following schemes (redis://, rediss://, unix://)

@petyaslavova
Copy link
Collaborator

Hi @sarath-tfs, can you please share which version of the client you are using and which was the old version with which your code has worked without issues?
Can you also try to extract some debug info just before you instantiate the Redis client what is the value in the url - it might have different content at that point...

@frankfurtinzahlen
Copy link

Do you calculate any Redis-URI in your superset_config.py or elsewhere? It should start with with „redis:“ as protocol.

Example:

RATELIMIT_STORAGE_URI = (
      f"redis://"
      f"{env('REDIS_USER', '')}:{env('REDIS_PASSWORD')}@"
      f"{env('REDIS_HOST')}:{env('REDIS_PORT')}/{env('REDIS_DB')}"
    )

in this example, any of the environment variables (except user) need to exist, otherwise connection string will be invalid and connection will fail.

@sarath-tfs
Copy link
Author

sarath-tfs commented Apr 7, 2025

Hi @petyaslavova @frankfurtinzahlen, Thanks for the reply. I tried in 0.14.0 helm version , no luck..
(https://artifacthub.io/packages/helm/superset/superset/0.14.1)

I tried with 0.12.0, it worked..

Will try 0.14.0 again once wait_for_db init containers are fixed with secret_key issue.
0.10.2 does not have secret_key configuration, while upgrading it is throwing error now.

supersetNode and supersetWorker pods are fine with 0.12.0 as of now except init containers.

@frankfurtinzahlen
Copy link

@sarath-tfs I think you should discuss this issue at superset and not here. I‘m pretty much sure that it has to do with your superset config/setup.

In case you have set a redis password in your values.yaml, then there are some more settings to be changed that the password/secret is beeing used consistently for all connections where superset is using redis connections.

@sarath-tfs
Copy link
Author

@frankfurtinzahlen , Thank you. will cross check my config, else will reach out to superset .. Keep you posted.

@petyaslavova
Copy link
Collaborator

Hi @sarath-tfs, would you mind closing the issue in this repo ( it will still be possible to post the provided updates by superset) and in case we need to fix something to reopen it?

@sarath-tfs
Copy link
Author

Sure @petyaslavova . Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants