Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Superset 2.x: AttributeError: module 'flask.json' has no attribute 'JSONEncoder' #27204

Closed
2 of 3 tasks
amotl opened this issue Feb 22, 2024 · 0 comments
Closed
2 of 3 tasks

Comments

@amotl
Copy link

amotl commented Feb 22, 2024

Bug description

Hi there,

we are running integration tests with Apache Superset and CrateDB on behalf of our cratedb-examples repository. Two days ago, the corresponding CI job started failing with the error message AttributeError: module 'flask.json' has no attribute 'JSONEncoder'. The error happens when invoking superset db upgrade, and only on Apache Superset 2.x.

It baffles us that the error is apparently happening out of the blue, without any obvious things being changed. Everything worked well until two days ago.

Based on suggestions gathered on behalf of crate/cratedb-examples#313, we tried to fiddle with a few dependencies already, trying different combinations of versions around Flask and friends, but haven't been able to discover the root cause.

With kind regards,
Andreas.

How to reproduce the bug

Invoke superset db upgrade on the most recent Apache Superset 2.x, specifically Apache Superset 2.1.3.

Screenshots/recordings

No response

Superset version

2.1.3

Python version

3.11

Node version

Not applicable

Browser

Not applicable

Additional context

Traceback (most recent call last):
  File "/path/to/bin/superset", line 5, in <module>
    from superset.cli.main import superset
  File "/path/to/lib/python3.11/site-packages/superset/__init__.py", line 21, in <module>
    from superset.app import create_app
  File "/path/to/lib/python3.11/site-packages/superset/app.py", line 23, in <module>
    from superset.initialization import SupersetAppInitializer
  File "/path/to/lib/python3.11/site-packages/superset/initialization/__init__.py", line 27, in <module>
    from flask_appbuilder import expose, IndexView
  File "/path/to/lib/python3.11/site-packages/flask_appbuilder/__init__.py", line 5, in <module>
    from .api import ModelRestApi  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/lib/python3.11/site-packages/flask_appbuilder/api/__init__.py", line 38, in <module>
    from ..baseviews import AbstractViewApi
  File "/path/to/lib/python3.11/site-packages/flask_appbuilder/baseviews.py", line 22, in <module>
    from .forms import GeneralModelConverter
  File "/path/to/lib/python3.11/site-packages/flask_appbuilder/forms.py", line 3, in <module>
    from flask_wtf import FlaskForm
  File "/path/to/lib/python3.11/site-packages/flask_wtf/__init__.py", line 4, in <module>
    from .recaptcha import Recaptcha
  File "/path/to/lib/python3.11/site-packages/flask_wtf/recaptcha/__init__.py", line 1, in <module>
    from .fields import RecaptchaField
  File "/path/to/lib/python3.11/site-packages/flask_wtf/recaptcha/fields.py", line 3, in <module>
    from . import widgets
  File "/path/to/lib/python3.11/site-packages/flask_wtf/recaptcha/widgets.py", line 6, in <module>
    JSONEncoder = json.JSONEncoder
                  ^^^^^^^^^^^^^^^^
AttributeError: module 'flask.json' has no attribute 'JSONEncoder'

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant