superset icon indicating copy to clipboard operation
superset copied to clipboard

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

Open fabioselau077 opened this issue 1 year ago • 7 comments

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.

fabioselau077 avatar Nov 18 '23 21:11 fabioselau077

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.

sfirke avatar Nov 28 '23 18:11 sfirke

can we suppress those warnings?

justmike1 avatar Dec 03 '23 07:12 justmike1

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

rusackas avatar Apr 19 '24 15:04 rusackas

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

andy-clapson avatar May 13 '24 14:05 andy-clapson

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!

byeonghyun-kim avatar May 23 '24 09:05 byeonghyun-kim

发自我的手机-------- 原始邮件 --------发件人: 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 avatar May 23 '24 11:05 daringliu

  😍发自我的手机-------- 原始邮件 --------发件人: @.日期: 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: @.***>

daringliu avatar May 23 '24 11:05 daringliu

++ #29403

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

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

Habeeb556 avatar Aug 09 '24 21:08 Habeeb556