superset: 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

  1. 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
  2. Unable to run superset
  3. 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!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • 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.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

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?

flask==2.0.3.,werkzeug==2.0.3, jinja2==3.0.1 and WTForms==2.3.3 worked for me.

We have started seeing the same issue in our docker builds this morning.

Try install WTForms.

pip install WTForms==2.3.3

Pinning just Flask to 2.1.3 solved this for us.

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.

Thanks @srinisubramanian installing lower versions of flask and jijna fixed this issue for me.