You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "bondany (via GitHub)" <gi...@apache.org> on 2025/02/05 09:41:18 UTC
[I] Flask Application Not Found After Upgrading from Python 3.6 and Apache Superset 0.38.1 to Python 3.10 and Superset 4.1.1 [superset]
bondany opened a new issue, #32140:
URL: https://github.com/apache/superset/issues/32140
### Bug description
Hello,
We are upgrading from a very old version of Superset and have successfully exported and imported datasets.
### Older Version Details:
- **Superset Version**: 0.38.1
- **Python Version**: 3.6.9
- **Flask Version**: 1.1.4
- **Werkzeug Version**: 1.0.1
#### Export Command on the Old Environment:
```shell
$ superset export_datasources -f PROD_export.zip
```
(Note: I noticed that it is not actually a zip file but a YAML file, contrary to what is explained in the docs.)
### Newer Version Details:
- **Superset Version**: 4.1.1
- **Python Version**: 3.10.12
- **Flask Version**: 2.3.3
- **Werkzeug Version**: 3.1.3
#### Import Command on the New Environment:
```shell
$ superset legacy-import-datasources --path PROD_export.yml
```
After completing the upgrade and importing the dataset, we encountered the following error when trying to run Superset:
```shell
Error: Could not locate a Flask application. Use the 'flask --app' option, 'FLASK_APP' environment variable, or a 'wsgi.py' or 'app.py' file in the current directory.
```
>#### Additional Info
>We need to mention that, before the import of the datasets, we had issues with `custom_sso_security_manager.py`.
>We defined `SUPERSET_CONFIG_PATH`, but, using only this variable, Python was not able to find the `custom_sso_security_manager` module from `superset_config.py`. Strangely, creating a simple `test.py`, Python was able to import it from with no issues.
>Double checking the `custom_sso_security_manager.py`, we could not find any problems.
>Defining `PYTHONPATH` (initially empty) as `export PYTHONPATH="/home/superset/.config/superset:$PYTHONPATH"` together with `export SUPERSET_CONFIG_PATH="/home/superset/.config/superset/superset_config.py"` would create circular imports.
>Removing `SUPERSET_CONFIG_PATH` and having only `PYTHONPATH` was the solution for this problem.
#### Current ENV
```shell
SHELL=/bin/bash
NVM_INC=/home/superset/.nvm/versions/node/v22.13.0/include/node
HISTTIMEFORMAT=%F %T
PWD=/home/superset
LOGNAME=superset
HOME=/home/superset
LANG=C.UTF-8
LS_COLORS=...
VIRTUAL_ENV=/home/superset/superset_env
SUPERSET_HOME=/home/superset/.data/superset
SUPERSET_SECRET_KEY=REDACTED
NVM_DIR=/home/superset/.nvm
SGX_AESM_ADDR=1
LESSCLOSE=/usr/bin/lesspipe %s %s
PYTHONPATH=/home/superset/.config/superset:
TERM=xterm
LESSOPEN=| /usr/bin/lesspipe %s
USER=superset
FLASK_APP=superset
SHLVL=1
NVM_CD_FLAGS=
VIRTUAL_ENV_PROMPT=superset_env
PS1=...
GCC_COLORS=error=...
XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
PATH=/home/superset/superset_env/bin:/home/superset/.nvm/versions/node/v22.13.0/bin:/usr/bin/:/usr/sbin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
NVM_BIN=/home/superset/.nvm/versions/node/v22.13.0/bin
MAIL=/var/mail/superset
_=/usr/bin/printenv
```
As a last resort, after a couple of days of debugging, we executed the following commands:
```shell
$ superset db upgrade
$ superset init
```
Additionally, I created an admin user for Flask as follows:
```shell
$ superset fab create-admin
```
(source: https://www.cnblogs.com/qq2483763504/p/16718615.html)
But the problem still persist.
Can someone help us understand if this is a bug or bad configuration.
Thank you!
### Screenshots/recordings
_No response_
### Superset version
4.1.1
### Python version
3.10
### Node version
18 or greater
### Browser
Not applicable
### 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] Flask Application Not Found After Upgrading from Python 3.6 and Apache Superset 0.38.1 to Python 3.10 and Superset 4.1.1 [superset]
Posted by "bondany (via GitHub)" <gi...@apache.org>.
bondany commented on issue #32140:
URL: https://github.com/apache/superset/issues/32140#issuecomment-2638800287
### Update
Apparently the message appears only when using `superset --help` which I was using for testing/check Superset configuration correctness. It does not appear with `superset db --help` or any other combination of command/option, which is confusing.
In the old version we were using, this was not happening...
--
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] Flask Application Not Found After Upgrading from Python 3.6 and Apache Superset 0.38.1 to Python 3.10 and Superset 4.1.1 [superset]
Posted by "bondany (via GitHub)" <gi...@apache.org>.
bondany commented on issue #32140:
URL: https://github.com/apache/superset/issues/32140#issuecomment-2638352515
@dosu,
Installing `Flask==2.0.2` and `Werkzeug==2.0.2` gives me the following error:
```shell
$ python -m pip install Flask==2.0.2 Werkzeug==2.0.2
Collecting Flask==2.0.2
Downloading Flask-2.0.2-py3-none-any.whl.metadata (3.8 kB)
Collecting Werkzeug==2.0.2
Downloading Werkzeug-2.0.2-py3-none-any.whl.metadata (4.5 kB)
[...]
Installing collected packages: Werkzeug, Flask
'ERROR: pip''s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
apache-superset 4.1.1 requires flask<3.0.0,>=2.2.5, but you have flask 2.0.2 which is incompatible.
flask-session 0.8.0 requires flask>=2.2, but you have flask 2.0.2 which is incompatible.'
```
--
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] Flask Application Not Found After Upgrading from Python 3.6 and Apache Superset 0.38.1 to Python 3.10 and Superset 4.1.1 [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #32140:
URL: https://github.com/apache/superset/issues/32140#issuecomment-2917428830
I'm not sure why the `superset --help` would be throwing an error, but were you successfully able to upgrade? I'm not sure if we should keep this open as a bug report still, or move it to a Discussion if you're still facing any issues.
--
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] Flask Application Not Found After Upgrading from Python 3.6 and Apache Superset 0.38.1 to Python 3.10 and Superset 4.1.1 [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #32140:
URL: https://github.com/apache/superset/issues/32140#issuecomment-2638353405
<!-- Answer -->
Apache Superset 4.1.1 requires specific versions of Flask and Werkzeug to function correctly. The required versions are Flask 2.3.3 and Werkzeug 3.1.3 <sup>[[1]](https://github.com/apache/superset/blob/master/requirements/development.txt)</sup>. Installing older versions like Flask 2.0.2 and Werkzeug 2.0.2 will lead to dependency conflicts, as you've experienced.
To resolve the issue, ensure that you have the correct versions installed by running:
```shell
python -m pip install Flask==2.3.3 Werkzeug==3.1.3
```
This should align with the requirements of Superset 4.1.1 and help avoid compatibility issues.
<!-- 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/bbd916b3-2274-4b9a-b77c-0255c25bde75?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/bbd916b3-2274-4b9a-b77c-0255c25bde75?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/bbd916b3-2274-4b9a-b77c-0255c25bde75?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/bbd916b3-2274-4b9a-b77c-0255c25bde75?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/bbd916b3-2274-4b9a-b77c-0255c25bde75?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/bbd916b3-2274-4b9a-b77c-0255c25bde75?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] Flask Application Not Found After Upgrading from Python 3.6 and Apache Superset 0.38.1 to Python 3.10 and Superset 4.1.1 [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #32140:
URL: https://github.com/apache/superset/issues/32140#issuecomment-2636226650
<!-- Greeting -->
Hey there, @bondany! I'm here to help you with any bugs, questions, or contributions you have. Let's squash those bugs together! 🐞
<!-- Answer -->
I found a similar unsolved discussion that might be relevant to your issue: [install apache-superset==3.1.0 on win10 successfully, but `superset db upgrade` failed....](https://github.com/apache/superset/discussions/27156) <sup>[[1]](https://github.com/apache/superset/discussions/27156)</sup>. Although it doesn't directly address your specific problem, it might provide some insights or approaches that could be useful.
Regarding your issue, the error message "Could not locate a Flask application" typically indicates that the `FLASK_APP` environment variable is not set correctly or that the application entry point is not properly configured. Here are a few suggestions to troubleshoot and potentially resolve the issue:
1. **Verify `FLASK_APP` Environment Variable**: Ensure that the `FLASK_APP` environment variable is set to `superset`. You can do this by running:
```shell
export FLASK_APP=superset
```
2. **Check for Version Compatibility**: Ensure that the versions of Flask and Werkzeug are compatible. Sometimes, mismatched versions can cause issues. You might want to try aligning them to versions known to work well together, such as `Flask==2.0.2` and `Werkzeug==2.0.2`, as mentioned in the source you referred to.
3. **Configuration Paths**: Double-check your configuration paths to ensure there are no circular imports or misconfigurations. It seems you resolved a similar issue by adjusting `PYTHONPATH` and `SUPERSET_CONFIG_PATH`.
4. **Application Entry Point**: Make sure that your application entry point is correctly set up. If you have a custom entry point, ensure that it is correctly referenced in your configuration.
5. **Logs and Debugging**: Check the Superset logs for any additional error messages or stack traces that might provide more context on the issue.
If these steps do not resolve the issue, it might be helpful to provide more detailed logs or error messages to further diagnose the problem.
<!-- 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/4824085e-959d-4715-945c-257b9533194b?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/4824085e-959d-4715-945c-257b9533194b?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/4824085e-959d-4715-945c-257b9533194b?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/4824085e-959d-4715-945c-257b9533194b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/4824085e-959d-4715-945c-257b9533194b?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/4824085e-959d-4715-945c-257b9533194b?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] Flask Application Not Found After Upgrading from Python 3.6 and Apache Superset 0.38.1 to Python 3.10 and Superset 4.1.1 [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #32140:
URL: https://github.com/apache/superset/issues/32140#issuecomment-2640826679
For export/import, I can't remember when it changed from yaml to zip, but you may need to import yaml at some intermediary version while there was still support for that. That's a big leap in upgrades, I think you'll be happy with the current state of the app when you get there!
--
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] Flask Application Not Found After Upgrading from Python 3.6 and Apache Superset 0.38.1 to Python 3.10 and Superset 4.1.1 [superset]
Posted by "bondany (via GitHub)" <gi...@apache.org>.
bondany commented on issue #32140:
URL: https://github.com/apache/superset/issues/32140#issuecomment-2921047050
Hello @rusackas, yes, I did not have any issue with the update.
I was using `superset --help` to test the installation itself, and the error message was making me confused.
In the end, that is the only problem.
We can close the issue if you want.
--
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] Flask Application Not Found After Upgrading from Python 3.6 and Apache Superset 0.38.1 to Python 3.10 and Superset 4.1.1 [superset]
Posted by "bondany (via GitHub)" <gi...@apache.org>.
bondany commented on issue #32140:
URL: https://github.com/apache/superset/issues/32140#issuecomment-2638689175
Ironically, installing `Flask==2.0.2` would solve the Flask issue despite creating conflicts with packages versions...
Can anyone explain this?
--
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] Flask Application Not Found After Upgrading from Python 3.6 and Apache Superset 0.38.1 to Python 3.10 and Superset 4.1.1 [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #32140: Flask Application Not Found After Upgrading from Python 3.6 and Apache Superset 0.38.1 to Python 3.10 and Superset 4.1.1
URL: https://github.com/apache/superset/issues/32140
--
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] Flask Application Not Found After Upgrading from Python 3.6 and Apache Superset 0.38.1 to Python 3.10 and Superset 4.1.1 [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #32140:
URL: https://github.com/apache/superset/issues/32140#issuecomment-3942610753
Closing as the reporter confirmed the upgrade was successful. Thanks for the follow-up, @bondany!
--
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