doodba: Authentication Failure in test and prod env

Used image postgres 14 13. Occurs in both odoo 13 and 14

Describe the bug

When starting the production environment the log reads:

db_1                          | 	Connection matched pg_hba.conf line 8: "host all all 172.19.0.0/16 md5"
db_1                          | 2021-04-16 13:21:34.283 GMT [190] FATAL:  password authentication failed for user "odoo"
db_1                          | 2021-04-16 13:21:34.283 GMT [190] DETAIL:  Password does not match for user "odoo".
db_1                          | 	Connection matched pg_hba.conf line 8: "host all all 172.19.0.0/16 md5"
db_1                          | 2021-04-16 13:21:35.409 GMT [191] FATAL:  password authentication failed for user "odoo"
db_1                          | 2021-04-16 13:21:35.409 GMT [191] DETAIL:  Password does not match for user "odoo".
db_1                          | 	Connection matched pg_hba.conf line 8: "host all all 172.19.0.0/16 md5"
db_1                          | 2021-04-16 13:21:36.499 GMT [192] FATAL:  password authentication failed for user "odoo"
db_1                          | 2021-04-16 13:21:36.499 GMT [192] DETAIL:  Password does not match for user "odoo".
db_1                          | 	Connection matched pg_hba.conf line 8: "host all all 172.19.0.0/16 md5"

A clear and concise description of what the bug is.

To Reproduce

Follow regular workflow: Install copier invoke img-pull img-build --pull git-aggregate resetdb start

set the secrets in: ./.docker/db-access.env to PGPASSWORD=odoopassword ./.docker/db-creation.env to POSTGRES_PASSWORD=odoopassword (or leve them alone as they are filled from the copier script)

initiate the database with docker-compose run --rm odoo --stop-after-init -i base

(Docker may throw an network error, preform an extra compose down and docker network prune)

start production environment with: docker-compose -f prod.yaml up

Affected versions: Used image postgres 14 13. (edit: typo) Occurs in both odoo 13 and 14

Expected behavior Booting into production environment.

Additional context Add any other context about the problem here. (e.g. OS, Docker version, …) host system debian10

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 20 (9 by maintainers)

Most upvoted comments

Thank you all here for exposing your experience regarding this issue, I spent hours trying to find out why it didn’t work and thanks to your comments I was able to do it. It was because I was using the project created by copier to use as development and then intend to use as production (certainly not recommended). However, the key to switching between modes is to purge the volumes and images with: invoke stop --purge and then run: docker-compose -f prod.yaml run --rm odoo --stop-after- init -i base and then if you can do a: docker-compose -f prod.yaml up -d to see it work.

Remember that it is necessary to point the domain to the IP of the pc you are using, at least by editing the hosts file and placing 127.0.0.1 testdomain.com

the main use case for the copier template project with different environments was not to have them all running on the same server… You would tipically have your development environment in your development machine, and your test/prod environment running in a staging/production server. It makes sense that you would need to rebuild the associated volumes, as they will always have different characteristics depending on the environment.

Yes, and not only the volumes. The image doodba builds for devel isn’t compatible with the image built for test/prod.

AFAICS that variable is only being used in the prod environment: https://github.com/Tecnativa/doodba-copier-template/blob/stable/prod.yaml.jinja#L18 Should we add it to the others @Yajo?

Nope, devel is always done in English.

This seems fixed, so closing 😺

Hello, sorry if I am insistent on this topic, it’s just that I dedicate myself to these topics when I can. I want to use a development and test/production environment on the same computer. It strikes me that the copier does not ask you what type of environment you are going to work in. In order to do this, should the projects be called differently? If it is a development environment, is it allowed to configure Traefik? Should I set up the domains when you ask?

🎉 it’s working now

After my previous message I had to initialize the db. used the command docker-compose run --rm odoo --stop-after-init -i base but that command resulted in an endless doodba INFO: Waiting until postgres is listening at db... as that command is in the dev environment

after a $ docker-compose -f prod.yaml run --rm odoo --stop-after-init -i base it has correctly initialized the prod db.

for testing purposes… continueing the test. (intitially wanted to update the project by running copier update and copier --force but got an dirty error.) So I started over. deleted the project folder and run the copier again and changed it to use my own password for postgres.

similar, the prod environment will not launch docker-compose down -v and docker-compose -f prod.yaml up wil throw a lot of errors:

db_1 | 2021-04-16 15:15:36.072 GMT [1] LOG: database system is ready to accept connections odoo_1 | doodba INFO: Unaccent extension installed odoo_1 | doodba INFO: Linking all addons from /opt/odoo/custom/src/addons.yaml in /opt/odoo/auto/addons odoo_1 | doodba INFO: Generating /opt/odoo/auto/odoo.conf file. Overriding any existing… odoo_1 | doodba INFO: Merging found configuration files in /opt/odoo/auto/odoo.conf odoo_1 | doodba INFO: Executing /usr/local/bin/odoo odoo_1 | Traceback (most recent call last): odoo_1 | File “/opt/odoo/common/entrypoint”, line 75, in <module> odoo_1 | os.execvp(extra_command[0], extra_command) odoo_1 | File “/usr/local/lib/python3.8/os.py”, line 568, in execvp odoo_1 | _execvpe(file, args) odoo_1 | File “/usr/local/lib/python3.8/os.py”, line 591, in _execvpe odoo_1 | exec_func(file, *argrest) odoo_1 | FileNotFoundError: [Errno 2] No such file or directory odoo_1 | doodba INFO: Waiting until postgres is listening at db… odoo_1 | doodba INFO: Linking all addons from /opt/odoo/custom/src/addons.yaml in /opt/odoo/auto/addons odoo_1 | doodba INFO: Generating /opt/odoo/auto/odoo.conf file. Overriding any existing… odoo_1 | doodba INFO: Merging found configuration files in /opt/odoo/auto/odoo.conf odoo_1 | doodba INFO: Executing /usr/local/bin/odoo odoo_1 | Traceback (most recent call last): odoo_1 | File “/opt/odoo/common/entrypoint”, line 75, in <module> odoo_1 | os.execvp(extra_command[0], extra_command) odoo_1 | File “/usr/local/lib/python3.8/os.py”, line 568, in execvp odoo_1 | _execvpe(file, args) odoo_1 | File “/usr/local/lib/python3.8/os.py”, line 591, in _execvpe odoo_1 | exec_func(file, *argrest) odoo_1 | FileNotFoundError: [Errno 2] No such file or directory int14_odoo_1 exited with code 1 odoo_1 | doodba INFO: Waiting until postgres is listening at db… odoo_1 | doodba INFO: Linking all addons from /opt/odoo/custom/src/addons.yaml in /opt/odoo/auto/addons odoo_1 | doodba INFO: Generating /opt/odoo/auto/odoo.conf file. Overriding any existing… odoo_1 | doodba INFO: Merging found configuration files in /opt/odoo/auto/odoo.conf odoo_1 | doodba INFO: Executing /usr/local/bin/odoo odoo_1 | Traceback (most recent call last): odoo_1 | File “/opt/odoo/common/entrypoint”, line 75, in <module> odoo_1 | os.execvp(extra_command[0], extra_command) odoo_1 | File “/usr/local/lib/python3.8/os.py”, line 568, in execvp odoo_1 | _execvpe(file, args) odoo_1 | File “/usr/local/lib/python3.8/os.py”, line 591, in _execvpe odoo_1 | exec_func(file, *argrest) odoo_1 | FileNotFoundError: [Errno 2] No such file or directory int14_odoo_1 exited with code 1 odoo_1 | doodba INFO: Waiting until postgres is listening at db… odoo_1 | doodba INFO: Linking all addons from /opt/odoo/custom/src/addons.yaml in /opt/odoo/auto/addons odoo_1 | doodba INFO: Generating /opt/odoo/auto/odoo.conf file. Overriding any existing… odoo_1 | doodba INFO: Merging found configuration files in /opt/odoo/auto/odoo.conf odoo_1 | doodba INFO: Executing /usr/local/bin/odoo odoo_1 | Traceback (most recent call last): odoo_1 | File “/opt/odoo/common/entrypoint”, line 75, in <module> odoo_1 | os.execvp(extra_command[0], extra_command) odoo_1 | File “/usr/local/lib/python3.8/os.py”, line 568, in execvp odoo_1 | _execvpe(file, args) odoo_1 | File “/usr/local/lib/python3.8/os.py”, line 591, in _execvpe odoo_1 | exec_func(file, *argrest) odoo_1 | FileNotFoundError: [Errno 2] No such file or directory int14_odoo_1 exited with code 1 odoo_1 | doodba INFO: Waiting until postgres is listening at db… odoo_1 | doodba INFO: Linking all addons from /opt/odoo/custom/src/addons.yaml in /opt/odoo/auto/addons odoo_1 | doodba INFO: Generating /opt/odoo/auto/odoo.conf file. Overriding any existing… odoo_1 | doodba INFO: Merging found configuration files in /opt/odoo/auto/odoo.conf odoo_1 | doodba INFO: Executing /usr/local/bin/odoo odoo_1 | Traceback (most recent call last): odoo_1 | File “/opt/odoo/common/entrypoint”, line 75, in <module> odoo_1 | os.execvp(extra_command[0], extra_command) odoo_1 | File “/usr/local/lib/python3.8/os.py”, line 568, in execvp odoo_1 | _execvpe(file, args) odoo_1 | File “/usr/local/lib/python3.8/os.py”, line 591, in _execvpe odoo_1 | exec_func(file, *argrest) odoo_1 | FileNotFoundError: [Errno 2] No such file or directory int14_odoo_1 exited with code 1 odoo_1 | doodba INFO: Waiting until postgres is listening at db… odoo_1 | doodba INFO: Linking all addons from /opt/odoo/custom/src/addons.yaml in /opt/odoo/auto/addons odoo_1 | doodba INFO: Generating /opt/odoo/auto/odoo.conf file. Overriding any existing… odoo_1 | doodba INFO: Merging found configuration files in /opt/odoo/auto/odoo.conf odoo_1 | doodba INFO: Executing /usr/local/bin/odoo odoo_1 | Traceback (most recent call last): odoo_1 | File “/opt/odoo/common/entrypoint”, line 75, in <module> odoo_1 | os.execvp(extra_command[0], extra_command) odoo_1 | File “/usr/local/lib/python3.8/os.py”, line 568, in execvp odoo_1 | _execvpe(file, args) odoo_1 | File “/usr/local/lib/python3.8/os.py”, line 591, in _execvpe odoo_1 | exec_func(file, *argrest) odoo_1 | FileNotFoundError: [Errno 2] No such file or directory int14_odoo_1 exited with code 1 odoo_1 | doodba INFO: Waiting until postgres is listening at db… odoo_1 | doodba INFO: Linking all addons from /opt/odoo/custom/src/addons.yaml in /opt/odoo/auto/addons odoo_1 | doodba INFO: Generating /opt/odoo/auto/odoo.conf file. Overriding any existing… odoo_1 | doodba INFO: Merging found configuration files in /opt/odoo/auto/odoo.conf odoo_1 | doodba INFO: Executing /usr/local/bin/odoo odoo_1 | Traceback (most recent call last): odoo_1 | File “/opt/odoo/common/entrypoint”, line 75, in <module> odoo_1 | os.execvp(extra_command[0], extra_command) odoo_1 | File “/usr/local/lib/python3.8/os.py”, line 568, in execvp odoo_1 | _execvpe(file, args) odoo_1 | File “/usr/local/lib/python3.8/os.py”, line 591, in _execvpe odoo_1 | exec_func(file, *argrest) odoo_1 | FileNotFoundError: [Errno 2] No such file or directory int14_odoo_1 exited with code 1 odoo_1 | doodba INFO: Waiting until postgres is listening at db… odoo_1 | doodba INFO: Linking all addons from /opt/odoo/custom/src/addons.yaml in /opt/odoo/auto/addons odoo_1 | doodba INFO: Generating /opt/odoo/auto/odoo.conf file. Overriding any existing… odoo_1 | doodba INFO: Merging found configuration files in /opt/odoo/auto/odoo.conf odoo_1 | doodba INFO: Executing /usr/local/bin/odoo odoo_1 | Traceback (most recent call last): odoo_1 | File “/opt/odoo/common/entrypoint”, line 75, in <module> odoo_1 | os.execvp(extra_command[0], extra_command) odoo_1 | File “/usr/local/lib/python3.8/os.py”, line 568, in execvp odoo_1 | _execvpe(file, args) odoo_1 | File “/usr/local/lib/python3.8/os.py”, line 591, in _execvpe odoo_1 | exec_func(file, *argrest) odoo_1 | FileNotFoundError: [Errno 2] No such file or directory int14_odoo_1 exited with code 1 odoo_1 | doodba INFO: Waiting until postgres is listening at db… odoo_1 | doodba INFO: Linking all addons from /opt/odoo/custom/src/addons.yaml in /opt/odoo/auto/addons odoo_1 | doodba INFO: Generating /opt/odoo/auto/odoo.conf file. Overriding any existing… odoo_1 | doodba INFO: Merging found configuration files in /opt/odoo/auto/odoo.conf odoo_1 | doodba INFO: Executing /usr/local/bin/odoo odoo_1 | Traceback (most recent call last): odoo_1 | File “/opt/odoo/common/entrypoint”, line 75, in <module> odoo_1 | os.execvp(extra_command[0], extra_command) odoo_1 | File “/usr/local/lib/python3.8/os.py”, line 568, in execvp odoo_1 | _execvpe(file, args) odoo_1 | File “/usr/local/lib/python3.8/os.py”, line 591, in _execvpe odoo_1 | exec_func(file, *argrest) odoo_1 | FileNotFoundError: [Errno 2] No such file or directory int14_odoo_1 exited with code 1

so invoke stop --purge docker-compose -f prod.yaml up docker-compose -f prod.yaml run --rm odoo --stop-after-init -i base

Summary for my understanding. It is not possible anymore to switch directly between environments. The volumes needs to be purged before doing so. This was not very clearly documented.

Further remarks: I have set the odoo_initial_lang to my locale. But it still initialized the db in en_US