0

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:

  1. On a clean Ubuntu 22.04LTS Server, installed docker and docker-compose.
  2. 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:

  1. 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.
  • Please provide an [mcve](https://stackoverflow.com/help/minimal-reproducible-example). – Étienne Miret Feb 01 '23 at 11:10
  • @ÉtienneMiret I am following the instructions on this [documentation](https://docs.commento.io/installation/self-hosting/on-your-server/docker.html) for deploying a comment engine. I just followed the docker-compose section. – dummytokken Feb 01 '23 at 11:15
  • [How to fix the "unknown authentication response: 10" in postGIS database through using docker](https://stackoverflow.com/questions/64316524/how-to-fix-the-unknown-authentication-response-10-in-postgis-database-through) suggests you need to upgrade your client to support a newer authentication method? Absent any code or reproduction instructions it's almost impossible to tell, though. – David Maze Feb 01 '23 at 12:10
  • @DavidMaze let me update the post for reproducing this error. – dummytokken Feb 01 '23 at 12:38
  • Done. I have added the steps to reproduce the problem. @DavidMaze – dummytokken Feb 01 '23 at 12:51

1 Answers1

3

First, using registry.gitlab.com/commento/commento:SET_VERSION leads to the bellow error:

Pulling server (registry.gitlab.com/commento/commento:SET_VERSION)...
ERROR: manifest for registry.gitlab.com/commento/commento:SET_VERSION not found: manifest unknown: manifest unknown

because there is no release SET_VERSION of commento.

So you must have done something different. Please, next time you ask a question, make sure the instructions you provide to reproduce your issue are minimal and complete. See https://stackoverflow.com/help/minimal-reproducible-example

Anyway, I was able to reproduce your issue switching from commento:SET_VERSION to commento:latest. The issue you are facing is due to the fact that the latest release of commento (at the time of writing) doesn't support the latest release of postgres (at the time of writing).

The solution is to downgrade the postgres version to 13:

version: '3'

services:
  db:
    image: postgres:13

(keep other lines of your docker-compose.yml as they are).

Also, as future versions of commento may no longer support postgres 13. So when writing a docker-compose.yml, I would recommend always specifying the versions of all services:

services:
  server:
    image: registry.gitlab.com/commento/commento:v1.4.0
Étienne Miret
  • 6,448
  • 5
  • 24
  • 36
  • Hey! Thanks for pointing out the solution. I did try to reduce the Postgres version to 13.4/13.9 and that didn't work and I didn't go below 13.4. Also. apologies for the error in the configuration, I forgot to switch out it here during posting. My bad. – dummytokken Feb 01 '23 at 15:12
  • 1
    Note, that after downgrading Postgres the Database-Container won't work, because the initialized data is incomatible with the old version. You'll have to remove everything from the volume `postgres_data_volume` or delete the volume to make Postgres 13 re-initialize. – jory May 27 '23 at 19:41