Skip to Content
Menu
This question has been flagged
2 Replies
1343 Views

Hallo Odoo community i have a windows computer with WSL installed and Docker running
i tried the code form docker hub for my docker compose file .
https://hub.docker.com/_/odoo
version 18 but even though with minimum configuration i get this error while running docker compose up , does anyone have an idea on how to get this up and running 
Thanks in advance 
db-1   | 2024-11-06 10:31:20.791 UTC [92] FATAL:  password authentication failed for user "odoo"

db-1   | 2024-11-06 10:31:20.791 UTC [92] DETAIL:  Connection matched pg_hba.conf line 100: "host all all all scram-sha-256"

Avatar
Discard
Best Answer

The error you're seeing (password authentication failed for user "odoo") indicates that the PostgreSQL database is rejecting the connection due to incorrect credentials. You can resolve this by ensuring that the POSTGRES_USER, POSTGRES_PASSWORD, and DB_USER environment variables in your docker-compose.yml file are correctly set and consistent between the Odoo and PostgreSQL containers.

For example:
'''
services:

  db:

    image: postgres:13

    environment:

      POSTGRES_USER: odoo

      POSTGRES_PASSWORD: odoo

      POSTGRES_DB: odoo

  odoo:

    image: odoo:18

    environment:

      - HOST=db

      - USER=odoo

      - PASSWORD=odoo

    depends_on:

      - db


'''

Ensure that both containers have matching credentials for the odoo user. After adjusting the configuration, rebuild the containers with docker-compose up --build.

Avatar
Discard
Author

Hallo Michael Angelo, Thank you for your Answer but it seems the problem still persist even after making the changes you mentioned , i will paste my compose file here and the error message
Error-Message
----------------

2024-11-06 12:05:07.552 UTC [1] LOG: starting PostgreSQL 15.8 (Debian 15.8-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit

2024-11-06 12:05:07.553 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432

2024-11-06 12:05:07.553 UTC [1] LOG: listening on IPv6 address "::", port 5432

2024-11-06 12:05:07.561 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"

2024-11-06 12:05:07.576 UTC [29] LOG: database system was shut down at 2024-11-06 12:01:23 UTC

2024-11-06 12:05:07.590 UTC [1] LOG: database system is ready to accept connections

2024-11-06 12:05:08.249 UTC [33] FATAL: password authentication failed for user "odoo"

2024-11-06 12:05:08.249 UTC [33] DETAIL: Connection matched pg_hba.conf line 100: "host all all all scram-sha-256"

2024-11-06 12:05:09.272 UTC [34] FATAL: password authentication failed for user "odoo"

2024-11-06 12:05:09.272 UTC [34] DETAIL: Connection matched pg_hba.conf line 100: "host all all all scram-sha-256"

2024-11-06 12:05:10.283 UTC [35] FATAL: password authentication failed for user "odoo"

2024-11-06 12:05:10.283 UTC [35] DETAIL: Connection matched pg_hba.conf line 100: "host all all all scram-sha-256"
--------------------------------------------------------------------------
The compose file used
--------------------------------------------------------------------------
version: '3.1'

services:

web:

image: odoo:18.0

depends_on:

- db

ports:

- "8069:8069"

volumes:

- odoo-web-data:/var/lib/odoo # Persistent data for Odoo

- ./config:/etc/odoo # Custom config directory for Odoo

- ./addons:/mnt/extra-addons # Custom add-ons directory

environment:

HOST: db # Hostname for the database container

USER: odoo # Username for PostgreSQL

PASSWORD: odoo # Password for PostgreSQL

db:

image: postgres:15

environment:

POSTGRES_DB: odoo # Database name for Odoo

POSTGRES_USER: odoo # PostgreSQL user (must match Odoo's settings)

POSTGRES_PASSWORD: odoo # PostgreSQL password (must match Odoo's settings)

PGDATA: /var/lib/postgresql/data/pgdata # Persistent data for PostgreSQL

volumes:

- odoo-db-data:/var/lib/postgresql/data/pgdata

volumes:

odoo-web-data:

odoo-db-data:

Hi,

Here are a few things to try to resolve the issue:

Environment Variable Names: For Odoo, make sure the database-related environment variables in your web service match the expected naming format in Odoo:
'''
environment:
- DB_HOST=db
- DB_USER=odoo
- DB_PASSWORD=odoo
'''

Rebuild Containers: Run docker-compose down -v to remove all containers and volumes, then docker-compose up --build to rebuild and start fresh.

Confirm pg_hba.conf Configuration: Ensure that the PostgreSQL configuration in the pg_hba.conf file (usually found in /var/lib/postgresql/data/pgdata when using Docker) is set to md5 for authentication instead of scram-sha-256.

Author

Hallo Michael Angelo, I did try the changed name of environment variables you mentioned but it seems the error persists, I also changed the config file of postgres with attatched volumes and the contents to be md5, then I get the same error message but this time with md5 at the end instead of the name of the other encryption.