Skip to content

Superset 4.1.1 Migration Causes CrashLoopBackOff Due to Missing flask_cors Module #32655

Closed
@suryansh-ksolves

Description

@suryansh-ksolves

Bug description

Issue Summary
I attempted to migrate Apache Superset from version 3.1.2 to 4.1.1 in a Kubernetes environment. However, after deploying the new image, both the Superset pod and Worker pod are stuck in a CrashLoopBackOff state.

The logs show the following error:

File "/usr/local/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
return self.load_wsgiapp()
File "/usr/local/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
return util.import_app(self.app_uri)
File "/usr/local/lib/python3.10/site-packages/gunicorn/util.py", line 424, in import_app
app = app(*args, **kwargs)
File "/app/superset/app.py", line 40, in create_app
app_initializer.init_app()
File "/app/superset/initialization/init.py", line 483, in init_app
self.configure_middlewares()
File "/app/superset/initialization/init.py", line 585, in configure_middlewares
from flask_cors import CORS
ModuleNotFoundError: No module named 'flask_cors'

Steps to Reproduce
Deploy Superset 4.1.1 using Kubernetes (upgraded from 3.1.2).
Observe that the Superset pod and Worker pod fail to start and enter CrashLoopBackOff.
Check logs, which indicate that flask_cors is missing.
Expected Results
Superset should start successfully after the upgrade without missing dependencies.

Actual Results
Both pods fail to start due to a missing flask_cors module.

Additional Information

Superset Version: 4.1.1
Previous Superset Version: 3.1.2
Deployment Method: Kubernetes
Python Version: 3.10
Error Module: flask_cors missing

Possible Workarounds Tried

I found some references suggesting manually installing flask_cors, but since I am using Kubernetes, I cannot install it manually in the pods.
The issue persists even after rebuilding the image and redeploying.
Request for Help
How can I resolve this issue in a Kubernetes environment? Should flask_cors be explicitly included in the requirements for Superset 4.1.1? How can I ensure it is installed when deploying via Kubernetes?

Screenshots/recordings

Image

Superset version

master / latest-dev

Python version

3.10

Node version

16

Browser

Chrome

Additional context

No response

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions