Skip to content
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

Error while executing "superset db upgrade" #30548

Open
1 of 3 tasks
y2k3bikash opened this issue Oct 8, 2024 · 1 comment
Open
1 of 3 tasks

Error while executing "superset db upgrade" #30548

y2k3bikash opened this issue Oct 8, 2024 · 1 comment
Labels
install:config Installation - Configuration settings

Comments

@y2k3bikash
Copy link

Bug description

Python Version: 3.10
OS: Ubuntu
Superset: apache-superset

  1. Installed Virtual Environment

  2. Activated It

  3. pip install --upgrade pip setuptools wheel

  4. pip install apache-superset

  5. export FLASK_APP=superset

  6. export SUPERSET_CONFIG_PATH=/superset_vir/lib/python3.9/site-packages/superset/config.py

  7. Below Changes Done In Config.py:
    * update SECRET_KEY & SQLALCHEMY_DATABASE_URI(MySQL) as per the need .
    * Commented Below Line & Added Next 3 Lines:
    #override_conf = imp.load_source("superset_config", cfg_path)
    spec = importlib.util.spec_from_file_location("superset_config", cfg_path)
    override_conf = importlib.util.module_from_spec(spec)
    spec.loader.exec_module(override_conf)

  8. execute "superset db upgrade"

Got Below Error After That:

superset db upgrade

Failed to import config for SUPERSET_CONFIG_PATH=/superset_vir/lib/python3.10/site-packages/superset/config.py
Traceback (most recent call last):
File "/superset_vir/lib/python3.10/site-packages/superset/config.py", line 1708, in
module = sys.modules[name]
KeyError: 'superset_config'
Failed to import config for SUPERSET_CONFIG_PATH=/superset_vir/lib/python3.10/site-packages/superset/config.py
Traceback (most recent call last):
File "/superset_vir/lib/python3.10/site-packages/superset/config.py", line 1712, in
spec.loader.exec_module(override_conf)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/superset_vir/lib/python3.10/site-packages/superset/config.py", line 1708, in
module = sys.modules[name]
KeyError: 'superset_config'
Traceback (most recent call last):
File "/superset_vir/bin/superset", line 5, in
from superset.cli.main import superset
File "/superset_vir/lib/python3.10/site-packages/superset/cli/main.py", line 28, in
from superset.cli.lib import normalize_token
File "/superset_vir/lib/python3.10/site-packages/superset/cli/lib.py", line 20, in
from superset import config
File "/superset_vir/lib/python3.10/site-packages/superset/config.py", line 1712, in
spec.loader.exec_module(override_conf)
File "/superset_vir/lib/python3.10/site-packages/superset/config.py", line 1708, in
module = sys.modules[name]
KeyError: 'superset_config'

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.10

Node version

Not applicable

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.
@dosubot dosubot bot added the install:config Installation - Configuration settings label Oct 8, 2024
Copy link

dosubot bot commented Oct 8, 2024

Hey @y2k3bikash, I'm here to help you out with this! 😊

It seems like you're encountering an issue with the configuration loading in Apache Superset. Here are some steps and solutions that might help:

  1. Python Version Compatibility: There are known issues with using Python 3.10 for Superset. It's recommended to use Python 3.9 instead. You might want to create a new virtual environment with Python 3.9 and reinstall Superset.

  2. Configuration Path: Ensure that the SUPERSET_CONFIG_PATH is correctly set to the path of your custom superset_config.py file, not the default config.py in the site-packages directory.

  3. Importlib Util Usage: The error might be related to how the configuration is being loaded. Double-check the changes made in the config.py file. Ensure that the cfg_path variable is correctly pointing to your custom configuration file.

  4. Package Versions: If you continue to face issues, consider downgrading some packages as suggested in similar issues:

    • cryptography to version 38.0.2
    • Flask to version 2.1.0
    • Werkzeug to version 2.0.0
    • WTForms to version 2.3.3 [1].

These steps should help resolve the configuration loading issue.

To continue talking to Dosu, mention @dosu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
install:config Installation - Configuration settings
Projects
None yet
Development

No branches or pull requests

1 participant