Tecnativa / doodba

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

Odoo 15.0 flanker installation seems incomplete #486

Closed ap-wtioit closed 2 years ago

ap-wtioit commented 2 years ago

Describe the bug

When running docker-compose -f devel.yaml run --rm odoo odoo -i mail --stop-after-init during installation of mail addon it seems that on the first import of flanker it tries to create some stuff that is forbidden to be created at this time:

odoo_1                        | 2022-03-08 15:05:44,678 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'mailbox_or_url_list' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,678 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'delim' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,678 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'mailbox_or_url' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,678 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'url' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,682 1 WARNING devel flanker.addresslib._parser.parser: Couldn't create 'flanker.addresslib._parser.mailbox_parsetab'. [Errno 13] Permission denied: '/usr/local/lib/python3.8/site-packages/flanker/addresslib/_parser/mailbox_parsetab.py' 
odoo_1                        | 2022-03-08 15:05:44,684 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'mailbox_or_url_list' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,684 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'delim' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,684 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'mailbox_or_url' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,685 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'mailbox' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,685 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'url' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,685 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'angle_addr' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,685 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'name_addr' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,685 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'phrase' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,687 1 WARNING devel flanker.addresslib._parser.parser: Couldn't create 'flanker.addresslib._parser.addr_spec_parsetab'. [Errno 13] Permission denied: '/usr/local/lib/python3.8/site-packages/flanker/addresslib/_parser/addr_spec_parsetab.py' 
odoo_1                        | 2022-03-08 15:05:44,689 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'mailbox_or_url_list' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,689 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'delim' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,689 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'mailbox_or_url' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,689 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'mailbox' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,689 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'addr_spec' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,689 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'angle_addr' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,690 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'name_addr' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,690 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'phrase' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,690 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'local_part' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,690 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'domain' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,690 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'quoted_string' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,690 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'domain_literal' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,690 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'quoted_string_text' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,690 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'domain_literal_text' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,691 1 WARNING devel flanker.addresslib._parser.parser: Couldn't create 'flanker.addresslib._parser.url_parsetab'. [Errno 13] Permission denied: '/usr/local/lib/python3.8/site-packages/flanker/addresslib/_parser/url_parsetab.py' 
odoo_1                        | 2022-03-08 15:05:44,694 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'mailbox_or_url_list' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,694 1 WARNING devel flanker.addresslib._parser.parser: Symbol 'delim' is unreachable 
odoo_1                        | 2022-03-08 15:05:44,698 1 WARNING devel flanker.addresslib._parser.parser: Couldn't create 'flanker.addresslib._parser.mailbox_or_url_parsetab'. [Errno 13] Permission denied: '/usr/local/lib/python3.8/site-packages/flanker/addresslib/_parser/mailbox_or_url_parsetab.py' 
odoo_1                        | 2022-03-08 15:05:44,706 1 WARNING devel flanker.addresslib._parser.parser: Couldn't create 'flanker.addresslib._parser.mailbox_or_url_list_parsetab'. [Errno 13] Permission denied: '/usr/local/lib/python3.8/site-packages/flanker/addresslib/_parser/mailbox_or_url_list_parsetab.py' 
odoo_1                        | 2022-03-08 15:05:44,921 1 INFO devel odoo.modules.registry: module mail: creating or updating database tables 

To Reproduce

Affected versions:

Steps to reproduce the behavior:

  1. Use doodba with version 15.0
  2. install base module

Expected behavior

Flanker should work without permission errors in doodba

ap-wtioit commented 2 years ago

I intend to investigate this further and provide a fix. Currently i guess that we need to import flanker once during install (when we still have enough permissions for flanker to do its post install stuff).

Possibly related (could also be a flanker issue):

Flanker version installed:

docker run --rm tecnativa/doodba:15.0 pip freeze | grep flanker

shows flanker==0.9.11

Seems to match: https://github.com/mailgun/flanker/issues/208#issuecomment-579873411

pedrobaeza commented 2 years ago

Thanks for checking it. Yeah, I was aware of this yesterday, but didn't investigate further. It's ugly all the log, but the system is working at the end. @Yajo you introduced this library in #472. Any thought?

yajo commented 2 years ago

Yes, I saw these warnings and indeed are annoying. However I didn't have any more time to investigate. Odoo added it as a lazy dependency, but there are no docs whatsoever about how to configure it, or which version to install. 🙄

ap-wtioit commented 2 years ago

i tested the fix in #487 yesterday on our systems, and now the permission error is gone, and the other flanker warning only appear during build of doodba 15.0 base image not on every start of the container

pedrobaeza commented 2 years ago

There's no way to avoid such warnings at all?

ap-wtioit commented 2 years ago

I guess there would be running python3 -c 'from flanker.addresslib import address' >/dev/null instead of python3 -c 'from flanker.addresslib import address'. For me the [Errno 13] Permission denied is the main reason for the fix.

2022-03-04 10:11:01,038 1 WARNING prod flanker.addresslib._parser.parser: Couldn't create 'flanker.addresslib._parser.addr_spec_parsetab'. [Errno 13] Permission denied: '/usr/local/lib/python3.8/site-packages/flanker/addresslib/_parser/addr_spec_parsetab.py'

It pops up a lot in our logs and i try to detect the more successful hacking attempts early. A lot of false positive Errno 13 are a bit annoying for that.

pedrobaeza commented 2 years ago

Yeah, I agree. I wonder if there's a runnable in the library for pre-creating such entries instead of being created on first import with the warning.

ap-wtioit commented 2 years ago

Well strictly speaking it's (the warnings) a flanker issue https://github.com/mailgun/flanker/issues/231 and should be fixed there, but as it did not get fixed within a few years, i think the workaround in doodba is justified. (The permission errors are a different flanker issue)

pedrobaeza commented 2 years ago

OK, seems weird that nobody attends such issue, but let's workaround it here silencing the warning output in the build as you have said.

carlosdauden commented 2 years ago

Solved here: https://github.com/Tecnativa/doodba/pull/487