Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection string parameters break the init container #10

Open
reknih opened this issue Apr 30, 2024 · 0 comments
Open

Connection string parameters break the init container #10

reknih opened this issue Apr 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@reknih
Copy link
Contributor

reknih commented Apr 30, 2024

Describe the bug

When connecting to an externally managed database over an encrypted connection, the parameters ?sslmode=require&ssl=true are necessary at the end of the connection string. However, when specifying them, the awk string replacement in the init script fails. This leads to the perpetually repeating error message pg_isready: error: invalid connection option "plausible_db?sslmode".

Version of Helm, Kubernetes and the plausible-analytics chart:

$ kubectl version  
Client Version: v1.29.1
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.28.5

$ helm version
version.BuildInfo{Version:"v3.13.2", GitCommit:"2a2fb3b98829f1e0be6fb18af2f6599e0f4e8243", GitTreeState:"clean", GoVersion:"go1.21.4"}

I used version 0.2.4 of the plausible-analytics chart

What happened:

Startup of plausible-analytics pods fails if the init-container is enabled.

What you expected to happen:

The connection string parameters should be honored in the wait-for-postgres script (or at least they should not be included in the database name). Connections to external databases forcing encryption should be possible.

How to reproduce it (as minimally and precisely as possible):

helm upgrade plausible imio/plausible-analytics --set "databaseURL=postgres://postgres:[email protected]:5432/plausible_db?sslmode=require&ssl=true,postgresql.enabled=false"

Anything else we need to know:

The error is here:

db=$(echo $info | awk -F[@:/] '{print $5}')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants