You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "thatguyatgithub (via GitHub)" <gi...@apache.org> on 2025/09/17 12:43:28 UTC
[I] superset helm chart broken [superset]
thatguyatgithub opened a new issue, #35174:
URL: https://github.com/apache/superset/issues/35174
### Bug description
When using bring your own DB, the superset-init-db k8s main job breaks under this error:
```pgrading DB schema...
Loaded your LOCAL configuration at [/app/pythonpath/superset_config.py]
2025-09-17 12:41:33,296:ERROR:superset.app:Failed to create app
Traceback (most recent call last):
File "/app/.venv/lib/python3.10/site-packages/superset/app.py", line 40, in create_app
app_initializer.init_app()
[...]
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1685, in invoke
super().invoke(ctx)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 355, in decorator
app = __ctx.ensure_object(ScriptInfo).load_app()
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 309, in load_app
app = locate_app(import_name, name)
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 238, in locate_app
return find_app_by_string(module, app_name)
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 166, in find_app_by_string
app = attr(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/superset/app.py", line 40, in create_app
app_initializer.init_app()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 466, in init_app
self.setup_db()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 662, 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 "<string>", 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'```
### 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.
--
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 helm 0.15.0 chart broken [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #35174: superset helm 0.15.0 chart broken
URL: https://github.com/apache/superset/issues/35174
--
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 helm 0.15.0 chart broken [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #35174:
URL: https://github.com/apache/superset/issues/35174#issuecomment-3303906607
@villebro we keep seeing issues like this arise. Any idea how to resolve this more permanently? Tempted to bump these to Discussions when they arise, but clearly it's a recurring issue.
--
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 helm 0.15.0 chart broken [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #35174:
URL: https://github.com/apache/superset/issues/35174#issuecomment-3302817851
<!-- Greeting -->
Hi @thatguyatgithub! I'm [Dosu](https://go.dosu.dev/dosubot) and Iām helping the superset team.
<!-- Answer -->
This is a known issue: the default Superset Docker image used by the Helm chart does not include database drivers like psycopg2, which are required to connect to external PostgreSQL databases. You have a few options to resolve this:
1. **Add a bootstrapScript to your Helm values.yaml** to install psycopg2-binary and its system dependencies at container startup. For Superset v5 and newer (which use `uv` as the Python package manager), use:
```yaml
bootstrapScript: |
#!/bin/bash
apt update && apt install -y gcc libpq-dev python3-dev pkg-config
uv pip install psycopg2-binary
```
[Reference](https://github.com/apache/superset/discussions/34109)
For older versions, replace `uv pip install` with `pip install`.
2. **Use a custom Docker image** that pre-installs psycopg2-binary and any other required drivers. This is recommended for production deployments. Example Dockerfile:
```dockerfile
FROM apache/superset:latest
RUN pip install --no-cache-dir psycopg2-binary
```
[Reference](https://github.com/apache/superset/issues/33945)
3. **Use the `-dev` tagged Superset image** (e.g., `apache/superset:latest-dev`), which includes common database drivers by default. [Reference](https://github.com/apache/superset/issues/32217)
Make sure you also disable the internal PostgreSQL by setting `postgresql.enabled: false` in your values.yaml when using an external DB, and provide your DB connection details under `supersetNode.connections` (do not set `SQLALCHEMY_DATABASE_URI` directly) [Reference](https://github.com/apache/superset/issues/33945).
This approach should resolve the `ModuleNotFoundError: No module named 'psycopg2'` in your Helm-based deployment.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback/fa259a3f-71c2-48b6-a4e1-d3073eb7c148?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/fa259a3f-71c2-48b6-a4e1-d3073eb7c148?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/fa259a3f-71c2-48b6-a4e1-d3073eb7c148?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/fa259a3f-71c2-48b6-a4e1-d3073eb7c148?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/fa259a3f-71c2-48b6-a4e1-d3073eb7c148?feedback_type=hallucination) | [Report š](https://app.dosu.dev/response-feedback/fa259a3f-71c2-48b6-a4e1-d3073eb7c148?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/fa259a3f-71c2-48b6-a4e1-d3073eb7c148?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu
b) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/35174)
--
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 helm 0.15.0 chart broken [superset]
Posted by "ataquino (via GitHub)" <gi...@apache.org>.
ataquino commented on issue #35174:
URL: https://github.com/apache/superset/issues/35174#issuecomment-4305998391
Did you find any solution to this, @NiklasRosenstein ? Getting this error now after upgrading to 0.15.2 and setting the redis and postgres images to the legacy bitnami repository. `bootstrapScript` doesn't solve it since the error is in the init-db pod, as you showed.
--
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 helm 0.15.0 chart broken [superset]
Posted by "NiklasRosenstein (via GitHub)" <gi...@apache.org>.
NiklasRosenstein commented on issue #35174:
URL: https://github.com/apache/superset/issues/35174#issuecomment-3485506079
I'm also running into this issue. And to @rusackas point, I've run into it before two years ago already: https://github.com/apache/superset/issues/23577 (note how I had to install `psycopg2` in the `bootstrapScript`).
I get this error not when connecting to an external database. It seems reasonable to require installing additional drivers in some way explicitly for various reasons (e.g. license, image bloat, maintenance, etc.)
The error appears with a pretty vanilla installation of the superset Helm chart when it tries to connect to _it's own Postgres DB_. We're looking to evaluate Superset against other (some not open source) competitors in the space, but this doesn't exactly inspire confidence in the project unfortunately.
```yaml
# helmfile.yaml
repositories:
- name: superset
url: https://apache.github.io/superset
releases:
- name: superset
namespace: superset
chart: superset/superset
version: "0.15.0"
values:
# Bitnami has moved their container images behind a paywall. The Superset Helm charts have not been updated yet.
# See https://github.com/apache/superset/issues/34414#issuecomment-3307806333
- postgresql:
image:
repository: bitnamilegacy/postgresql
redis:
image:
repository: bitnamilegacy/redis
- configOverrides:
secret: |
SECRET_KEY = 'CHANGE_ME_TO_A_SECRET'
```
--
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 helm 0.15.0 chart broken [superset]
Posted by "antoniordz96 (via GitHub)" <gi...@apache.org>.
antoniordz96 commented on issue #35174:
URL: https://github.com/apache/superset/issues/35174#issuecomment-3721694761
Hey so we build our own custom image and install `psycopg2-binary` but it seems it is still failing. Doing a pip list inside the container i can confirm i see `psycopg2-binary`
```bash
superset@asce-superset-85f7bc9cb-2xlxx:/app$ pip list
Package Version
-------------------------------- -----------
MarkupSafe 3.0.3
marshmallow 4.2.0
marshmallow-sqlalchemy 1.4.2
mdurl 0.1.2
msgpack 1.0.8
msgspec 0.20.0
nh3 0.2.22
numpy 1.26.4
odfpy 1.4.1
openpyxl 3.1.5
ordered-set 4.1.0
outcome 1.3.0.post0
packaging 25.0
pandas 2.0.3
paramiko 4.0.0
parsedatetime 2.6
pgsanity 0.3.0
pillow 12.1.0
pip 25.3
platformdirs 4.5.1
playwright 1.52.0
ply 3.11
polyline 2.0.4
prison 0.2.1
prompt_toolkit 3.0.52
psycopg2-binary 2.9.10
pyarrow 14.0.2
pyasn1 0.6.1
pyasn1_modules 0.4.2
pycparser 2.23
pydynamodb 0.8.0
pyee 13.0.0
Pygments 2.19.2
PyJWT 2.10.1
PyNaCl 1.6.2
pyOpenSSL 25.1.0
pyparsing 3.3.1
PySocks 1.7.1
python-dateutil 2.9.0.post0
python-dotenv 1.2.1
python-geohash 0.8.5
pytz 2025.2
pyxlsb 1.0.10
PyYAML 6.0.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 helm 0.15.0 chart broken [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #35174:
URL: https://github.com/apache/superset/issues/35174#issuecomment-5124098375
Since this keeps recurring (same root cause as #23577 from a couple years back) and it's really a deployment/docs gap rather than a Superset code bug, I'm going to move this to a Discussion. Think the actual fix here is a clear doc note in the helm chart README about installing the right DB driver via `bootstrapScript` for BYODB setups, happy to review a PR for that if someone wants to take it.
--
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