Tecnativa / doodba

Base image for making the creation of customized Odoo environments a piece of cake
Apache License 2.0
436 stars 305 forks source link

Unable to launch Devel Environment on Odoo 13 install with copier #315

Closed bosd closed 4 years ago

bosd commented 4 years ago

Setting up a fresh odoo 13 install and lanching the devel environment creates a

FileNotFoundError: [Errno 2] No such file or directory
pass_odoo_1 exited with code 1

See the used copier answers and steps to reproduce

$ mkdir pass
$ copier copy gh:Tecnativa/doodba-copier-template ~/pass

Tell me who you are.
If private modules do not include this author, pylint will warn you.
project_author? Format: str
๐ŸŽค [Tecnativa]: int

What's your project name?
Do not use dots or spaces in the name; just "A-Za-z0-9-_" please.
project_name? Format: str
๐ŸŽค [myproject-odoo]: pass-odoo

It's important to use a good license for your project.
In https://choosealicense.com/ you can read details about most common FOSS ones. In https://www.odoo.com/documentation/user/13.0/legal/licenses/licenses.html you can find other propietary licenses we support in this scaffolding. Make a wise choice!
So, what's your project's license?
project_license? Format: yaml
๐ŸŽค
(1) No license
(2) Apache License 2.0
(3) Boost Software License 1.0
(4) GNU Affero General Public License (AGPL) 3.0 or later
(5) GNU Library or "Lesser" General Public License (LGPL) 3.0 or later
(6) MIT license
(7) Odoo Enterprise Edition License v1.0
(8) Odoo Proprietary License v1.0
Choice [3]: 

If you host this project in Gitlab, then please enter here the project URL.
It must have no trailing slash.
๐Ÿ’ก If you don't use Gitlab, leave this empty and ignore all other Gitlab questions.
Example: `https://gitlab.com/Tecnativa/your-doodba-project`.
gitlab_url? Format: str
๐ŸŽค [None]: 

Write the main production domain for this project. Only the domain, no protocol or things like that.
Example: www.example.com
domain_prod? Format: str
๐ŸŽค [None]: myproject.nl

Write a list of alternative domains that should produce a 301 redirection to the main domain.
Example: [example.com, www.example.org, example.org]
domain_prod_alternatives? Format: yaml
๐ŸŽค [None]: 

Write the test domain for this project. Only the domain, no protocol or things like that.
Example: demo.example.com
domain_test? Format: str
๐ŸŽค [None]: test.myproject.nl

Tell me the list of paths which where you want to forbid crawlers.
Imagine you do not want your `/shop` and `/shop/**` pages to be indexed. Then put here `[/shop]`.
โš ๏ธ It must be a list. And this is only supported if you deploy with Traefik.
๐Ÿ’ก We will convert this to `Path` rules. Check valid syntax in https://docs.traefik.io/routing/routers/#rule
paths_without_crawlers? Format: yaml
๐ŸŽค [['/web', '/website/info']]: 

If you need to whitelist certain CIDR to allow only them to access your Odoo instance, set that here please.
โš ๏ธ It must be a list. And this is only supported if you deploy with Traefik 2+.
cidr_whitelist? Format: yaml
๐ŸŽค [None]: 

On which odoo version is it based?
odoo_version? Format: float
๐ŸŽค
(1) 7.0
(2) 8.0
(3) 9.0
(4) 10.0
(5) 11.0
(6) 12.0
(7) 13.0
Choice [7]: 

If you want to initialize Odoo automatically in a specific language, write it here. The format must be ll_CC where ll is the language code and CC is the country code.
Examples: en_US, es_ES, es_VE...
odoo_initial_lang? Format: str
๐ŸŽค [en_US]: 

If you are using an OCI/Docker image registry (such as the Docker Hub, Quay or Gitlab registry) to publish the Odoo images that will be built with this Doodba project, specify here the path to the odoo image built with it. Leave it empty if you are not using a registry.
Example: docker.io/myteam/example-odoo
odoo_oci_image? Format: str
๐ŸŽค [None]: 

Do you want to list databases publicly?
odoo_listdb? Format: bool
๐ŸŽค? [y/N] N

๐Ÿ’ก To auto-generate strong passwords, see https://ddg.gg/?q=password+64+strong
โš ๏ธ This password is critical for security, especially if you have set odoo_listdb to true, so keep it safe.
What will be your odoo admin password?
odoo_admin_password? Format: str
๐Ÿ•ต๏ธ [example-admin-password]: admin

Set your Odoo db filter. It must be a regexp that matches the domain name being visited. It is useful if you use Odoo in SaaS mode.
odoo_dbfilter? Format: str
๐ŸŽค [.*]: 

โš ๏ธ Using a misconfigured proxy for production can create a security hole. Using none can create performance problems.
Which proxy will you use to deploy odoo?
odoo_proxy? Format: yaml
๐ŸŽค
(1) No proxy (dangerous for production)
(2) Traefik
(3) Other proxy (it's up to you!)
Choice [2]: 2

Which PostgreSQL version do you want to deploy?
postgres_version? Format: yaml
๐ŸŽค
(1) I will use an external PostgreSQL server
(2) 9.6
(3) 10
(4) 11
(5) 12
Choice [5]: 

Which user name will be used to connect to the postgres server?
postgres_username? Format: str
๐ŸŽค [odoo]: 

๐Ÿ’ก If database names differ among environments, operations like restoring a database from an alien environment will be harder to maintain, but can provide additional security. It's up to you. We default to "prod" for historical reasons.
What is going to be the main database name?
postgres_dbname? Format: str
๐ŸŽค [prod]: 

What will be your postgres user password?
postgres_password? Format: str
๐Ÿ•ต๏ธ [example-db-password]: something

Now, let's start configuring outgoing mail.
In case an email coming out from odoo doesn't have a valid `From:` header address, which address should be the default one that sends the email?
smtp_default_from? Format: str
๐ŸŽค [None]: 

โš ๏ธ If you leave this answer empty, all next SMTP settings will be ignored.
If you supply a valid SMTP host, production Odoo will be able to send emails without needing to configure any `ir.mail_server` record, because Doodba will configure it to use a mail relay that will manage a local mail queue before sending it to the real SMTP endpoint (saving your mails from bad network conditions). The same relay will be used to send backup reports.
So, what is your SMTP host?
Example: mail.example.com
smtp_relay_host? Format: str
๐ŸŽค [None]: 

Indicate the port to connect in the SMTP server you just defined.
โš ๏ธ NEVER use port 465 ๐Ÿ‘‰ https://github.com/tomav/docker-mailserver/issues/1428
smtp_relay_port? Format: int
๐ŸŽค [587]: 

Indicate the user to connect in the SMTP server you just defined.
For Odoo to work fine, this user needs to be able to do mail spoofing.
smtp_relay_user? Format: str
๐ŸŽค [None]: 

What is your SMTP password?
smtp_relay_password? Format: str
๐Ÿ•ต๏ธ [example-smtp-password]: 

Usually, if you send mails like "user@example.com", the canonical domain would be "example.com".
This canonical domain should have correct SPF, DKIM and DMARC settings that allow the SMTP host to send mails in its name.
When Odoo tries to send a mail that does not come from a canonical domain, the domain you indicate here will be used when rewriting the address with SRS (https://en.wikipedia.org/wiki/SRS).
What's your canonical domain?
smtp_canonical_default? Format: str
๐ŸŽค [None]: 

Supply a list of other domains authorized to send email from this Odoo instance and SMTP host. They will not be affected by SRS. They also must have valid SPF, DKIM and DMARC settings.
You do not need to repeat the canonical domain you indicated above.
Example: [examplemail.com, example.org]
smtp_canonical_domains? Format: yaml
๐ŸŽค [None]: 

If you want to use an Amazon S3 bucket, write its URL like `s3://s3.amazonaws.com/example-bucket/example/path` to make sure it works fine.
If you want to use any other backend, supply any URL supported by Duplicity (our choice backup engine; read http://duplicity.nongnu.org/vers8/duplicity.1.html#sect7 for those URL formats).
If you don't want bakcups, leave this empty.
Where should the backups be stored?
backup_dst? Format: str
๐ŸŽค [None]: 

The backup container will send email reports if the SMTP relay is properly configured.
What email address should it use to send them?
backup_email_from? Format: str
๐ŸŽค [None]: 

Where to send those backup reports?
backup_email_to? Format: str
๐ŸŽค [None]: 

If you're using S3, you probably want to delete outdated backups using bucket lifecycle rules. If you use other storage backend, then you probably want to enable outdated backups deletion using duplicity itself.
So, do you want to enable duplicity backup deletion via cron?
backup_deletion? Format: bool
๐ŸŽค? (y/n) n

Set the timezone used by the backup cron for reports.
Visit https://www.cyberciti.biz/faq/linux-unix-set-tz-environment-variable/ to know how to obtain a valid value for this variable.
backup_tz? Format: str
๐ŸŽค [UTC]: 

If you're using AWS S3 to store backups, provide here your access key ID.
backup_aws_access_key_id? Format: str
๐Ÿ•ต๏ธ [None]: 

If you're using AWS S3 to store backups, provide here your secret access key.
backup_aws_secret_access_key? Format: str
๐Ÿ•ต๏ธ [None]: 

โš ๏ธ This passphrase is critical for security, so keep it safe. You will need it to restore backups.
Which will be your backups passphrase?
backup_passphrase? Format: str
๐Ÿ•ต๏ธ [example-backup-passphrase]: 

    create  .eslintrc.yml
    create  .copier-answers.yml
    create  .editorconfig
    create  .isort.cfg
    create  .gitignore
    create  .flake8
    create  .pylintrc
    create  README.md
    create  setup-devel.yaml
    create  common.yaml
    create  prod.yaml
    create  test.yaml
    create  .prettierrc.yml
    create  .pylintrc-mandatory
    create  LICENSE
    create  tasks.py
    create  .env
    create  .pre-commit-config.yaml
    create  devel.yaml
    create  odoo/
    create  odoo/Dockerfile
    create  odoo/.dockerignore
    create  odoo/custom/
    create  odoo/custom/conf.d/
    create  odoo/custom/conf.d/.empty
    create  odoo/custom/src/
    create  odoo/custom/src/addons.yaml
    create  odoo/custom/src/repos.yaml
    create  odoo/custom/src/private/
    create  odoo/custom/src/private/.editorconfig
    create  odoo/custom/build.d/
    create  odoo/custom/build.d/.empty
    create  odoo/custom/entrypoint.d/
    create  odoo/custom/entrypoint.d/.empty
    create  odoo/custom/dependencies/
    create  odoo/custom/dependencies/gem.txt
    create  odoo/custom/dependencies/pip.txt
    create  odoo/custom/dependencies/apt_build.txt
    create  odoo/custom/dependencies/apt.txt
    create  odoo/custom/dependencies/npm.txt
    create  odoo/custom/ssh/
    create  odoo/custom/ssh/id_rsa.pub
    create  odoo/custom/ssh/known_hosts
    create  odoo/custom/ssh/config
    create  odoo/custom/ssh/id_rsa
    create  .vscode/
    create  .vscode/settings.json
    create  .vscode/tasks.json
    create  .vscode/extensions.json
    create  .vscode/launch.json
    create  .vscode/doodba.code-snippets
    create  .docker/
    create  .docker/db-access.env
    create  .docker/db-creation.env
    create  .docker/odoo.env

 > Running task 1 of 1: invoke develop
Initialized empty Git repository in /home/intendency/pass/.git/
pre-commit installed at .git/hooks/pre-commit

``$ sudo docker-compose -f devel.yaml up

feedback

WARNING: The SMTP_REAL_NON_CANONICAL_DEFAULT variable is not set. Defaulting to a blank string.
Creating network "pass_default" with the default driver
Creating network "pass_public" with the default driver
Creating volume "pass_filestore" with default driver
Creating volume "pass_db" with default driver
Creating pass_fonts_googleapis_proxy_1 ... done
Creating pass_cdnjs_cloudflare_proxy_1 ... done
Creating pass_google_proxy_1           ... done
Creating pass_db_1                     ... done
Creating pass_fonts_gstatic_proxy_1    ... done
Creating pass_gravatar_proxy_1         ... done
Creating pass_smtp_1                   ... done
Creating pass_wdb_1                    ... done
Creating pass_odoo_1                   ... done
Creating pass_odoo_proxy_1             ... done
Attaching to pass_google_proxy_1, pass_fonts_googleapis_proxy_1, pass_wdb_1, pass_smtp_1, pass_db_1, pass_cdnjs_cloudflare_proxy_1, pass_gravatar_proxy_1, pass_fonts_gstatic_proxy_1, pass_odoo_1, pass_odoo_proxy_1
cdnjs_cloudflare_proxy_1  | INFO:root:Resolved cdnjs.cloudflare.com to 104.16.132.229
cdnjs_cloudflare_proxy_1  | INFO:root:Executing: socat tcp-listen:80,fork,reuseaddr tcp-connect:104.16.132.229:80
cdnjs_cloudflare_proxy_1  | INFO:root:Executing: socat tcp-listen:443,fork,reuseaddr tcp-connect:104.16.132.229:443
db_1                      | The files belonging to this database system will be owned by user "postgres".
db_1                      | This user must also own the server process.
db_1                      | 
db_1                      | The database cluster will be initialized with locale "en_US.utf8".
db_1                      | The default database encoding has accordingly been set to "UTF8".
db_1                      | The default text search configuration will be set to "english".
db_1                      | 
db_1                      | Data page checksums are disabled.
db_1                      | 
fonts_googleapis_proxy_1  | INFO:root:Resolved fonts.googleapis.com to 172.217.168.234
db_1                      | fixing permissions on existing directory /var/lib/postgresql/data ... ok
fonts_googleapis_proxy_1  | INFO:root:Executing: socat tcp-listen:80,fork,reuseaddr tcp-connect:172.217.168.234:80
fonts_googleapis_proxy_1  | INFO:root:Executing: socat tcp-listen:443,fork,reuseaddr tcp-connect:172.217.168.234:443
db_1                      | creating subdirectories ... ok
db_1                      | selecting dynamic shared memory implementation ... posix
db_1                      | selecting default max_connections ... 100
db_1                      | selecting default shared_buffers ... 128MB
db_1                      | selecting default time zone ... UTC
db_1                      | creating configuration files ... ok
db_1                      | running bootstrap script ... ok
fonts_gstatic_proxy_1     | INFO:root:Resolved fonts.gstatic.com to 172.217.17.35
fonts_gstatic_proxy_1     | INFO:root:Executing: socat tcp-listen:80,fork,reuseaddr tcp-connect:172.217.17.35:80
db_1                      | performing post-bootstrap initialization ... sh: locale: not found
db_1                      | 2020-06-09 08:11:23.408 UTC [29] WARNING:  no usable system locales were found
fonts_gstatic_proxy_1     | INFO:root:Executing: socat tcp-listen:443,fork,reuseaddr tcp-connect:172.217.17.35:443
google_proxy_1            | INFO:root:Resolved www.google.com to 172.217.17.36
google_proxy_1            | INFO:root:Executing: socat tcp-listen:80,fork,reuseaddr tcp-connect:172.217.17.36:80
google_proxy_1            | INFO:root:Executing: socat tcp-listen:443,fork,reuseaddr tcp-connect:172.217.17.36:443
gravatar_proxy_1          | INFO:root:Resolved www.gravatar.com to 192.0.73.2
gravatar_proxy_1          | INFO:root:Executing: socat tcp-listen:80,fork,reuseaddr tcp-connect:192.0.73.2:80
gravatar_proxy_1          | INFO:root:Executing: socat tcp-listen:443,fork,reuseaddr tcp-connect:192.0.73.2:443
odoo_1                    | /usr/local/lib/python3.6/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
odoo_1                    |   """)
odoo_1                    | doodba INFO: Waiting until postgres is listening at db...
smtp_1                    | 2020/06/09 08:11:18 Using in-memory storage
smtp_1                    | 2020/06/09 08:11:18 [SMTP] Binding to address: 0.0.0.0:1025
smtp_1                    | 2020/06/09 08:11:18 Serving under http://0.0.0.0:8025/
smtp_1                    | [HTTP] Binding to address: 0.0.0.0:8025
smtp_1                    | Creating API v1 with WebPath: 
smtp_1                    | Creating API v2 with WebPath: 
db_1                      | ok
odoo_proxy_1              | INFO:root:Executing: socat tcp-listen:6899,fork,reuseaddr tcp-connect:odoo:6899
odoo_proxy_1              | INFO:root:Executing: socat tcp-listen:8069,fork,reuseaddr tcp-connect:odoo:8069
db_1                      | syncing data to disk ... ok
db_1                      | 
db_1                      | initdb: warning: enabling "trust" authentication for local connections
db_1                      | You can change this by editing pg_hba.conf or using the option -A, or
db_1                      | --auth-local and --auth-host, the next time you run initdb.
db_1                      | 
db_1                      | Success. You can now start the database server using:
db_1                      | 
db_1                      |     pg_ctl -D /var/lib/postgresql/data -l logfile start
db_1                      | 
db_1                      | waiting for server to start....2020-06-09 08:11:25.673 GMT [34] LOG:  starting PostgreSQL 12.2 on x86_64-pc-linux-musl, compiled by gcc (Alpine 9.2.0) 9.2.0, 64-bit
db_1                      | 2020-06-09 08:11:25.684 GMT [34] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1                      | 2020-06-09 08:11:25.713 GMT [35] LOG:  database system was shut down at 2020-06-09 08:11:25 GMT
db_1                      | 2020-06-09 08:11:25.719 GMT [34] LOG:  database system is ready to accept connections
db_1                      |  done
db_1                      | server started
db_1                      | CREATE DATABASE
db_1                      | 
db_1                      | 
db_1                      | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
db_1                      | 
db_1                      | 2020-06-09 08:11:25.958 GMT [34] LOG:  received fast shutdown request
db_1                      | waiting for server to shut down....2020-06-09 08:11:25.962 GMT [34] LOG:  aborting any active transactions
db_1                      | 2020-06-09 08:11:25.965 GMT [34] LOG:  background worker "logical replication launcher" (PID 41) exited with exit code 1
db_1                      | 2020-06-09 08:11:25.966 GMT [36] LOG:  shutting down
db_1                      | 2020-06-09 08:11:25.979 GMT [34] LOG:  database system is shut down
db_1                      |  done
db_1                      | server stopped
db_1                      | 
db_1                      | PostgreSQL init process complete; ready for start up.
db_1                      | 
db_1                      | 2020-06-09 08:11:26.078 GMT [1] LOG:  starting PostgreSQL 12.2 on x86_64-pc-linux-musl, compiled by gcc (Alpine 9.2.0) 9.2.0, 64-bit
db_1                      | 2020-06-09 08:11:26.079 GMT [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db_1                      | 2020-06-09 08:11:26.080 GMT [1] LOG:  listening on IPv6 address "::", port 5432
db_1                      | 2020-06-09 08:11:26.089 GMT [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1                      | 2020-06-09 08:11:26.346 GMT [45] LOG:  database system was shut down at 2020-06-09 08:11:25 GMT
db_1                      | 2020-06-09 08:11:26.350 GMT [46] FATAL:  the database system is starting up
db_1                      | 2020-06-09 08:11:26.356 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: Merging found configuration files in /opt/odoo/auto/odoo.conf
odoo_1                    | doodba INFO: Executing odoo --limit-memory-soft=0 --limit-time-real-cron=9999999 --limit-time-real=9999999 --workers=0 --dev=reload,qweb,werkzeug,xml
odoo_1                    | Traceback (most recent call last):
odoo_1                    |   File "/opt/odoo/common/entrypoint", line 61, in <module>
odoo_1                    |     os.execvp(extra_command[0], extra_command)
odoo_1                    |   File "/usr/local/lib/python3.6/os.py", line 559, in execvp
odoo_1                    |     _execvpe(file, args)
odoo_1                    |   File "/usr/local/lib/python3.6/os.py", line 604, in _execvpe
odoo_1                    |     raise last_exc.with_traceback(tb)
odoo_1                    |   File "/usr/local/lib/python3.6/os.py", line 594, in _execvpe
odoo_1                    |     exec_func(fullname, *argrest)
odoo_1                    | FileNotFoundError: [Errno 2] No such file or directory
pass_odoo_1 exited with code 1
yajo commented 4 years ago

Duplicate of https://github.com/Tecnativa/doodba-copier-template/issues/60.

yajo commented 4 years ago

BTW, https://github.com/Tecnativa/doodba-copier-template/issues/60 is yours too @bosd, please don't open duplicate issues. :sweat_smile:

bosd commented 4 years ago

I understand it seems confusing. I'm pretty new to this. Will try to make my steps as clear as possible. I think this issue could be related to Tecnativa/doodba-copier-template#60, although this one is on another host system. Different variables, different odoo version.. will comment on this one first. Let's keep this one focussed on the password error.

As per previous steps it throws an error. I proceeded to start up the test environment.

docker-compose -f test.yaml up

the result is:

odoo_1  | doodba INFO: Waiting until postgres is listening at db...
db_1    | 2020-06-09 09:45:43.092 GMT [27] FATAL:  password authentication failed for user "odoo"
db_1    | 2020-06-09 09:45:43.092 GMT [27] DETAIL:  Password does not match for user "odoo".

Strange, as I clearly set the password to "something" with the copier. so I stopped the instance.. go to look inside the container what is happening.

docker-compose run --rm odoo bash inside the container:

odoo@97f5f35cb8d5:/opt/odoo$  cd auto
odoo@97f5f35cb8d5:/opt/odoo$  nano odoo.conf

inside the odoo.conf file I find the line: db_password = odoopassword which is the default password of the copier step.

So if I am not mistaking, this should contain the password, I provided during the copier step which is: db_password = something

Update: for completion the password "something" is populated in the /.docker files db-access.env reads PGPASSWORD=something

db-creation.env reads POSTGRES_PASSWORD=something