简体   繁体   English

weblate 连接到 aws rds postgres

[英]weblate connect to aws rds postgres

I'm trying to connect weblate to external rds postgres database.我正在尝试将 weblate 连接到外部 rds postgres 数据库。 I'm using docker compose file that run weblate container.我正在使用运行 weblate 容器的 docker 撰写文件。 To this container I add the environment variables to connect to rds postgres.我将环境变量添加到此容器以连接到 rds postgres。 The weblate container doesn't connect to rds postgres and give me this error: weblate 容器没有连接到 rds postgres 并给我这个错误:

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.但是如果我尝试通过 cli 从 weblate 容器内部连接到 rds postgres,它就可以工作。

docker compose file: docker 编写文件:

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

It tries to connect as postgres user while your configuration states myuser .当您的配置状态为myuser时,它会尝试以postgres用户身份连接。 Maybe the ./environment file overrides that?也许./environment文件会覆盖它?

I found the problem.我发现了问题。 The problem was the char $ inside password .问题是char $ inside password

Maybe the library used to connect to postgres has a bug or, simple, not allowed $ in password string.也许用于连接到 postgres 的库有一个错误,或者简单地说,密码字符串中不允许使用 $。 When I removed that char it works.当我删除该字符时,它可以工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM