From 8390120be85cc64c49a524496671e21d0f5474f5 Mon Sep 17 00:00:00 2001 From: wayne warren Date: Wed, 4 Sep 2024 17:59:44 -0600 Subject: [PATCH] fix(clustered): document the use of special symbols PostgeSQL connection strings --- .../install/configure-cluster/directly.md | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/content/influxdb/clustered/install/configure-cluster/directly.md b/content/influxdb/clustered/install/configure-cluster/directly.md index 7282cc615..582dda5aa 100644 --- a/content/influxdb/clustered/install/configure-cluster/directly.md +++ b/content/influxdb/clustered/install/configure-cluster/directly.md @@ -544,9 +544,38 @@ We recommend storing sensitive credentials, such as your PostgreSQL-compatible D as secrets in your Kubernetes cluster. {{% /note %}} -- `spec.package.spec.catalog.dsn.valueFrom.secretKeyRef` - - `.name`: Secret name - - `.key`: Key in the secret that contains the DSN +{{% warn %}} +PostgreSQL DSNs that contain special symbols may need to be percent-encoded in +order to be parsed correctly by InfluxDB Clustered. This is particularly +important to keep in mind when dealing with DSNs containing auto-generated +passwords provided by cloud database providers which may automatically include +special symbols in order to make their passwords harder to guess. + +For example, the following DSN used in InfluxDB Clustered: +``` +postgresql://postgres:meow#meow@my-fancy.cloud-database.party:5432/postgres +``` + +Would result in error logs that look like: + +``` +Catalog DSN error: A catalog error occurred: unhandled external error: error with configuration: invalid port number +``` + +To fix this, the connection string would have to have the password (or any +other part such as options) percent-encoded like so: + +``` +postgresql://postgres:meow%23meow@my-fancy.cloud-database.party:5432/postgres +``` + +For more information, see the [PostgreSQL Connection URI +docs](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING-URIS). +{{% /warn %}} + +- [ ] `spec.package.spec.catalog.dsn.valueFrom.secretKeyRef` + - [ ] `.name`: Secret name + - [ ] `.key`: Key in the secret that contains the DSN {{% code-placeholders "SECRET_(NAME|KEY)" %}}