superset
superset copied to clipboard
Superset Fresh Install or Upgrade results in TypeError
I have tried both upgrading from Superset 1.5 and installing Superset 2.0 in a separate pyenv. Both result in the same issue : TypeError: init() got an unexpected keyword argument 'unbound_message'
How to reproduce the bug
- I followed the https://superset.apache.org/docs/installation/installing-superset-from-scratch guide to setup 1.5 a few months ago and followed the same to setup 2.0. I also tried upgrading using https://superset.apache.org/docs/installation/upgrading-superset
- Unable to run superset
- Stack trace
Traceback (most recent call last):
File "/home/jenkinsci/.pyenv/versions/superset2/bin/superset", line 33, in <module>
sys.exit(load_entry_point('apache-superset==2.0.0', 'console_scripts', 'superset')())
File "/home/jenkinsci/.pyenv/versions/superset2/bin/superset", line 25, in importlib_load_entry_point
return next(matches).load()
File "/home/jenkinsci/.pyenv/versions/3.9.11/lib/python3.9/importlib/metadata.py", line 86, in load
module = import_module(match.group('module'))
File "/home/jenkinsci/.pyenv/versions/3.9.11/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/home/jenkinsci/.pyenv/versions/3.9.11/envs/superset2/lib/python3.9/site-packages/superset/__init__.py", line 18, in <module>
from flask import current_app, Flask
File "/home/jenkinsci/.pyenv/versions/3.9.11/envs/superset2/lib/python3.9/site-packages/flask/__init__.py", line 4, in <module>
from . import json as json
File "/home/jenkinsci/.pyenv/versions/3.9.11/envs/superset2/lib/python3.9/site-packages/flask/json/__init__.py", line 8, in <module>
from ..globals import current_app
File "/home/jenkinsci/.pyenv/versions/3.9.11/envs/superset2/lib/python3.9/site-packages/flask/globals.py", line 56, in <module>
app_ctx: "AppContext" = LocalProxy( # type: ignore[assignment]
TypeError: __init__() got an unexpected keyword argument 'unbound_message'
Expected results
Superset should run normally
Actual results
Exception as above.
Environment
(please complete the following information):
- OS : CentOS Linux release 7.9.2009 (Core)
- browser type and version: Chrome
- superset version: 2.0
- python version: Tried both 3.8.13 and 3.9.11
- any feature flags active:
- DASHBOARD_RBAC
- VERSIONED_EXPORT
- DASHBOARD_CROSS_FILTERS
- ENABLE_TEMPLATE_PROCESSING
Checklist
Make sure to follow these steps before submitting your issue - thank you!
- [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
- [x] I have reproduced the issue with at least the latest released version of superset.
- [x] I have checked the issue tracker for the same issue and I haven't found one similar.
Additional context
Add any other context about the problem here.
We have started seeing the same issue in our docker builds this morning.
Strange thing is I tried this on another similar system and it upgraded and ran without errors. However on 2 other identical systems I have this issue and its right now a blocker wherein on two landscapes we are on 2.0 and the main servers are still stuck on 1.5
@villebro @srinify Any guidance appreciated
OK, this is strange. When I installed I just used "pip install apache-superset". The output of the superset --version command displays the following:
(superset2) [xxxxxxx ~]$ superset --version
Loaded your LOCAL configuration at [/home/xxxxxx/.superset/superset_config.py]
Python 3.9.11
Flask 2.2.0
Werkzeug 2.2.1
The requirements.txt points to Flask 2.0.3 and on a hunch I did a pip uninstall Flask and pip install flask==2.0.3. Also werkzeug==2.0.3 and jinja2==3.0.1
It now starts working. Wondering why pip install apache-superset installed newer versions of flask etc?
Thanks @srinisubramanian installing lower versions of flask and jijna fixed this issue for me.
Pinning just Flask to 2.1.3 solved this for us.
Pinning just Flask to 2.1.3 solved this for us.
2.1.3 didn't work for me. Had to set it to 2.0.3. But yes the Flask version is the issue.
Pinning just Flask to 2.1.3 solved this for us.
2.1.3 didn't work for me. Had to set it to 2.0.3. But yes the Flask version is the issue.
I would double-check that, as it seems to have been the 2.2.0 release that (removed deprecated code and hence) broke Superset for us at least.
Flask==2.1.3 with Werkzeug==2.0.3 (which is compatible) works for me. Bumping Werkzeug to anything >2.0.3 leads to the same error message again.
I'm also trying to Setup Fresh Superset. But I'm getting this error. Please help.
(superset) root@osvinuser-s:~# superset db upgrade
Traceback (most recent call last):
File "/root/.pyenv/versions/superset/bin/superset", line 33, in
Flask==2.1.3 Flask-AppBuilder==3.4.5 Flask-Babel==2.0.0 Flask-Caching==1.11.1 Flask-Compress==1.12 Flask-JWT-Extended==3.25.1 Flask-Login==0.4.1 Flask-Migrate==3.1.0 Flask-OpenID==1.3.0 Flask-SQLAlchemy==2.5.1 flask-talisman==1.0.0 Flask-WTF==0.14.3 Werkzeug==2.2.2 Jinja2==3.1.2
Check your Werkzeug and jinja2 version wrt working version mentioned above
@srinisubramanian I had same issue with this #20967
And also just follow your resolution, but after run superset db upgrade
, I got new error :
Is there something I missed ?
Environment
- superset version
2.0
- python version
3.8.10
Try install WTForms.
pip install WTForms==2.3.3
@afifdevtest It took me some time to get all the required versions. So just follow these steps. You will be good to go.
Supersets require only perticular version of some python libraries.
First run this command >>pip list
Some main packages to remember (flask==2.0.3, werkzeug==2.0.3 and jinja2==3.0.1);
install them with this command (pip install flask==2.0.3, pip install werkzeug==2.0.3, pip install jinja2==3.0.1)
also install some additional packages with specific version. pip install Flask-WTF==0.14.3 pip install pyOpenSSL pip install pySocks==1.5.6 pip install markupsafe==2.0.1 pip install pillow pip install flask-caching==1.10.0
Now run >>superset db upgrade
Try install WTForms.
pip install WTForms==2.3.3
Installing the WTForms worked, but i wonder why!!! cool!!
flask==2.0.3.,werkzeug==2.0.3, jinja2==3.0.1 and WTForms==2.3.3 worked for me.
Since we're now on 3.1, on the verge of 4.0, we're not supporting 2.x or prior versions actively. If anyone is experiencing this issue in current versions, please file a new issue with updated context and repro steps. Thank you for understanding :)