Skip to content
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

Cache setting Redis, still reporting exception upon startup! #30003

Closed
3 tasks done
Sdreamery opened this issue Aug 23, 2024 · 3 comments
Closed
3 tasks done

Cache setting Redis, still reporting exception upon startup! #30003

Sdreamery opened this issue Aug 23, 2024 · 3 comments
Labels
infra:caching Infra setup and configuration related to caching

Comments

@Sdreamery
Copy link

Bug description

In version 4.0, I have already set the cache storage path and placed it in Redis, where I can see the cached data. However, when starting with gunicorn, I still encounter an exception: UserWarning: Using the in memory storage for tracking rate limits as no storage was explicitly specified This is not recommended for production use. See: https://flask-limiter.readthedocs.io#configuring -a-storage-backend for documentation about configuring the storage backend.
image
image
image

How to reproduce the bug

I don't know what to do.

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • 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.
Copy link

dosubot bot commented Aug 23, 2024

The warning you're encountering suggests that the rate limiting storage backend is not correctly configured to use Redis. To resolve this, ensure that the RATELIMIT_STORAGE_URI is set to your Redis URI in your superset_config.py file.

Here is the relevant configuration you need to add or verify:

RATELIMIT_STORAGE_URI = "redis://host:port"

Replace "redis://host:port" with the actual URI of your Redis server. Additionally, ensure that the redis Python package is installed:

pip install Flask-Limiter[redis]

This should configure Flask-Limiter to use Redis for rate limiting, avoiding the fallback to in-memory storage [1][2].

To continue talking to Dosu, mention @dosu.

@dosubot dosubot bot added the infra:caching Infra setup and configuration related to caching label Aug 23, 2024
@Sdreamery
Copy link
Author

The warning you're encountering suggests that the rate limiting storage backend is not correctly configured to use Redis. To resolve this, ensure that the RATELIMIT_STORAGE_URI is set to your Redis URI in your superset_config.py file.

Here is the relevant configuration you need to add or verify:

RATELIMIT_STORAGE_URI = "redis://host:port"

Replace "redis://host:port" with the actual URI of your Redis server. Additionally, ensure that the redis Python package is installed:

pip install Flask-Limiter[redis]

This should configure Flask-Limiter to use Redis for rate limiting, avoiding the fallback to in-memory storage [1][2].

To continue talking to Dosu, mention @dosu.

Sure enough, after setting the parameter RATELIMIT-STORAGE-URI, not only did this problem solve, but another alarm (Warning: root: Class' werkzeug. local. LocalProxy 'is not mapped) also disappeared. Thank you very much!

@rusackas
Copy link
Member

@Sdreamery Glad it worked out! If you can think of a way to improve the code comments and/or documentation, let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra:caching Infra setup and configuration related to caching
Projects
None yet
Development

No branches or pull requests

2 participants