Skip to content

Postgres password authentication issue when Postgres Password contains special characters #15954

@albertkaluba

Description

@albertkaluba

Hello,

I have coder deployed to my kubernetes cluster using the Helm chart with an RDS postgres database. RDS currently handles password creation and rotation. I've noticed that when the postgres password has special characters, I get the following errors:

Started HTTP listener at http://0.0.0.0:8080
WARN: The access URL  http://localhost:8080  isn't externally reachable, this may cause unexpected problems when creating workspaces. Generate a unique *.try.coder.app URL by not specifying an access URL.

╔═══════════════════════════╗
║     View the Web UI:      ║
║   http://localhost:8080   ║
╚═══════════════════════════╝
2024-12-23 17:06:32.100 [warn]  ping postgres: retrying  error="pq: password authentication failed for user \"coder\""  try=1
2024-12-23 17:06:33.726 [warn]  ping postgres: retrying  error="pq: password authentication failed for user \"coder\""  try=2
2024-12-23 17:06:36.352 [warn]  ping postgres: retrying  error="pq: password authentication failed for user \"coder\""  try=3
2024-12-23 17:06:39.363 [warn]  ping postgres: retrying  error="pq: password authentication failed for user \"coder\""  try=4
2024-12-23 17:06:42.370 [warn]  ping postgres: retrying  error="pq: password authentication failed for user \"coder\""  try=5
2024-12-23 17:06:45.378 [warn]  ping postgres: retrying  error="pq: password authentication failed for user \"coder\""  try=6
2024-12-23 17:06:48.387 [warn]  ping postgres: retrying  error="pq: password authentication failed for user \"coder\""  try=7
2024-12-23 17:06:51.394 [warn]  ping postgres: retrying  error="pq: password authentication failed for user \"coder\""  try=8
2024-12-23 17:06:54.405 [warn]  ping postgres: retrying  error="pq: password authentication failed for user \"coder\""  try=9
2024-12-23 17:06:57.414 [warn]  ping postgres: retrying  error="pq: password authentication failed for user \"coder\""  try=10
2024-12-23 17:07:00.423 [warn]  ping postgres: retrying  error="pq: password authentication failed for user \"coder\""  try=11
2024-12-23 17:07:02.099 [erro]  connect to postgres failed ...
    error= unable to connect after 11 tries; last error:
               github.com/coder/coder/v2/cli.ConnectToPostgres
                   /home/runner/work/coder/coder/cli/server.go:2135
             - pq: password authentication failed for user "coder"
Encountered an error running "coder server", see "coder server --help" for more information
error: connect to postgres: connect to postgres: unable to connect after 11 tries; last error: pq: password authentication failed for user "coder"
Stream closed EOF for coder/coder-857fcf79d5-kcg42 (coder)

I've also deployed this to my local kind cluster using the postgres helm chart but have the same result.

The only way to resolve this is by manually replacing the special characters with URL encoding or replace the special characters with URL encoding using ESO but this is a temporary solution.

Is there a way to make coder handle special characters when authenticating?

Is there a way for coder to authenticate with RDS using an IAM role? Is this configurable by the Helm chart?

Metadata

Metadata

Assignees

Labels

docsArea: coder.com/docs

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions