Odoo 17 Docker image fails to start when PostgreSQL user cannot authenticate against the postgres maintenance database

Aperta
#582 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
docker, postgresql, python
Ambito
backend, databases

Direzione di ricerca

Start with /entrypoint.sh and the wait-for-psql.py check it runs; trace which database the check targets when db_name is configured. Compare that behavior with the reported successful connection to the Odoo database and the failed connection to postgres. Done means the check's expected behavior for a configured db_name is resolved, either through its behavior or documented requirements.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Description

I'm running Odoo 17 using the official Docker image (odoo:17.0) with an external PostgreSQL server.

My PostgreSQL user can successfully connect to the configured Odoo database, but cannot authenticate against the default PostgreSQL maintenance database (postgres).

The Odoo Docker entrypoint fails during its initial database connectivity check, even though the configured Odoo database is reachable.

This behavior occurs both with Docker Compose and with a plain docker run command.
Environment
• Odoo Docker image: odoo:17.0
• PostgreSQL server: 18.4
• PostgreSQL client: 16.15
• Docker host: Ubuntu 24.04
• Database: external PostgreSQL server
• Odoo database: odoo
• PostgreSQL user: odoo_owner

Configuration

My Odoo configuration (/etc/odoo/odoo.conf) contains:

[options] db_host = <POSTGRESQL_HOST> db_port = 5432 db_user = odoo_owner db_password = <REDACTED> db_name = odoo list_db = False

Steps to reproduce
1. Configure an external PostgreSQL server.
2. Create an Odoo database named odoo.
3. Configure a PostgreSQL user that can authenticate and connect to odoo, but cannot authenticate against the postgres maintenance database.
4. Start the official Odoo 17 Docker image with the configuration above.

Actual behavior

The container starts but repeatedly reports:

Database connection failure: connection to server at "<POSTGRESQL_HOST>" (<IP>), port 5432 failed: FATAL: password authentication failed

The error comes from the initial wait-for-psql.py check executed by the Docker entrypoint.
Additional investigation

I verified the following:

  1. Direct connection to the configured Odoo database works

From the Docker container:

psycopg2.connect( host="<POSTGRESQL_HOST>", port=5432, user="odoo_owner", password="<PASSWORD>", dbname="odoo" )

This connection succeeds.

  1. Connection to the PostgreSQL maintenance database fails

Using the same host, port, username and password, but dbname="postgres", results in:

FATAL: password authentication failed

  1. Configuration and credentials are correct

I verified that:
• The container reads the expected /etc/odoo/odoo.conf.
• The configured database name is odoo.
• The password is identical in both the temporary and running containers.
• Direct psycopg2 connections to odoo work.

  1. The issue is not specific to Docker Compose

I reproduced the same behavior using the official image directly:

docker run -d \ --name odoo17-test \ -p 127.0.0.1:8069:8069 \ -v "$(pwd)/odoo.conf:/etc/odoo/odoo.conf:ro" \ odoo:17.0

The container still executes /entrypoint.sh odoo and fails at the initial PostgreSQL connectivity check.
Expected behavior

When db_name is explicitly configured, and the Odoo database is already accessible, I would expect the initial connectivity check to validate the configured database rather than requiring successful authentication against the postgres maintenance database.

Alternatively, it would be useful to document that the configured PostgreSQL user must also be able to authenticate against the postgres database.
Questions
1. Is the connection to the postgres maintenance database in wait-for-psql.py intentional, even when db_name is explicitly configured?
2. Is there a recommended configuration for using an external PostgreSQL server with a restricted application user?
3. Could the initial connectivity check use the configured db_name instead of hardcoding postgres?

Thanks for your feedback.

Lingua principale
Dockerfile
Stelle
1.2k
Fork
1.7k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di odoo/docker

Tutte le issue di odoo/docker

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.