You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "suryansh-ksolves (via GitHub)" <gi...@apache.org> on 2025/03/13 17:08:35 UTC
[I] Superset 4.1.1 Migration Causes CrashLoopBackOff Due to Missing flask_cors Module [superset]
suryansh-ksolves opened a new issue, #32655:
URL: https://github.com/apache/superset/issues/32655
### 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

### Superset version
master / latest-dev
### Python version
3.10
### Node version
16
### Browser
Chrome
### Additional context
_No response_
### Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] 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 is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Superset 4.1.1 Migration Causes CrashLoopBackOff Due to Missing flask_cors Module [superset]
Posted by "mistercrunch (via GitHub)" <gi...@apache.org>.
mistercrunch commented on issue #32655:
URL: https://github.com/apache/superset/issues/32655#issuecomment-2722618679
Here -> https://github.com/apache/superset/pull/32662, should be sufficient I think
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Superset 4.1.1 Migration Causes CrashLoopBackOff Due to Missing flask_cors Module [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #32655:
URL: https://github.com/apache/superset/issues/32655#issuecomment-2722041284
<!-- Answer -->
A similar issue was previously reported and resolved by installing the `flask-cors` module, which is an optional dependency necessary for the `ENABLE_CORS` feature <sup>[[1]](https://github.com/apache/superset/issues/27102)</sup>. In Superset 4.1.1, `flask_cors` is listed as a dependency with version `4.0.2` <sup>[[2]](https://github.com/apache/superset/blob/c5a2bc5484edf86f672f3bef66b2bbb4060c9e01/requirements/development.txt#L199-L290)</sup>.
To resolve this issue in a Kubernetes environment, you can modify your Helm chart's `values.yaml` or `dev-values.yaml` file to include a bootstrap script that installs the `flask-cors` module. Here's an example of how you can do this:
```yaml
bootstrapScript: |
#!/bin/bash
set -e
# Update system packages and install dependencies
apt update && apt install -y gcc libpq-dev python3-dev pkg-config libmariadb-dev-compat && \
# Install Python dependencies
/app/.venv/bin/pip install \
flask-cors==4.0.2 && \
# Create a bootstrap log file if not already created
if [ ! -f ~/bootstrap ]; then
echo "Running Superset with uid {{ .Values.runAsUser }}" > ~/bootstrap
fi
```
This script ensures that the `flask-cors` module is installed during the deployment process, preventing the `ModuleNotFoundError` and allowing your Superset pods to start successfully <sup>[[3]](https://github.com/apache/superset/discussions/31431)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
---
<sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/db8bc779-6b8d-4af7-943e-8559925309a8?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/db8bc779-6b8d-4af7-943e-8559925309a8?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/db8bc779-6b8d-4af7-943e-8559925309a8?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/db8bc779-6b8d-4af7-943e-8559925309a8?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/db8bc779-6b8d-4af7-943e-8559925309a8?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/db8bc779-6b8d-4af7-943e-8559925309a8?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/db8bc779-6b8d-4af7-943e-8559925309a8?feedback_type=other)</sup>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Superset 4.1.1 Migration Causes CrashLoopBackOff Due to Missing flask_cors Module [superset]
Posted by "mistercrunch (via GitHub)" <gi...@apache.org>.
mistercrunch commented on issue #32655:
URL: https://github.com/apache/superset/issues/32655#issuecomment-2722604683
Looks like using `ENABLE_CORS` requires installing the additional `extra_requires`-configured `cors`, as in `pip install .[cors]` or `pip install apache-superset[cors]`, and that's not in the `lean` image anymore.
Potential solutions:
- clarify the dependency as a comment in `superset/config.py`
- move cors to base python package (I hate to bundle a bunch of things people may not need...)
- add to the `lean` Docker image (?) Might not subscribe to the idea behind `lean`...
- combo of 1 and 3 (?)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Superset 4.1.1 Migration Causes CrashLoopBackOff Due to Missing flask_cors Module [superset]
Posted by "mistercrunch (via GitHub)" <gi...@apache.org>.
mistercrunch closed issue #32655: Superset 4.1.1 Migration Causes CrashLoopBackOff Due to Missing flask_cors Module
URL: https://github.com/apache/superset/issues/32655
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org