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

How to setup Superset and setup embeded charts #13697

Closed
Riskatri opened this issue Mar 19, 2021 · 23 comments
Closed

How to setup Superset and setup embeded charts #13697

Riskatri opened this issue Mar 19, 2021 · 23 comments
Labels
install:config Installation - Configuration settings question & help wanted Use Github discussions instead

Comments

@Riskatri
Copy link

Hi iam using superset version 1.0.0 but when i am trying to run with superset run -p 8088 --with-threads --reload --debugger i have an error

image

can someone help me?

@zhaoyongjie
Copy link
Member

Hi @Riskatri , did you change the sueprset/config.py file?

@Riskatri
Copy link
Author

@zhaoyongjie this issue has been solve. thankyou. but did you know about embed superset with iframe? i am trying to embed but i have an error like this

image

i follow to change the config like this #8830 . but didn't work for me.

@zhaoyongjie
Copy link
Member

zhaoyongjie commented Mar 19, 2021

@Riskatri
A quick solution is to set WTF_CSRF_ENABLED = False in config.py, or any overwrite config file.
In the long term, you need to set a list for exempt CSRF protection.

superset/superset/config.py

Lines 168 to 174 in 375ded9

QUERY_SEARCH_LIMIT = 1000
# Flask-WTF flag for CSRF
WTF_CSRF_ENABLED = True
# Add endpoints that need to be exempt from CSRF protection
WTF_CSRF_EXEMPT_LIST = ["superset.views.core.log", "superset.charts.api.data"]

@zhaoyongjie zhaoyongjie added question & help wanted Use Github discussions instead install:config Installation - Configuration settings labels Mar 19, 2021
@zhaoyongjie zhaoyongjie changed the title cannot running superset How to setup Superset and setup embeded charts Mar 19, 2021
@Riskatri
Copy link
Author

Riskatri commented Mar 19, 2021

@zhaoyongjie i've tried it, but when I logged in to the page there was no response and went back to login

image

I inspect console , and find this

image

@anphamvn
Copy link

anphamvn commented Apr 5, 2021

I had the same problem when embedding the superset dashboard (using iframe) in my web, I have tried many ways but with no luck hix
Can someone help me to solve it?

@Riskatri
Copy link
Author

Riskatri commented Apr 5, 2021

@anphamvn follow the step here :

  • Set ROLE_PUBLIC as public and PUBLIC_ROLE_LIKE = ‘Gamma’ in file config.py
  • Add datasource access in public role
  • Re-launch superset with superset init
  • If have an error ' the csrf token is missing' , set WTF_CSRF_ENABLED = False in config.py

@anphamvn
Copy link

anphamvn commented Apr 5, 2021

@anphamvn follow the step here :

  • Set ROLE_PUBLIC as public and PUBLIC_ROLE_LIKE = ‘Gamma’ in file config.py
  • Add datasource access in public role
  • Re-launch superset with superset init
  • If have an error ' the csrf token is missing' , set WTF_CSRF_ENABLED = False in config.py

Thanks @Riskatri
i followed your instructions but still no luck :)

  1. Set ROLE_PUBLIC as public and PUBLIC_ROLE_LIKE = ‘Gamma’ in file config.py
    AUTH_ROLE_PUBLIC = 'Public'
    PUBLIC_ROLE_LIKE = 'Gamma'
    Capture_1
  2. Add datasource access in public role
    i set 'All Datasource Access on all_datasource_access
    Capture_2
  3. Re-launch superset with superset init
    Yes, sure :)
    here log file
    INFO:superset.security.manager:Fetching a set of all perms to lookup which ones are missing Creating missing datasource permissions. INFO:superset.security.manager:Creating missing datasource permissions. Creating missing database permissions. INFO:superset.security.manager:Creating missing database permissions. Creating missing metrics permissions INFO:superset.security.manager:Creating missing metrics permissions Cleaning faulty perms INFO:superset.security.manager:Cleaning faulty perms
    Error
    ==> after that the error 'The CSRF missing ...' still occurred

4 I try to set WTF_CSRF_ENABLED = False and when I logged in to the page there was no response and went back to login

@Riskatri
Copy link
Author

Riskatri commented Apr 5, 2021

@anphamvn
maybe, you are wrong. just uncomment it in the AUTH_ROLE_PUBLIC section, don't rewrite it and for PUBLIC_ROLE_LIKE. You can find it on line 265
_

PUBLIC_ROLE_LIKE: Optional [str] = 'Gamma'

_.
change it there, don't rewrite it.
and always re-launch again after change the file config.py.
if still no successful, try to add PUBLIC_ROLE_LIKE_GAMMA = True in file config.py and re-launch again.

@albertwgchu
Copy link

albertwgchu commented May 14, 2021

So I am using docker and I added the following to my config:

WTF_CSRF_ENABLED = False
SESSION_COOKIE_SAMESITE = None
SESSION_COOKIE_SECURE = False
SESSION_COOKIE_HTTPONLY = False
AUTH_ROLE_PUBLIC = 'Public'
PUBLIC_ROLE_LIKE = 'Gamma'

This gets me past the login screen CSRF issues above and I can see that the api requests for charts, datasets and dashboard succeed. However I'm getting a javascript error in the iframe. @Riskatri did you run into this?

image

29db33713260b5a6d757.chunk.js:2 TypeError: Cannot convert undefined or null to object
at values ()
at spa.3b0a2a722a47bd99984d.entry.js:558
at spa.3b0a2a722a47bd99984d.entry.js:1436
at spa.3b0a2a722a47bd99984d.entry.js:558
at spa.3b0a2a722a47bd99984d.entry.js:1098
at 7ee55ea40fa185cf788d.chunk.js:1
at au (29db33713260b5a6d757.chunk.js:2)
at mc (29db33713260b5a6d757.chunk.js:2)
at t.unstable_runWithPriority (29db33713260b5a6d757.chunk.js:2)
at Ia (29db33713260b5a6d757.chunk.js:2)

@anilvpatel21
Copy link

Hi, @albertwgchu @Riskatri
I am getting a similar issue, I check the logs its says

2021-07-15 15:32:54,576:WARNING:root:Class 'werkzeug.local.LocalProxy' is not mapped

@HariniPuppala
Copy link

Hi, @albertwgchu @Riskatri @anilvpatel21

I am getting the similar issue as you all mentioned.

Below are my Superset setup details:
Configured LDAP Authentication in superset.
Enabled a Custom Security Manager to authenticate based on a jwt-token.
The jwt-token based authentication is working as expected and we are able to redirect to the dashboards without the login page
The same is not working when passed in an iframe.

MicrosoftTeams-image

I can see a warning message in the logs as below:
WARNING:root:Class 'werkzeug.local.LocalProxy' is not mapped

Can anyone please help. Thanks in advance!

@anilvpatel21
Copy link

It's might be a problem with Flask Appbuilder recently upgraded in superset 1.2

For a while use superset 1.1, with your config. It will works out.

@zyona3
Copy link

zyona3 commented Jul 29, 2021

@HariniPuppala

I had a same error and @anilvpatel21 's solution did not work, but solved as follows

  • remove redis cache

@jhult
Copy link
Contributor

jhult commented Aug 2, 2021

Related: #8382

@handita
Copy link

handita commented Aug 19, 2021

How to remove redis cache? I have experiencing same problem.. @Xx0w0wxX

@zyona3
Copy link

zyona3 commented Aug 20, 2021

@handita In my case, remove the mounted volume

@jhult
Copy link
Contributor

jhult commented Sep 17, 2021

Also related to #15737 and #16718.

@vikas-nykaa
Copy link

vikas-nykaa commented Nov 17, 2021

I am also getting same error on google chrome while iframe superset url
WARNING:root:Class 'werkzeug.local.LocalProxy' is not mapped
But on firefox and safari it is working fine.
Any suggestions

@Kingflyinger
Copy link

@anphamvn maybe, you are wrong. just uncomment it in the AUTH_ROLE_PUBLIC section, don't rewrite it and for PUBLIC_ROLE_LIKE. You can find it on line 265 _

PUBLIC_ROLE_LIKE: Optional [str] = 'Gamma'

_. change it there, don't rewrite it. and always re-launch again after change the file config.py. if still no successful, try to add PUBLIC_ROLE_LIKE_GAMMA = True in file config.py and re-launch again.

thanks a lot.it solved my problem

@mcgorias
Copy link

mcgorias commented Jan 16, 2023

Hi, @albertwgchu @Riskatri @anilvpatel21

I am getting the similar issue as you all mentioned.

Below are my Superset setup details: Configured LDAP Authentication in superset. Enabled a Custom Security Manager to authenticate based on a jwt-token. The jwt-token based authentication is working as expected and we are able to redirect to the dashboards without the login page The same is not working when passed in an iframe.

MicrosoftTeams-image

I can see a warning message in the logs as below: WARNING:root:Class 'werkzeug.local.LocalProxy' is not mapped

Can anyone please help. Thanks in advance!

I had the same issue,
According to the "Manage access to Dashboards part" of the documentation, you should enable DASHBOARD_RBAC feature flag

I followed the docker-compose install guide.
So, in my case, editing ./docker/pythonpath_dev/superset_config.py and set FEATURE_FLAGS = {"ALERT_REPORTS": True ,"DASHBOARD_RBAC": True } allowed me to set my Dashboard as Public.

image

@anilvpatel21
Copy link

anilvpatel21 commented Jan 18, 2023 via email

@fabioselau077
Copy link

Hi, @albertwgchu @Riskatri I am getting a similar issue, I check the logs its says

2021-07-15 15:32:54,576:WARNING:root:Class 'werkzeug.local.LocalProxy' is not mapped

same here, resolved? i'm using ec2 aws

@fabioselau077
Copy link

I am also getting same error on google chrome while iframe superset url WARNING:root:Class 'werkzeug.local.LocalProxy' is not mapped But on firefox and safari it is working fine. Any suggestions

resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
install:config Installation - Configuration settings question & help wanted Use Github discussions instead
Projects
None yet
Development

No branches or pull requests