Bug description

use helm chart . loded your LOCAL configuration at [/app/pythonpath/superset_config.py] 2025-09-02 13:38:46,517:ERROR:superset.app:Failed to create app Traceback (most recent call last): File "/app/superset/app.py", line 69, in create_app app_initializer.init_app() File "/app/superset/initialization/init.py", line 671, in init_app self.setup_db() File "/app/superset/initialization/init.py", line 868, in setup_db pessimistic_connection_handling(db.engine) File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/init.py", line 998, in engine return self.get_engine() File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/init.py", line 1017, in get_engine return connector.get_engine() File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/init.py", line 594, in get_engine self._engine = rv = self._sa.create_engine(sa_url, options) File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/init.py", line 1027, in create_engine return sqlalchemy.create_engine(sa_url, engine_opts) File "", line 2, in create_engine File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/util/deprecations.py", line 375, in warned return fn(*args, kwargs) File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 544, in create_engine dbapi = dialect_cls.dbapi(dbapi_args) File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 811, in dbapi import psycopg2 ModuleNotFoundError: No module named 'psycopg2' Usage: celery [OPTIONS] COMMAND [ARGS]... Try 'celery --help' for help. Error: Unable to load celery application. While trying to load the module superset.tasks.celery_app:app the following error occurred: Traceback (most recent call last): File "/app/.venv/lib/python3.10/site-packages/celery/bin/celery.py", line 141, in celery app = find_app(app) File "/app/.venv/lib/python3.10/site-packages/celery/app/utils.py", line 383, in find_app sym = symbol_by_name(app, imp=imp) File "/app/.venv/lib/python3.10/site-packages/kombu/utils/imports.py", line 59, in symbol_by_name module = imp(module_name, package=package, kwargs) File "/app/.venv/lib/python3.10/site-packages/celery/utils/imports.py", line 109, in import_from_cwd return imp(module, package=package) File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/app/superset/tasks/celery_app.py", line 32, in flask_app = create_app() File "/app/superset/app.py", line 69, in create_app app_initializer.init_app() File "/app/superset/initialization/init.py", line 671, in init_app self.setup_db() File "/app/superset/initialization/init.py", line 868, in setup_db pessimistic_connection_handling(db.engine) File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/init.py", line 998, in engine return self.get_engine() File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/init.py", line 1017, in get_engine return connector.get_engine() File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/init.py", line 594, in get_engine self._engine = rv = self._sa.create_engine(sa_url, options) File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/init.py", line 1027, in create_engine return sqlalchemy.create_engine(sa_url, engine_opts) File "", line 2, in create_engine File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/util/deprecations.py", line 375, in warned return fn(*args, kwargs) File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 544, in create_engine dbapi = dialect_cls.dbapi(**dbapi_args) File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 811, in dbapi import psycopg2 [ModuleNotFoundError: No module named 'psycopg2']

this is values.yaml values.yaml

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.9

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.

Comment From: worldofchu

and i use

-- Extra environment variables that will be passed into pods

extraEnv: SUPERSET_APP_ROOT: "/superset"

Comment From: dosubot[bot]

Setting SUPERSET_APP_ROOT in extraEnv is fine for subpath deployments and does not cause the psycopg2 error. The ModuleNotFoundError: No module named 'psycopg2' happens because the default Superset Docker image used by the Helm chart does not include database drivers like psycopg2. To fix this, you need to either use a custom image that includes psycopg2, use a "-dev" tagged image (which includes common drivers), or add installation commands to the bootstrapScript in your values.yaml. For production, building your own image with psycopg2 installed is the recommended approach. See the Helm chart and Docker image docs for more details: Helm values.yaml, Docker image docs.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

Comment From: rusackas

Bot is correct... closing :)