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

Embedded Dashboard 500 Error {{superser_domain}}/embedded/{{dashboard_id}}?uiConfig=1 #21146

Closed
progettoautomazione opened this issue Aug 22, 2022 · 16 comments

Comments

@progettoautomazione
Copy link

progettoautomazione commented Aug 22, 2022

Environment:
Superset 2.0.0
Python 3.8
Server Web: Apache
OS: Ubuntu 22

Hi everyone, great job guys, keep going because the tool is cutting edge. Thanks. I'm having a trouble in embedding a dashboard:

I followed all under https://www.npmjs.com/package/@superset-ui/embedded-sdk and https://medium.com/@khushbu.adav/embedding-superset-dashboards-in-your-react-application-7f282e3dbd88

and I created this simple page:
https://progestnow.com/superset.html

As you can see, auth appears going well, but the URL that gets generated gives 500 error: https://bi.progestnow.com/embedded/d4f94ba8-4737-42a4-913e-48e88829ae87?uiConfig=1

I checked the server logs and I found:
AttributeError: 'LoginManager' object has no attribute 'reload_user'
2022-08-22 10:38:52,595:INFO:werkzeug:92.53.59.220 - - [22/Aug/2022 10:38:52] "GET /embedded/d4f94ba8-4737-42a4-913e-48e88829ae87?uiConfig=1 HTTP/1.1" 500 -

Any idea why? Everything else on Superset looks great, I am not seeing any other 500 error that might led to misconfiguration of the tool. It's just this /embed/ route.

Thanks

@progettoautomazione
Copy link
Author

My superset_config.py:

WEBDRIVER_BASEURL = "https://bi.progestnow.com/"

SUPERSET_FEATURE_EMBEDDED_SUPERSET = True

FEATURE_FLAGS = {
    "ENABLE_TEMPLATE_PROCESSING": True,
    "EMBEDDED_SUPERSET": True,
    "EMBEDDABLE_CHARTS": True,
}
DATA_CACHE_CONFIG = {
    "CACHE_TYPE": "SupersetMetastoreCache",
    "CACHE_KEY_PREFIX": "superset_results",  # make sure this string is unique to avoid collisions
    "CACHE_DEFAULT_TIMEOUT": 86400,  # 60 seconds * 60 minutes * 24 hours
}

HTTP_HEADERS = {'X-Frame-Options': 'ALLOWALL'}

SESSION_COOKIE_SAMESITE = None
ENABLE_PROXY_FIX = True
PUBLIC_ROLE_LIKE_GAMMA = True

ENABLE_CORS = True
CORS_OPTIONS = {
  'supports_credentials': True,
  'allow_headers': ['*'],
  'resources':['*'],
  'origins': ['*']
}

ENABLE_TIME_ROTATE = True

@mahesh-kockpit
Copy link

I am also facing same issue

@mahesh-kockpit
Copy link

found any solution @progettoautomazione ?

@progettoautomazione
Copy link
Author

found any solution @progettoautomazione ?

sadly no, as a workaround, we are using simple iframe embed so far....

@cwegener
Copy link
Contributor

@mahesh-kockpit @progettoautomazione This is caused by a later version of flask-login being pulled in as a dependency and Superset still calling the removed method. I don't know exactly which version of flask-login has removed the call, but I do know that flask-login==0.4.1 is working fine

@mahesh-kockpit
Copy link

@cwegener thanks for your comment. I tried this but same issue can you please help us how to implement embedded feature of superset.

@mahesh-kockpit
Copy link

Below is my browser console
image

Below is my IFrame screen shot which is empty
image

@johntwyman
Copy link

I've encountered the same problem. Downgrading flask-login to 0.4.1 definitely fixed the problem for me.

This OctoPrint issue confirms @cwegener 's comment about the flask-login version. The related PR suggests the breaking change came with flask-login:0.5.

@userkdg
Copy link

userkdg commented Oct 25, 2022

up!

@Usiel
Copy link
Contributor

Usiel commented Dec 21, 2022

Similar issue #21987, both should be fixed by #22462

@amarchilukuri
Copy link

Hi, we are also facing same issue. setting flask-login:0.4.1 or flask-login: 0.6.0 not resolved
exception500
the issue. We are using helm chart to setup superset in kubernetes. Someone please help to resolve the same.

We see AttributeError: LoginManager object has no attribute reload_user.

Attached the exception screenshot.

@Delfins
Copy link

Delfins commented Jan 15, 2023

Hi everyone, I understood that the issue has been recognised and probably fixed, but...where? I mean, I've the superset 2.0.0 version installed 7-8 months ago with a regoular pip install apache-superset
Now how do I get the fix?
Thanks

@Usiel
Copy link
Contributor

Usiel commented Jan 16, 2023

Hi everyone, I understood that the issue has been recognised and probably fixed, but...where? I mean, I've the superset 2.0.0 version installed 7-8 months ago with a regoular pip install apache-superset
Now how do I get the fix?
Thanks

I don't know which future release the fix will be included in @Delfins. In the meantime you can use the workaround by @cwegener.

@Delfins
Copy link

Delfins commented Jan 16, 2023

Hi everyone, I understood that the issue has been recognised and probably fixed, but...where? I mean, I've the superset 2.0.0 version installed 7-8 months ago with a regoular pip install apache-superset
Now how do I get the fix?
Thanks

I don't know which future release the fix will be included in @Delfins. In the meantime you can use the workaround by @cwegener.

Thanks @Usiel but I'm a newbie of Python, how do I downgrade the flask version?

@Usiel
Copy link
Contributor

Usiel commented Jan 16, 2023

Simplest way will be to adapt your pip install command to pip install apache-superset==2.0.0 flask-login==0.4.1 or just pip install flask-login==0.4.1 if you just want to fix your current setup (0.4.1 is perfectly compatible with Superset 2.0.0).

@rusackas
Copy link
Member

This is likely fixed by now, and is pretty out of date if not. If people are still encountering this in currently suppored versions (3.x or newer) please open a new Issue with updated context, or a PR to address the problem.

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

No branches or pull requests

9 participants