GitHub user dosubot[bot] added a comment to the discussion: Production deployment issue in
<!-- Answer --> The error `(psycopg2.OperationalError) could not translate host name "[email protected]"` means your DB password or username contains special characters (like @, $, etc.) that are not URI-encoded. Superset builds the connection string as `postgresql+psycopg2://{DB_USER}:{DB_PASS}@{DB_HOST}:{DB_PORT}/{DB_NAME}` and does not encode these fields, so special characters break the URI and cause this error. You must percent-encode (URI-encode) your credentials before putting them in your values.yaml or Kubernetes Secret. For example, `@` becomes `%40`, `$` becomes `%24`, etc. You can use an online tool like [https://www.urlencoder.org/](https://www.urlencoder.org/) to encode your password, then update your values.yaml with the encoded string ([reference](https://github.com/apache/superset/blob/1a54b761c1870e61296e4af4da56dedf23b5e8e8/helm/superset/templates/_helpers.tpl)). The CSP warning is informational and about browser security. To configure CSP, add this to your `superset_config.py`: ```python TALISMAN_ENABLED = True TALISMAN_CONFIG = { "content_security_policy": { "default-src": ["'self'"], "img-src": ["'self'", "data:", "blob:"], # add other directives as needed } } ``` If you want to suppress the warning instead, add `CONTENT_SECURITY_POLICY_WARNING = False` ([example](https://github.com/apache/superset/issues/33207)). For the cache warnings: Superset uses the built-in DB cache for `FILTER_STATE_CACHE_CONFIG` and `EXPLORE_FORM_DATA_CACHE_CONFIG` unless you explicitly set them to use Redis. Add this to your `superset_config.py` (in addition to your `RESULTS_BACKEND`): ```python FILTER_STATE_CACHE_CONFIG = { "CACHE_TYPE": "RedisCache", "CACHE_DEFAULT_TIMEOUT": 300, "CACHE_KEY_PREFIX": "superset_filter_state", "CACHE_REDIS_URL": "redis://superset-redis-master:6379/0" } EXPLORE_FORM_DATA_CACHE_CONFIG = { "CACHE_TYPE": "RedisCache", "CACHE_DEFAULT_TIMEOUT": 300, "CACHE_KEY_PREFIX": "superset_explore_form", "CACHE_REDIS_URL": "redis://superset-redis-master:6379/0" } ``` This ensures all caches use Redis, not the metadata DB ([reference](https://github.com/apache/superset/blob/1a54b761c1870e61296e4af4da56dedf23b5e8e8/superset/config.py)). Finally, always inject secrets (like DB passwords) using Kubernetes Secrets and Helm's `extraSecretEnv` or `envFromSecret` fields, not hardcoded in values.yaml. But remember: you must encode special characters yourself before storing them in the secret ([reference](https://github.com/apache/superset/blob/1a54b761c1870e61296e4af4da56dedf23b5e8e8/helm/superset/templates/secret-env.yaml)). After making these changes, redeploy and your DB connection and cache warnings should be resolved. <!-- 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/066106f8-b522-4c3e-9875-151d4370d2bb?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/066106f8-b522-4c3e-9875-151d4370d2bb?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/066106f8-b522-4c3e-9875-151d4370d2bb?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/066106f8-b522-4c3e-9875-151d4370d2bb?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/066106f8-b522-4c3e-9875-151d4370d2bb?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/066106f8-b522-4c3e-9875-151d4370d2bb?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/066106f8-b522-4c3e-9875-151d4370d2bb?feedback_type=other)</sup> [](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/discussions/33957) GitHub link: https://github.com/apache/superset/discussions/33957#discussioncomment-13600189 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
