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

Open
#582 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
docker, postgresql, python
Domain
backend, databases

Research direction

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.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Dockerfile
Stars
1.2k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from odoo/docker

All issues in odoo/docker

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.