Odoo 17 Docker image fails to start when PostgreSQL user cannot authenticate against the postgres maintenance database
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
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:
- 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.
- Connection to the PostgreSQL maintenance database fails
Using the same host, port, username and password, but dbname="postgres", results in:
FATAL: password authentication failed
- 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.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from odoo/docker
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
-
Missing PyJWT ?Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Ensure weekly updatesMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
progress-deadline annotation accepts "0s" although validation says it must be positivePossibly taken @BahaaMattar claimed this today. Openarea/API kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mailcow/mailcow-dockerized#7677 · 1 comment ·
Maintainers usually reply within 1 day
-
area:plugins kind:perf priority:p3 ready
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
api cleanup
Difficulty 1/5 Under an hour Newbie friendliness 86/100
Maintainers usually reply within 1 day