I am using docker-compose to orchestrate two services but I am getting an error for one of those. Upon following the logs, this is my output:
2023/02/01 08:34:35 [INFO] version.go:13 versionPrint(): starting Commento
2023/02/01 08:34:35 [INFO] database_connect.go:20 dbConnect(): opening connection to postgres: postgres://postgres:redacted@db:5432/commento?sslmode=disable
2023/02/01 08:34:35 [ERROR] database_connect.go:31 dbConnect(): cannot talk to postgres, retrying in 10 seconds (4 attempts left): dial tcp 172.18.0.2:5432: connect: connection refused
2023/02/01 08:34:45 [INFO] database_connect.go:20 dbConnect(): opening connection to postgres: postgres://postgres:redacted@db:5432/commento?sslmode=disable
2023/02/01 08:34:45 [ERROR] database_connect.go:31 dbConnect(): cannot talk to postgres, retrying in 10 seconds (3 attempts left): pq: unknown authentication response: 10
2023/02/01 08:34:55 [INFO] database_connect.go:20 dbConnect(): opening connection to postgres: postgres://postgres:redacted@db:5432/commento?sslmode=disable
2023/02/01 08:34:55 [ERROR] database_connect.go:31 dbConnect(): cannot talk to postgres, retrying in 10 seconds (2 attempts left): pq: unknown authentication response: 10
2023/02/01 08:35:05 [INFO] database_connect.go:20 dbConnect(): opening connection to postgres: postgres://postgres:redacted@db:5432/commento?sslmode=disable
2023/02/01 08:35:06 [ERROR] database_connect.go:31 dbConnect(): cannot talk to postgres, retrying in 10 seconds (1 attempts left): pq: unknown authentication response: 10
2023/02/01 08:35:16 [INFO] database_connect.go:20 dbConnect(): opening connection to postgres: postgres://postgres:redacted@db:5432/commento?sslmode=disable
2023/02/01 08:35:16 [ERROR] database_connect.go:31 dbConnect(): cannot talk to postgres, retrying in 10 seconds (0 attempts left): pq: unknown authentication response: 10
2023/02/01 08:35:26 [INFO] database_connect.go:20 dbConnect(): opening connection to postgres: postgres://postgres:redacted@db:5432/commento?sslmode=disable
2023/02/01 08:35:26 [ERROR] database_connect.go:35 dbConnect(): cannot talk to postgres, last attempt failed: pq: unknown authentication response: 10
fatal error: pq: unknown authentication response: 10
I haven't tried any solutions yet because I don't know where to start. How do I fix this?
Steps to reproduce:
- On a clean Ubuntu 22.04LTS Server, installed docker and docker-compose.
- Created a directory for the service and used the following configuration for docker-compose.yml :
version: '3'
services:
server:
image: registry.gitlab.com/commento/commento:SET_VERSION
ports:
- 8080:8080
environment:
COMMENTO_ORIGIN: http://commento.example.com:8080
COMMENTO_PORT: 8080
COMMENTO_POSTGRES: postgres://postgres:postgres@db:5432/commento?sslmode=disable
depends_on:
- db
db:
image: postgres
environment:
POSTGRES_DB: commento
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- postgres_data_volume:/var/lib/postgresql/data
volumes:
postgres_data_volume:
- Ran
docker-compose up -d
and after that I followed the logs for both the services. The service "commento_server_1" produced the output mentioned above.