0

I'm trying to connect weblate to external rds postgres database. I'm using docker compose file that run weblate container. To this container I add the environment variables to connect to rds postgres. The weblate container doesn't connect to rds postgres and give me this error:

psql: error: connection to server at "XXXX.rds.amazonaws.com", port 5432 failed: FATAL:  password authentication failed for user "postgres"

but if I try to connect to rds postgres from inside the weblate container via cli, it works.

docker compose file:

version: '3'
services:
  weblate:
    image: weblate/weblate
    tmpfs:
      - /app/cache
    volumes:
      - weblate-data:/app/data
    env_file:
      - ./environment
    restart: always
    ports:
      - 80:8080
    environment:
      POSTGRES_PASSWORD: XXXX
      POSTGRES_USER: myuser
      POSTGRES_DATABASE: mydb
      POSTGRES_HOST: XXX.rds.amazonaws.com
      POSTGRES_PORT: 5432
Daniele
  • 538
  • 1
  • 5
  • 17

2 Answers2

0

It tries to connect as postgres user while your configuration states myuser. Maybe the ./environment file overrides that?

Michal Čihař
  • 9,799
  • 6
  • 49
  • 87
0

I found the problem. The problem was the char $ inside password.

Maybe the library used to connect to postgres has a bug or, simple, not allowed $ in password string. When I removed that char it works.

Daniele
  • 538
  • 1
  • 5
  • 17