Bug description

while deploying superset in production throwing this issue. can anyone please suggest. as per official documentaion i follwed steps Step1; helm repo add superset https://apache.github.io/superset step2: helm search repo superset kubectl get pods -n superset

step3: my-values.yaml

Disable Superset's internal PostgreSQL

postgresql: enabled: false

External PostgreSQL (secret used for password)

externalDatabase: type: postgresql host: host port: 5432 database: superset user: sspsqladmin existingSecret: superset-db-secret existingSecretPasswordKey: db-password

Superset config override — don't define SQLALCHEMY_DATABASE_URI directly

configOverrides: superset_config.py: | ENABLE_PROXY_FIX = True SECRET_KEY = 'OG6tANx8xP8QAo9sabJAwUAjUs2OO7hEPmTqjgxqnj5TnjLouQP1tULQ'

Bootstrap script

bootstrapScript: | #!/bin/bash pip install psycopg2-binary

Add DB_HOST/DB_PORT to all relevant containers

supersetNode: extraEnv: - name: DB_HOST value: appsqlsscind01.private.postgres.database.azure.com - name: DB_PORT value: "5432"

worker: extraEnv: - name: DB_HOST value: appsqlsscind01.private.postgres.database.azure.com - name: DB_PORT value: "5432"

init: extraPipPackages: - psycopg2-binary createAdmin: true adminUser: username: admin firstname: Superset lastname: Admin email: kranthik@gmail.com password: C@reS0ft loadExamples: false extraEnv: - name: DB_HOST value: appsqlsscind01.private.postgres.database.azure.com - name: DB_PORT value: "5432"

Optional: override the wait-for-postgres command

initContainer: enabled: true command: - "/bin/sh" - "-c" - | echo "Waiting for PostgreSQL at $DB_HOST:$DB_PORT..." until nc -z $DB_HOST $DB_PORT; do echo "Waiting..."; sleep 2; done echo "PostgreSQL is available."

Resources

resources: limits: memory: 2Gi cpu: 1000m requests: memory: 1Gi cpu: 500m

step4: helm upgrade --install --values my-values.yaml superset superset/superset

getting below error why i am trying last 15 days please support for production setup

Image

NAME READY STATUS RESTARTS AGE superset-6ff6664876-mfzt7 0/1 CrashLoopBackOff 6 (4m20s ago) 10m superset-init-db-dbbc6 0/1 Error 0 10m superset-init-db-dt4dm 0/1 Error 0 8m47s superset-init-db-rz4t7 0/1 Error 0 9m31s superset-init-db-t8qt6 0/1 Error 0 9m55s superset-init-db-tcqxr 0/1 Error 0 7m22s superset-init-db-thf29 0/1 Error 0 4m38s superset-postgresql-0 1/1 Running 0 10m superset-redis-master-0 1/1 Running 0 10m superset-worker-7b8848c7f6-z5zf5 0/1 CrashLoopBackOff 6 (4m27s ago) 10m

s

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

unable set production configuration and Run application in Azure kubernates , i followed same steps suggested in https://superset.apache.org/docs/installation/kubernetes but facing pod crash error , can anyone please suggest how to set up production configuration.

here i am using my own postgre external db .

postgresql: postgresqlPassword: superset

env: SECRET_KEY: "00WXgWApvGRzGmKtM8FulkT_Wgxi6hwvSyPUpOzWozJjfaKr-ZM356tMyFifZNILN-luOQwyBWjJBGDw3QqL-Q"

configOverrides: superset_config.py: | PREVIOUS_SECRET_KEY = 'OG6tANx8xP8QAo9sabJAwUAjUs2OO7hEPmTqjgxqnj5TnjLouQP1tULQ' SECRET_KEY = '00WXgWApvGRzGmKtM8FulkT_Wgxi6hwvSyPUpOzWozJjfaKr-ZM356tMyFifZNILN-luOQwyBWjJBGDw3QqL-Q' from flask_caching import Cache

Error :

kubectl get pods -n superset NAME READY STATUS RESTARTS AGE superset-6ff6664876-mfzt7 0/1 CrashLoopBackOff 6 (4m20s ago) 10m superset-init-db-dbbc6 0/1 Error 0 10m superset-init-db-dt4dm 0/1 Error 0 8m47s superset-init-db-rz4t7 0/1 Error 0 9m31s superset-init-db-t8qt6 0/1 Error 0 9m55s superset-init-db-tcqxr 0/1 Error 0 7m22s superset-init-db-thf29 0/1 Error 0 4m38s superset-postgresql-0 1/1 Running 0 10m

i want to add my own postgre as external db please suggest for production setup superset-redis-master-0 1/1 Running 0 10m superset-worker-7b8848c7f6-z5zf5 0/1 CrashLoopBackOff 6 (4m27s ago) 10m RESULTS_BACKEND = Cache( config={ 'CACHE_TYPE': 'RedisCache', 'CACHE_DEFAULT_TIMEOUT': 300, 'CACHE_KEY_PREFIX': 'superset_results', 'CACHE_REDIS_URL': 'redis://superset-redis-master:6379/0' } )

init: command: - /bin/sh - -c - | pip install redis psycopg2-binary . /app/pythonpath/superset_bootstrap.sh superset re-encrypt-secrets . /app/pythonpath/superset_init.sh

image: repository: preset/superset tag: latest-python3.9

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.

Comment From: dosubot[bot]

Your Helm config is close, but there are a few common issues that can cause CrashLoopBackOff and init-db errors with external PostgreSQL on Azure:

  1. Make sure the Kubernetes secret superset-db-secret exists in your namespace and contains the db-password key with the correct value. If the secret or key is missing or misnamed, Superset can't connect to the DB and pods will fail to start (source).

  2. Only use one configOverrides section in your values.yaml. Multiple configOverrides blocks will break the YAML and cause incomplete config, leading to pod failures (source).

  3. For external PostgreSQL, you must install system dependencies (gcc, libpq-dev, python3-dev, pkg-config) and psycopg2-binary in your bootstrapScript. Just pip install psycopg2-binary is often not enough—add the apt install line as well (source):

yaml bootstrapScript: | #!/bin/bash apt update && apt install -y gcc libpq-dev python3-dev pkg-config pip install psycopg2-binary

  1. Azure PostgreSQL usually requires SSL. If so, you need to add ?sslmode=require to your connection string. The Helm chart builds SQLALCHEMY_DATABASE_URI from env vars, so set DB_EXTRA_ARGS or use the externalDatabase.extraArgs field if available, or override with configOverrides if needed (source).

  2. Check pod logs with kubectl logs for the actual error—this will tell you if it's a DB connection, missing dependency, or something else (source).

  3. If you see timeouts, try increasing your Helm install/upgrade timeout: --timeout 10m0s (source).

If you still have issues, please share the output of kubectl logs for the failing pods—this will help pinpoint the root cause.

To reply, just mention @dosu.


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

Comment From: Kranthi32

still i am facing issue , i am using this yaml but still facing same issue .please support

Disable internal PostgreSQL

postgresql: enabled: false

Use external PostgreSQL with direct password

externalDatabase: type: postgresql host: appsqlsscind10.postgres.database.azure.com port: 5432 database: superset user: adminusr password: P@$$w0rd'
extraArgs: "?sslmode=require"

Superset config overrides (ONLY ONE BLOCK!)

configOverrides: superset_config.py: | ENABLE_PROXY_FIX = True SECRET_KEY = 'OG6tANx8xP8QAo9sabJAwUAjUs2OO7hEPmTqjgxqnj5TnjLouQP1tULQ' from flask_caching import Cache RESULTS_BACKEND = Cache( config={ 'CACHE_TYPE': 'RedisCache', 'CACHE_DEFAULT_TIMEOUT': 300, 'CACHE_KEY_PREFIX': 'superset_results', 'CACHE_REDIS_URL': 'redis://superset-redis-master:6379/0' } )

Bootstrap to install system packages

bootstrapScript: | #!/bin/bash apt update && apt install -y gcc libpq-dev python3-dev pkg-config pip install psycopg2-binary

Init configuration

init: extraPipPackages: - psycopg2-binary createAdmin: true adminUser: username: admin firstname: Superset lastname: Admin email: kranthik@gmail.com password: C@reS0ft loadExamples: false extraEnv: - name: DB_HOST value: appsqlsscind01.private.postgres.database.azure.com - name: DB_PORT value: "5432"

PostgreSQL wait logic

initContainer: enabled: true command: - "/bin/sh" - "-c" - | echo "Waiting for PostgreSQL at $DB_HOST:$DB_PORT..." until nc -z $DB_HOST $DB_PORT; do echo "Waiting..."; sleep 2; done echo "PostgreSQL is available."

DB host/port in containers

supersetNode: extraEnv: - name: DB_HOST value: appsqlsscind01.private.postgres.database.azure.com - name: DB_PORT value: "5432"

worker: extraEnv: - name: DB_HOST value: appsqlsscind01.private.postgres.database.azure.com - name: DB_PORT value: "5432"

resources: limits: memory: 2Gi cpu: 1000m requests: memory: 1Gi cpu: 500m

Image

log:

kubectl logs superset-init-db-9dfrj -n default -c superset-init-db Found but failed to import local superset_config Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/flask_caching/backends/rediscache.py", line 57, in init import redis ModuleNotFoundError: No module named 'redis'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/app/superset/config.py", line 956, in import superset_config # pylint: disable=import-error File "/app/pythonpath/superset_config.py", line 39, in key_prefix='superset_results', File "/usr/local/lib/python3.7/site-packages/flask_caching/backends/rediscache.py", line 59, in init raise RuntimeError("no redis module found") RuntimeError: no redis module found Failed to create app Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/flask_caching/backends/rediscache.py", line 57, in init import redis ModuleNotFoundError: No module named 'redis'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/app/superset/app.py", line 59, in create_app app.config.from_object(config_module) File "/usr/local/lib/python3.7/site-packages/flask/config.py", line 174, in from_object obj = import_string(obj) File "/usr/local/lib/python3.7/site-packages/werkzeug/utils.py", line 568, in import_string import(import_name) File "/app/superset/config.py", line 956, in import superset_config # pylint: disable=import-error File "/app/pythonpath/superset_config.py", line 39, in key_prefix='superset_results', File "/usr/local/lib/python3.7/site-packages/flask_caching/backends/rediscache.py", line 59, in init raise RuntimeError("no redis module found") RuntimeError: no redis module found Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/flask_caching/backends/rediscache.py", line 57, in init import redis ModuleNotFoundError: No module named 'redis'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/bin/superset", line 33, in sys.exit(load_entry_point('apache-superset', 'console_scripts', 'superset')()) File "/usr/local/lib/python3.7/site-packages/click/core.py", line 829, in call return self.main(args, kwargs) File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 586, in main return super(FlaskGroup, self).main(args, **kwargs) File "/usr/local/lib/python3.7/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1254, in invoke cmd_name, cmd, args = self.resolve_command(ctx, args) File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1297, in resolve_command cmd = self.get_command(ctx, cmd_name) File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 542, in get_command rv = info.load_app().cli.get_command(ctx, name) File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 381, in load_app app = call_factory(self, self.create_app) File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 119, in call_factory return app_factory() File "/app/superset/app.py", line 69, in create_app raise ex File "/app/superset/app.py", line 59, in create_app app.config.from_object(config_module) File "/usr/local/lib/python3.7/site-packages/flask/config.py", line 174, in from_object obj = import_string(obj) File "/usr/local/lib/python3.7/site-packages/werkzeug/utils.py", line 568, in import_string import(import_name) File "/app/superset/config.py", line 956, in import superset_config # pylint: disable=import-error File "/app/pythonpath/superset_config.py", line 39, in key_prefix='superset_results', File "/usr/local/lib/python3.7/site-packages/flask_caching/backends/rediscache.py", line 59, in init raise RuntimeError("no redis module found") RuntimeError: no redis module found Upgrading DB schema... Found but failed to import local superset_config Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/flask_caching/backends/rediscache.py", line 57, in init import redis ModuleNotFoundError: No module named 'redis'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/app/superset/config.py", line 956, in import superset_config # pylint: disable=import-error File "/app/pythonpath/superset_config.py", line 39, in key_prefix='superset_results', File "/usr/local/lib/python3.7/site-packages/flask_caching/backends/rediscache.py", line 59, in init raise RuntimeError("no redis module found") RuntimeError: no redis module found Failed to create app Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/flask_caching/backends/rediscache.py", line 57, in init import redis ModuleNotFoundError: No module named 'redis'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/app/superset/app.py", line 59, in create_app app.config.from_object(config_module) File "/usr/local/lib/python3.7/site-packages/flask/config.py", line 174, in from_object obj = import_string(obj) File "/usr/local/lib/python3.7/site-packages/werkzeug/utils.py", line 568, in import_string import(import_name) File "/app/superset/config.py", line 956, in import superset_config # pylint: disable=import-error File "/app/pythonpath/superset_config.py", line 39, in key_prefix='superset_results', File "/usr/local/lib/python3.7/site-packages/flask_caching/backends/rediscache.py", line 59, in init raise RuntimeError("no redis module found") RuntimeError: no redis module found Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/flask_caching/backends/rediscache.py", line 57, in init import redis ModuleNotFoundError: No module named 'redis'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/bin/superset", line 33, in sys.exit(load_entry_point('apache-superset', 'console_scripts', 'superset')()) File "/usr/local/lib/python3.7/site-packages/click/core.py", line 829, in call return self.main(args, kwargs) File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 586, in main return super(FlaskGroup, self).main(args, kwargs) File "/usr/local/lib/python3.7/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1256, in invoke Command.invoke(self, ctx) File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, ctx.params) File "/usr/local/lib/python3.7/site-packages/click/core.py", line 610, in invoke return callback(args, kwargs) File "/usr/local/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func return f(get_current_context(), args, **kwargs) File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 425, in decorator with ctx.ensure_object(ScriptInfo).load_app().app_context(): File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 381, in load_app app = call_factory(self, self.create_app) File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 119, in call_factory return app_factory() File "/app/superset/app.py", line 69, in create_app raise ex File "/app/superset/app.py", line 59, in create_app app.config.from_object(config_module) File "/usr/local/lib/python3.7/site-packages/flask/config.py", line 174, in from_object obj = import_string(obj) File "/usr/local/lib/python3.7/site-packages/werkzeug/utils.py", line 568, in import_string __import(import_name) File "/app/superset/config.py", line 956, in import superset_config # pylint: disable=import-error File "/app/pythonpath/superset_config.py", line 39, in key_prefix='superset_results', File "/usr/local/lib/python3.7/site-packages/flask_caching/backends/rediscache.py", line 59, in init raise RuntimeError("no redis module found") RuntimeError: no redis module found

Comment From: dosubot[bot]

The error happens because the redis Python module is missing in your running containers. Installing it at runtime with bootstrapScript or extraPipPackages is unreliable for production—these only affect some pods and not always before the app starts, so you get ModuleNotFoundError and CrashLoopBackOff.

The robust solution is to build a custom Docker image that includes all required Python dependencies (like redis and psycopg2-binary) ahead of time. This ensures every Superset pod (web, worker, init) has what it needs at startup, and is the recommended approach for production deployments with Helm reference.

Here’s how you can do it:

  1. Create a Dockerfile based on your current image (e.g., preset/superset:latest-python3.9):

dockerfile FROM preset/superset:latest-python3.9 RUN pip install --no-cache-dir redis psycopg2-binary

  1. Build and push your image to your registry (Docker Hub, Azure Container Registry, etc):

sh docker build -t <your-registry>/superset-custom:latest . docker push <your-registry>/superset-custom:latest

  1. Update your Helm values.yaml to use your custom image:

yaml image: repository: <your-registry>/superset-custom tag: latest

  1. Remove pip install lines for redis/psycopg2-binary from bootstrapScript and extraPipPackages, since they’re now in the image.

  2. Redeploy with Helm. All pods should now start without the redis module error.

This approach is reliable and matches best practices for production reference. If you need to add more Python packages in the future, just update your Dockerfile and repeat the build/push steps.

Let me know if you need a more detailed example or run into any issues with the custom image build!

To reply, just mention @dosu.


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

Comment From: martimors

I hope those secrets you posted weren't actually used in production

Comment From: Kranthi32

first step getting issue

docker build -t superset-custom:3.9 . [+] Building 1.7s (2/2) FINISHED docker:desktop-linux => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 128B 0.0s => ERROR [internal] load metadata for docker.io/preset/superset:latest-python3.9 1.5s


> [internal] load metadata for docker.io/preset/superset:latest-python3.9:

Dockerfile:1

1 | >>> FROM preset/superset:latest-python3.9 2 | RUN pip install --no-cache-dir redis psycopg2-binary


ERROR: failed to solve: preset/superset:latest-python3.9: failed to resolve source metadata for docker.io/preset/superset:latest-python3.9: docker.io/preset/superset:latest-python3.9: not found

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/toi36vsceb2imk9ggmjkpbifi

Comment From: Kranthi32

@martimors @dosu i am using this yaml but its connecting internal db only any changes required in my yaml fille

Use your custom Superset image (includes redis & psycopg2-binary)

image: repository: reddy2210/superset-custom tag: 4.1.2

Use internal Redis for caching (bitnami/redis enabled by Helm)

redis: enabled: true auth: enabled: false

Disable internal PostgreSQL

postgresql: enabled: false

Use external Azure PostgreSQL

externalDatabase: type: postgresql host: appsqlsscind01.private.postgres.database.azure.com port: 5432 database: superset user: sspsqladmin password: 'Password123' extraArgs: "?sslmode=require"

Inject secret key properly

extraSecretEnv: SUPERSET_SECRET_KEY: 'OG6tANx8xP8QAo9sabJAwUAjUs2OO7hEPmTqjgxqnj5TnjLouQP1tULQ'

Superset config overrides (only one block)

configOverrides: superset_config.py: | ENABLE_PROXY_FIX = True from flask_caching import Cache RESULTS_BACKEND = Cache( config={ 'CACHE_TYPE': 'RedisCache', 'CACHE_DEFAULT_TIMEOUT': 300, 'CACHE_KEY_PREFIX': 'superset_results', 'CACHE_REDIS_URL': 'redis://superset-redis-master:6379/0' } )

Init configuration

init: createAdmin: true adminUser: username: admin firstname: Superset lastname: Admin email: kranthik@gmail.com password: C@reS0ft loadExamples: false

Init container waits for external DB (use hardcoded DNS here)

initContainer: enabled: true command: - "/bin/sh" - "-c" - | echo "Waiting for PostgreSQL at $DB_HOST:$DB_PORT..." until nc -z $DB_HOST $DB_PORT; do echo "Waiting..."; sleep 2; done echo "PostgreSQL is available."

Make sure these env vars are passed to all components

supersetNode: extraEnv: - name: DB_HOST value: appsqlsscind01.private.postgres.database.azure.com - name: DB_PORT value: "5432"

worker: extraEnv: - name: DB_HOST value: appsqlsscind01.private.postgres.database.azure.com - name: DB_PORT value: "5432"

init: extraEnv: - name: DB_HOST value: appsqlsscind01.private.postgres.database.azure.com - name: DB_PORT value: "5432"

Comment From: dosubot[bot]

The reason Superset is still connecting to the internal database is that the Helm chart does not use the externalDatabase block for its connection settings. Instead, it builds the database connection URI from the supersetNode.connections.* fields (db_host, db_port, db_user, db_pass, db_name) and not from extraEnv or externalDatabase. If you don’t set these fields, it defaults to the internal DB—even if you disable postgresql.enabled.

To fix this, add the following to your values.yaml (replace with your actual Azure DB values):

supersetNode:
  connections:
    db_host: appsqlsscind01.private.postgres.database.azure.com
    db_port: "5432"
    db_user: sspsqladmin
    db_pass: Password123?sslmode=require
    db_name: superset

You can remove the externalDatabase block—it is ignored by the chart. Make sure you do not set SQLALCHEMY_DATABASE_URI directly anywhere else. After updating, redeploy with Helm and check pod logs to confirm Superset is using your external DB.

Reference: Helm chart values and connection logic, Helm chart template for SQLALCHEMY_DATABASE_URI

To reply, just mention @dosu.


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

Comment From: rusackas

Moving this to a Q&A/Help Discussion, but as others said, if those are your real keys you posted here, you MIGHT want to change those now :)