apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
62.78k stars 13.86k forks source link

Superset application logs are full of warnings: WARNING:root:Class 'werkzeug.local.LocalProxy' is not mapped #26020

Open fabioselau077 opened 12 months ago

fabioselau077 commented 12 months ago

Hello, my problem is exactly the same as the one reported on stackoverflow, after installing I had a problem that after logging in it redirected to the login screen again, I checked the logs and it was about CSRF, I commented out some lines in the config file and now after logging in I have the error "WARNING:root:Class 'werkzeug.local.LocalProxy' is not mapped", but I haven't found any solution yet.

sfirke commented 11 months ago

The loop redirecting to the login screen with a CSRF error is discussed and addressed in #24579.

The warning you note is a warning, not an error, and has been present in my Superset logs since at least 2.0.0 without causing any performance problems. That said, it clutters the logs and confuses people who are troubleshooting (like this case). I'm going to retitle this issue and leave it open until someone closes it by resolving the werkzeug.local.LocalProxy warning message.

justmike1 commented 11 months ago

can we suppress those warnings?

rusackas commented 6 months ago

cc @craig-rueda and @dpgaspar to see if either of them know how to either resolve or suppress the warning.

andy-clapson commented 6 months ago

this might not be the solution you're going for, but the warnings module in stdlib is pretty effective for tuning out warnings from 3rd party packages: https://docs.python.org/3/library/warnings.html

byeonghyun-kim commented 5 months ago

OK, this issue may be less concerned, but I faced this issue and I think I figured it out. Anyhow, I wrote down RATELIMIT_STORAGE_URI option in my superset_config.py file, and the warning doesn't pop out anymore. I use Redis as my backend, so I wrote the option like this: RATELIMIT_STORAGE_URI = 'redis://{REDIS_HOST}:{REDIS_PORT}' And voila, the warning is gone.

In code side, there's a empty dict value _event_logger at superset/superset/extensions/init.py . Below the variable, event_logger variable gets LocalProxy of Werkzeug, and if _event_logger stays as empty dict, event_logger LocalProxy get nothing from .get method, and I think that's why this warning pops up. (Just my theory though)

And for the record, I am using Superset 4.0.1 self-hosted!

daringliu commented 5 months ago

发自我的手机-------- 原始邮件 --------发件人: Byeonghyun Kim @.>日期: 2024年5月23日周四 17:58收件人: apache/superset @.>抄送: Subscribed @.***>主 题: Re: [apache/superset] Superset application logs are full of warnings: WARNING:root:Class 'werkzeug.local.LocalProxy' is not mapped (Issue #26020) OK, this issue may be less concerned, but I faced this issue and I think I figured it out. Anyhow, I wrote down RATELIMIT_STORAGE_URI option in my superset_config.py file, and the warning doesn't pop out anymore. I use Redis as my backend, so I wrote the option like this: RATELIMIT_STORAGE_URI = 'redis://{REDIS_HOST}:{REDIS_PORT}' And voila, the warning is gone. In code side, there's a empty dict value _event_logger at superset/superset/extensions/init.py . Below the variable, event_logger variable gets LocalProxy of Werkzeug, and if _event_logger stays as empty dict, event_logger LocalProxy get nothing from .get method, and I think that's why this warning pops up. (Just my theory though)

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

daringliu commented 5 months ago

  😍发自我的手机-------- 原始邮件 --------发件人: @.日期: 2024年5月23日周四 19:03收件人: apache/superset @.>, Byeonghyun Kim @.>, apache/superset @.>抄送: Subscribed @.>主 题: 回复:[apache/superset] Superset application logs are full of warnings: WARNING:root:Class 'werkzeug.local.LocalProxy' is not mapped (Issue #26020)发自我的手机-------- 原始邮件 --------发件人: Byeonghyun Kim @.>日期: 2024年5月23日周四 17:58收件人: apache/superset @.>抄送: Subscribed @.>主 题: Re: [apache/superset] Superset application logs are full of warnings: WARNING:root:Class 'werkzeug.local.LocalProxy' is not mapped (Issue #26020) OK, this issue may be less concerned, but I faced this issue and I think I figured it out. Anyhow, I wrote down RATELIMIT_STORAGE_URI option in my superset_config.py file, and the warning doesn't pop out anymore. I use Redis as my backend, so I wrote the option like this: RATELIMIT_STORAGE_URI = 'redis://{REDIS_HOST}:{REDIS_PORT}' And voila, the warning is gone. In code side, there's a empty dict value _event_logger at superset/superset/extensions/init.py . Below the variable, event_logger variable gets LocalProxy of Werkzeug, and if _event_logger stays as empty dict, event_logger LocalProxy get nothing from .get method, and I think that's why this warning pops up. (Just my theory though)

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

Habeeb556 commented 3 months ago

++ #29403

I’ve already configured this, but the warning persists.

RATELIMIT_STORAGE_URI = f"redis://{REDIS_HOST}:{REDIS_PORT}"