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

[BUG] Permissions issue on sources #111

Closed lasley closed 6 years ago

lasley commented 6 years ago

So I finally was getting around to switching over from my fork, and I'm noticing a permissions issue on the source directories, which causes the following error:

odoo_1  | INFO:docker-odoo-base:Linking all addons from /opt/odoo/custom/src/addons.yaml in /opt/odoo/auto/addons
odoo_1  | INFO:docker-odoo-base:File /opt/odoo/auto/odoo.conf exists, skipping config generation
odoo_1  | INFO:docker-odoo-base:Executing /usr/local/bin/odoo
odoo_1  | Traceback (most recent call last):
odoo_1  |   File "/usr/local/bin/odoo", line 4, in <module>
odoo_1  |     __import__('pkg_resources').require('odoo==9.0rc0')
odoo_1  |   File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3147, in <module>
odoo_1  |     @_call_aside
odoo_1  |   File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3131, in _call_aside
odoo_1  |     f(*args, **kwargs)
odoo_1  |   File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3160, in _initialize_master_working_set
odoo_1  |     working_set = WorkingSet._build_master()
odoo_1  |   File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 666, in _build_master
odoo_1  |     ws.require(__requires__)
odoo_1  |   File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 984, in require
odoo_1  |     needed = self.resolve(parse_requirements(requirements))
odoo_1  |   File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 870, in resolve
odoo_1  |     raise DistributionNotFound(req, requirers)
odoo_1  | pkg_resources.DistributionNotFound: The 'odoo==9.0rc0' distribution was not found and is required by the application

Replication steps:

cd $DOODBA/tests/scaffoldings/smallest
export ODOO_MINOR=9.0
export DB_VERSION=9.6
docker-compose up

And here's why:

odoo@5996499366b1:/opt/odoo$ ls -l custom/src/
ls: cannot access custom/src/odoo: Permission denied
ls: cannot access custom/src/private: Permission denied
total 4
-rwxr-x--- 1 root odoo   0 Jan  9 18:45 addons.yaml
d????????? ? ?    ?      ?            ? odoo
d????????? ? ?    ?      ?            ? private
-rwxr-x--- 1 root odoo 308 Jan  9 18:45 repos.yaml

Interestingly, logging into root then su-ing over it's fine:

root@bf51749a10eb:/opt/odoo# su odoo -s /bin/bash
odoo@bf51749a10eb:/opt/odoo$ ls -l custom/src/
total 12
-rwxr-x---  1 root odoo    0 Jan  9 18:45 addons.yaml
drwxr-x--- 12 root odoo 4096 Jan  9 19:09 odoo
drwxr-x---  2 root odoo 4096 Jan  9 19:10 private
-rwxr-x---  1 root odoo  308 Jan  9 18:45 repos.yaml

It looks like Odoo is not part of the proper group if catting groups:

odoo@bf51749a10eb:/opt/odoo$ cat /etc/group | grep odoo
odoo:x:1000:

But groups command shows otherwise:

odoo@bf51749a10eb:/opt/odoo$ groups
odoo

So yeah that's about how far I've gotten. I'll report back when I find a solution.

yajo commented 6 years ago

Yikes, this seems related with the recent #109 that broke travis

yajo commented 6 years ago

I have tested and I cannot replicate your problem. I think you looked for the user groups in the wrong place:

odoo@39cc77e9d184:/opt/odoo$ grep odoo /etc/passwd
odoo:x:1000:1000::/home/odoo:/bin/false

I repeated all of your steps and all produced the expected results. I'm suspecting there might be a AppArmor/SELinux/OS/package problem. Are you by chance using Ubuntu in the same version as Travis does?

yajo commented 6 years ago

109 was fixed, does this still happen to you?

lasley commented 6 years ago

@Yajo /etc/passwd is the user definition file, /etc/group is the group. Here's some good reading (I threw in the shadows file too):

I'm suspecting there might be a AppArmor/SELinux/OS/package problem. Are you by chance using Ubuntu in the same version as Travis does?

Yeah, this was on Ubuntu 16.x LTS. I just tried on Mac High Sierra and cannot reproduce the issue.

109 was fixed, does this still happen to you?

It is still readily reproducible on Ubuntu. You're probably right then, although I'm somewhat confused as to why AppArmor on the host system would be interfering with something in the Docker namespace. I don't see any logs either, but it's possible those are disabled. This is the /etc/apparmor.d/docker though:

profile docker-default flags=(attach_disconnected,mediate_deleted,complain) {

  #include <abstractions/base>

  network,
  capability,
  file,
  umount,

  deny @{PROC}/* w,   # deny write for all files directly in /proc (not in a subdir)
  # deny write to files not in /proc/<number>/** or /proc/sys/**
  deny @{PROC}/{[^1-9],[^1-9][^0-9],[^1-9s][^0-9y][^0-9s],[^1-9][^0-9][^0-9][^0-9]*}/** w,
  deny @{PROC}/sys/[^k]** w,  # deny /proc/sys except /proc/sys/k* (effectively /proc/sys/kernel)
  deny @{PROC}/sys/kernel/{?,??,[^s][^h][^m]**} w,  # deny everything except shm* in /proc/sys/kernel/
  deny @{PROC}/sysrq-trigger rwklx,
  deny @{PROC}/mem rwklx,
  deny @{PROC}/kmem rwklx,
  deny @{PROC}/kcore rwklx,

  deny mount,

  deny /sys/[^f]*/** wklx,
  deny /sys/f[^s]*/** wklx,
  deny /sys/fs/[^c]*/** wklx,
  deny /sys/fs/c[^g]*/** wklx,
  deny /sys/fs/cg[^r]*/** wklx,
  deny /sys/firmware/efi/efivars/** rwklx,
  deny /sys/kernel/security/** rwklx,

  # suppress ptrace denials when using 'docker ps' or using 'ps' inside a container
  ptrace (trace,read) peer=docker-default,

}
yajo commented 6 years ago

Well, Docker does many rooty thingies, and a good way of blocking them is precisely AppArmor or SELinux. I'm more a SELinux user, so I don't really know how to help you, but my first guess would be to just disable apparmor (there must be a way) and try again. If the problem goes away, you know the culprit now. In any case, there are no mounted volumes, so I don't know why should that interfere... However I noticed there's no build step in your STR. Is it possible that you're using an old version? Try a docker-compose build --pull before.

lasley commented 6 years ago

Oops forgot to report back on this yesterday. I disabled AppArmor and am seeing the same results.

However I noticed there's no build step in your STR. Is it possible that you're using an old version? Try a docker-compose build --pull before.

I didn't specifically pull, but I'm pretty sure I saw it pull (I have docker-gc running pretty liberally on this box). In the interest of leaving no stone unturned though, I did a docker pull tecnativa/odoo-base:9.0 then the replication steps again.

Pull and subsequent build confirmed, issue still present (AppArmor still disabled) 😦

yajo commented 6 years ago

Could you try docker image rm tecnativa/odoo-base:9.0 (and other tags) and then docker-compose build --pull?

lasley commented 6 years ago

Still getting the same results unfortunately. Here's the output:

```bash root@odoo-dev-10:~# docker image rm tecnativa/odoo-base:9.0 Error: No such image: tecnativa/odoo-base:9.0 root@odoo-dev-10:~# docker images -a REPOSITORY TAG IMAGE ID CREATED SIZE laslabs/odoo-upgrade 10.0 efd6158ecf37 4 days ago 1.39GB lasley/odoo-buildouts laslabs-10 1425b06c81ba 4 days ago 1.72GB postgres 9.6-alpine 23c1fbd604c0 6 weeks ago 37.8MB rancher/server stable f61683a6ad09 6 weeks ago 968MB rancher/net v0.13.5 b8483c391885 7 weeks ago 304MB rancher/network-manager v0.7.18 b71d80be1fd1 2 months ago 250MB rancher/agent v1.2.7 9a2671419950 2 months ago 237MB spotify/docker-gc latest 50f3b75aeb06 2 months ago 26.3MB rancher/metadata v0.9.5 bd33f8c865b1 2 months ago 251MB lasley/odoo-buildouts smd-9 d634381237ef 4 months ago 1.85GB rancher/dns v0.15.3 2779a18358f2 5 months ago 240MB rancher/healthcheck v0.3.3 14de771cc178 5 months ago 385MB rancher/scheduler v0.8.2 690ef14a99b7 6 months ago 242MB rancher/net holder 665d9f6e8cc1 9 months ago 267MB root@odoo-dev-10:~# cd /media/sf_Repos/docker-odoo-base/ bin/ build.d/ conf.d/ entrypoint.d/ .git/ hooks/ lib/ odoo/ tests/ root@odoo-dev-10:~# cd /media/sf_Repos/docker-odoo-base/tests/scaffoldings/smallest/ root@odoo-dev-10:/media/sf_Repos/docker-odoo-base/tests/scaffoldings/smallest# export ODOO_MINOR=9.0 root@odoo-dev-10:/media/sf_Repos/docker-odoo-base/tests/scaffoldings/smallest# export DB_VERSION=9.6 root@odoo-dev-10:/media/sf_Repos/docker-odoo-base/tests/scaffoldings/smallest# docker-compose build --pull && docker-compose up ... pull & build truncated - no obvious errors though ... Attaching to smallest_db_1, smallest_odoo_1 db_1 | LOG: database system was shut down at 2018-01-11 17:43:57 UTC db_1 | LOG: MultiXact member wraparound protections are now enabled db_1 | LOG: database system is ready to accept connections db_1 | LOG: autovacuum launcher started odoo_1 | ker-odoo-base:Waiting until postgres is listening at db... odoo_1 | INFO:docker-odoo-base:Linking all addons from /opt/odoo/custom/src/addons.yaml in /opt/odoo/auto/addons odoo_1 | INFO:docker-odoo-base:File /opt/odoo/auto/odoo.conf exists, skipping config generation odoo_1 | INFO:docker-odoo-base:Executing /usr/local/bin/odoo odoo_1 | Traceback (most recent call last): odoo_1 | File "/usr/local/bin/odoo", line 4, in odoo_1 | __import__('pkg_resources').require('odoo==9.0rc0') odoo_1 | File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3147, in odoo_1 | @_call_aside odoo_1 | File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3131, in _call_aside odoo_1 | f(*args, **kwargs) odoo_1 | File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3160, in _initialize_master_working_set odoo_1 | working_set = WorkingSet._build_master() odoo_1 | File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 666, in _build_master odoo_1 | ws.require(__requires__) odoo_1 | File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 984, in require odoo_1 | needed = self.resolve(parse_requirements(requirements)) odoo_1 | File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 870, in resolve odoo_1 | raise DistributionNotFound(req, requirers) odoo_1 | pkg_resources.DistributionNotFound: The 'odoo==9.0rc0' distribution was not found and is required by the application ```
yajo commented 6 years ago

Amazing, I do exactly the same commands and it works perfectly... Let's debug even further:

  1. Please add LOG_LEVEL=DEBUG to build args in the docker-compose.yml file and provide build logs.
  2. Please provide output of docker-compose run --rm --no-deps odoo ls -lZAR

I want to check permission and labeling issues.

BTW, to reduce cluttering: https://gist.github.com/ericclemmons/b146fe5da72ca1f706b2ef72a20ac39d πŸ˜‰

MaskedBelgian commented 6 years ago

Did you try to update the Base module ? I had an issue where after a migration from V8 to V9, Odoo couldn't reach any ressources. -u base solved this issue.

Maybe the image of odoo9 we pull should be updated ?

lasley commented 6 years ago

@MaskedBelgian - there is no database at this point to upgrade. Odoo is failing to launch due to permissions issues on the sources directory.

@Yajo - logs below:

Build ```bash root@odoo-dev-10:/media/sf_Repos/docker-odoo-base/tests/scaffoldings/smallest# docker-compose build --pull db uses an image, skipping Building odoo Step 1/1 : FROM tecnativa/odoo-base:9.0 9.0: Pulling from tecnativa/odoo-base f49cf87b52c1: Already exists 487a0c1a3675: Pull complete 30ac3666d52a: Pull complete 253d501c7075: Pull complete 70dc4f76fd3b: Pull complete b854836c9fae: Pull complete c05d2432d97d: Pull complete 547dc446998c: Pull complete f8d040003584: Pull complete 27c532139d5b: Pull complete 5521bae8a11a: Pull complete 76e52ddc86a6: Pull complete 27c0b901e810: Pull complete 9db302315862: Pull complete cd2de998895b: Pull complete 0aa93a90d95e: Pull complete a62474dc0aea: Pull complete Digest: sha256:a5fa7433b87e71f8b6c436d580857daaa910cc2e4d712c9a361e0219e80d3115 Status: Downloaded newer image for tecnativa/odoo-base:9.0 # Executing 27 build triggers... Step 1/1 : ENTRYPOINT /opt/odoo/common/entrypoint ---> Running in f834d79bfe38 Step 1/1 : CMD /usr/local/bin/odoo ---> Running in d369895c37b7 Step 1/1 : ARG AGGREGATE=true ---> Running in ebb910cda269 Step 1/1 : ARG AUTO_REQUIREMENTS=false ---> Running in a6e31d1d5539 Step 1/1 : ARG DEPTH_DEFAULT=1 ---> Running in 8be719bd32cf Step 1/1 : ARG DEPTH_MERGE=100 ---> Running in 3922a51b62b3 Step 1/1 : ARG CLEAN=true ---> Running in 906be62f35d4 Step 1/1 : ARG COMPILE=true ---> Running in d677c2b56aa3 Step 1/1 : ARG CONFIG_BUILD=true ---> Running in 50b04bfc6bc9 Step 1/1 : ARG PIP_INSTALL_ODOO=true ---> Running in fa576a794e31 Step 1/1 : ARG ADMIN_PASSWORD=admin ---> Running in c64fc0022e6b Step 1/1 : ARG SMTP_SERVER=smtp ---> Running in 8921a424bd9f Step 1/1 : ARG PROXY_MODE=false ---> Running in 417a04bb44c4 Step 1/1 : ARG WITHOUT_DEMO=all ---> Running in 820ca93eb23b Step 1/1 : ARG PYTHONOPTIMIZE=1 ---> Running in d2d5c5f1b9e4 Step 1/1 : ENV PYTHONOPTIMIZE "$PYTHONOPTIMIZE" ---> Running in ff8ab3e8a0a0 Step 1/1 : ARG PGUSER=odoo ---> Running in 73c738d1bd0d Step 1/1 : ARG PGPASSWORD=odoopassword ---> Running in b17714bd2b4b Step 1/1 : ARG PGHOST=db ---> Running in f0795efd1bf9 Step 1/1 : ARG PGDATABASE=prod ---> Running in 4ca44c251f86 Step 1/1 : ENV ADMIN_PASSWORD "$ADMIN_PASSWORD" UNACCENT "$UNACCENT" PGUSER "$PGUSER" PGPASSWORD "$PGPASSWORD" PGHOST "$PGHOST" PGDATABASE "$PGDATABASE" PROXY_MODE "$PROXY_MODE" SMTP_SERVER "$SMTP_SERVER" WITHOUT_DEMO "$WITHOUT_DEMO" ---> Running in 568dcfa1bdc6 Step 1/1 : ARG LOCAL_CUSTOM_DIR=./custom ---> Running in de44e9251f02 Step 1/1 : COPY $LOCAL_CUSTOM_DIR /opt/odoo/custom Step 1/1 : ARG LOG_LEVEL=INFO ---> Running in c5a1fa693ca8 Step 1/1 : RUN mkdir -p /opt/odoo/custom/ssh && ln -s /opt/odoo/custom/ssh ~root/.ssh && chmod -R u=rwX,go= /opt/odoo/custom/ssh && sync ---> Running in 654e28f05172 Step 1/1 : RUN /opt/odoo/common/build && sync ---> Running in 14a9a82203c1 DEBUG:docker-odoo-base:Executing /opt/odoo/common/build.d/100-repos-aggregate INFO:docker-odoo-base:Aggregating repositories from /opt/odoo/custom/src/repos.yaml (INFO) [17:01:31] git_aggregator.repo Start aggregation of /opt/odoo/custom/src/odoo (INFO) [17:01:31] git_aggregator.repo Init empty git repository in /opt/odoo/custom/src/odoo Initialized empty Git repository in /opt/odoo/custom/src/odoo/.git/ (INFO) [17:01:31] git_aggregator.repo Switch to branch 9.0 Switched to a new branch '9.0' (INFO) [17:01:31] git_aggregator.repo Adding remote ocb (INFO) [17:01:31] git_aggregator.repo Adding remote odoo (INFO) [17:01:31] git_aggregator.repo Fetching required remotes From https://github.com/OCA/OCB * branch 9.0 -> FETCH_HEAD * [new branch] 9.0 -> ocb/9.0 (INFO) [17:01:04] git_aggregator.repo Pull ocb, 9.0 (INFO) [17:01:12] git_aggregator.repo Execute shell after commands (INFO) [17:01:12] git_aggregator.repo End aggregation of /opt/odoo/custom/src/odoo DEBUG:docker-odoo-base:Executing /opt/odoo/common/build.d/200-dependencies INFO:docker-odoo-base:No installable requirements found in /opt/odoo/custom/dependencies/apt_build.txt INFO:docker-odoo-base:No installable requirements found in /opt/odoo/custom/dependencies/npm.txt INFO:docker-odoo-base:No installable requirements found in /opt/odoo/custom/dependencies/pip.txt INFO:docker-odoo-base:No installable requirements found in /opt/odoo/custom/dependencies/gem.txt INFO:docker-odoo-base:No installable requirements found in /opt/odoo/custom/dependencies/apt.txt DEBUG:docker-odoo-base:Executing /opt/odoo/common/build.d/400-clean DEBUG:docker-odoo-base:Auto-adding all addons from odoo/addons DEBUG:docker-odoo-base:Auto-adding all addons from private DEBUG:docker-odoo-base:Resulting configuration: {'account_cancel': set(['odoo/addons']), 'rating': set(['odoo/addons']), 'mrp_repair': set(['odoo/addons']), 'product_extended': set(['odoo/addons']), 'website_sale': set(['odoo/addons']), 'account_voucher': set(['odoo/addons']), 'theme_bootswatch': set(['odoo/addons']), 'l10n_cn_small_business': set(['odoo/addons']), 'hr_equipment': set(['odoo/addons']), 'pos_restaurant': set(['odoo/addons']), 'hw_screen': set(['odoo/addons']), 'website_mass_mailing': set(['odoo/addons']), 'website_issue': set(['odoo/addons']), 'crm_project_issue': set(['odoo/addons']), 'web_analytics': set(['odoo/addons']), 'web': set(['odoo/addons']), 'website_gengo': set(['odoo/addons']), 'l10n_ec': set(['odoo/addons']), 'purchase_requisition': set(['odoo/addons']), 'website_portal': set(['odoo/addons']), 'web_tip': set(['odoo/addons']), 'pos_reprint': set(['odoo/addons']), 'analytic': set(['odoo/addons']), 'website_forum_doc': set(['odoo/addons']), 'hw_escpos': set(['odoo/addons']), 'sale_order_dates': set(['odoo/addons']), 'website_sale_delivery': set(['odoo/addons']), 'hw_blackbox_be': set(['odoo/addons']), 'anonymization': set(['odoo/addons']), 'sale_service': set(['odoo/addons']), 'marketing_campaign': set(['odoo/addons']), 'l10n_gt': set(['odoo/addons']), 'base_iban': set(['odoo/addons']), 'hw_scale': set(['odoo/addons']), 'im_odoo_support': set(['odoo/addons']), 'base_import': set(['odoo/addons']), 'l10n_tr': set(['odoo/addons']), 'auth_oauth': set(['odoo/addons']), 'web_view_editor': set(['odoo/addons']), 'website_event_questions': set(['odoo/addons']), 'lunch': set(['odoo/addons']), 'website_mail': set(['odoo/addons']), 'account_budget': set(['odoo/addons']), 'l10n_generic_coa': set(['odoo/addons']), 'report': set(['odoo/addons']), 'l10n_nz': set(['odoo/addons']), 'hr_payroll_account': set(['odoo/addons']), 'crm_partner_assign': set(['odoo/addons']), 'l10n_ve': set(['odoo/addons']), 'l10n_no': set(['odoo/addons']), 'portal_sale': set(['odoo/addons']), 'product_margin': set(['odoo/addons']), 'website_hr': set(['odoo/addons']), 'survey_crm': set(['odoo/addons']), 'stock_dropshipping': set(['odoo/addons']), 'l10n_fr_certification': set(['odoo/addons']), 'hw_proxy': set(['odoo/addons']), 'hr_recruitment': set(['odoo/addons']), 'project_issue_sheet': set(['odoo/addons']), 'pos_mercury': set(['odoo/addons']), 'l10n_uk': set(['odoo/addons']), 'payment_transfer': set(['odoo/addons']), 'l10n_fr': set(['odoo/addons']), 'sale_layout': set(['odoo/addons']), 'crm': set(['odoo/addons']), 'stock_picking_wave': set(['odoo/addons']), 'account_tax_exigible': set(['odoo/addons']), 'website_quote': set(['odoo/addons']), 'fetchmail': set(['odoo/addons']), 'account': set(['odoo/addons']), 'project_timesheet': set(['odoo/addons']), 'account_full_reconcile': set(['odoo/addons']), 'sale_mrp': set(['odoo/addons']), 'mass_mailing': set(['odoo/addons']), 'point_of_sale': set(['odoo/addons']), 'base_import_module': set(['odoo/addons']), 'website_event_track': set(['odoo/addons']), 'account_accountant': set(['odoo/addons']), 'google_account': set(['odoo/addons']), 'event': set(['odoo/addons']), 'l10n_es': set(['odoo/addons']), 'l10n_be_hr_payroll_account': set(['odoo/addons']), 'l10n_et': set(['odoo/addons']), 'website_partner': set(['odoo/addons']), 'website_theme_install': set(['odoo/addons']), 'l10n_th': set(['odoo/addons']), 'website_slides': set(['odoo/addons']), 'base_action_rule': set(['odoo/addons']), 'web_editor': set(['odoo/addons']), 'web_settings_dashboard': set(['odoo/addons']), 'gamification': set(['odoo/addons']), 'gamification_sale_crm': set(['odoo/addons']), 'im_livechat': set(['odoo/addons']), 'payment_adyen': set(['odoo/addons']), 'hw_scanner': set(['odoo/addons']), 'account_test': set(['odoo/addons']), 'account_analytic_default': set(['odoo/addons']), 'l10n_in_schedule6': set(['odoo/addons']), 'l10n_mx': set(['odoo/addons']), 'account_tax_adjustments': set(['odoo/addons']), 'marketing': set(['odoo/addons']), 'auth_ldap': set(['odoo/addons']), 'link_tracker': set(['odoo/addons']), 'sale_crm': set(['odoo/addons']), 'account_extra_reports': set(['odoo/addons']), 'fleet': set(['odoo/addons']), 'l10n_lu': set(['odoo/addons']), 'website_google_map': set(['odoo/addons']), 'decimal_precision': set(['odoo/addons']), 'payment_sips': set(['odoo/addons']), 'l10n_de_skr04': set(['odoo/addons']), 'account_tax_python': set(['odoo/addons']), 'l10n_eu_service': set(['odoo/addons']), 'google_spreadsheet': set(['odoo/addons']), 'rating_project_issue': set(['odoo/addons']), 'resource': set(['odoo/addons']), 'l10n_fr_sale_closing': set(['odoo/addons']), 'hr_holidays': set(['odoo/addons']), 'website_sale_digital': set(['odoo/addons']), 'l10n_de': set(['odoo/addons']), 'l10n_cl': set(['odoo/addons']), 'survey': set(['odoo/addons']), 'website_portal_sale': set(['odoo/addons']), 'l10n_be_hr_payroll': set(['odoo/addons']), 'website_crm': set(['odoo/addons']), 'l10n_pe': set(['odoo/addons']), 'l10n_do': set(['odoo/addons']), 'rating_project': set(['odoo/addons']), 'procurement_jit': set(['odoo/addons']), 'l10n_be_intrastat': set(['odoo/addons']), 'account_bank_statement_import': set(['odoo/addons']), 'l10n_co': set(['odoo/addons']), 'website_twitter': set(['odoo/addons']), 'website_links': set(['odoo/addons']), 'google_calendar': set(['odoo/addons']), 'sale_timesheet': set(['odoo/addons']), 'l10n_de_skr03': set(['odoo/addons']), 'website_customer': set(['odoo/addons']), 'l10n_sg': set(['odoo/addons']), 'website_form': set(['odoo/addons']), 'l10n_sa': set(['odoo/addons']), 'product_expiry': set(['odoo/addons']), 'product_uos': set(['odoo/addons']), 'account_asset': set(['odoo/addons']), 'website_rating_project_issue': set(['odoo/addons']), 'l10n_hu': set(['odoo/addons']), 'l10n_si': set(['odoo/addons']), 'barcodes': set(['odoo/addons']), 'l10n_ca': set(['odoo/addons']), 'website_crm_claim': set(['odoo/addons']), 'base_geolocalize': set(['odoo/addons']), 'auth_crypt': set(['odoo/addons']), 'l10n_cn': set(['odoo/addons']), 'payment_authorize': set(['odoo/addons']), 'l10n_ch': set(['odoo/addons']), 'payment': set(['odoo/addons']), 'note_pad': set(['odoo/addons']), 'l10n_fr_hr_payroll': set(['odoo/addons']), 'l10n_vn': set(['odoo/addons']), 'website_membership': set(['odoo/addons']), 'l10n_us': set(['odoo/addons']), 'board': set(['odoo/addons']), 'event_sale': set(['odoo/addons']), 'payment_buckaroo': set(['odoo/addons']), 'pos_discount': set(['odoo/addons']), 'l10n_cr': set(['odoo/addons']), 'hr': set(['odoo/addons']), 'bus': set(['odoo/addons']), 'hr_timesheet': set(['odoo/addons']), 'report_intrastat': set(['odoo/addons']), 'sale_expense': set(['odoo/addons']), 'delivery': set(['odoo/addons']), 'web_kanban_gauge': set(['odoo/addons']), 'mail': set(['odoo/addons']), 'l10n_ro': set(['odoo/addons']), 'product_email_template': set(['odoo/addons']), 'document': set(['odoo/addons']), 'website_project_issue_sheet': set(['odoo/addons']), 'subscription': set(['odoo/addons']), 'website_forum': set(['odoo/addons']), 'hr_expense': set(['odoo/addons']), 'l10n_be': set(['odoo/addons']), 'web_diagram': set(['odoo/addons']), 'hw_posbox_homepage': set(['odoo/addons']), 'account_check_printing': set(['odoo/addons']), 'base_vat': set(['odoo/addons']), 'l10n_bo': set(['odoo/addons']), 'sale_stock': set(['odoo/addons']), 'l10n_in_hr_payroll': set(['odoo/addons']), 'l10n_fr_fec': set(['odoo/addons']), 'web_kanban': set(['odoo/addons']), 'utm': set(['odoo/addons']), 'project': set(['odoo/addons']), 'marketing_campaign_crm_demo': set(['odoo/addons']), 'website_livechat': set(['odoo/addons']), 'l10n_br': set(['odoo/addons']), 'hr_gamification': set(['odoo/addons']), 'auth_signup': set(['odoo/addons']), 'l10n_uy': set(['odoo/addons']), 'website_sale_options': set(['odoo/addons']), 'website_event_sale': set(['odoo/addons']), 'l10n_cn_standard': set(['odoo/addons']), 'website': set(['odoo/addons']), 'hr_contract': set(['odoo/addons']), 'mrp_operations': set(['odoo/addons']), 'l10n_in': set(['odoo/addons']), 'l10n_jp': set(['odoo/addons']), 'payment_paypal': set(['odoo/addons']), 'portal_gamification': set(['odoo/addons']), 'l10n_it': set(['odoo/addons']), 'warning': set(['odoo/addons']), 'base_gengo': set(['odoo/addons']), 'claim_from_delivery': set(['odoo/addons']), 'crm_claim': set(['odoo/addons']), 'stock_landed_costs': set(['odoo/addons']), 'association': set(['odoo/addons']), 'calendar': set(['odoo/addons']), 'hr_payroll': set(['odoo/addons']), 'website_crm_partner_assign': set(['odoo/addons']), 'base_setup': set(['odoo/addons']), 'website_event': set(['odoo/addons']), 'procurement': set(['odoo/addons']), 'product_visible_discount': set(['odoo/addons']), 'hw_posbox_upgrade': set(['odoo/addons']), 'website_project_issue': set(['odoo/addons']), 'website_hr_recruitment': set(['odoo/addons']), 'account_tax_cash_basis': set(['odoo/addons']), 'note': set(['odoo/addons']), 'l10n_be_invoice_bba': set(['odoo/addons']), 'pad': set(['odoo/addons']), 'website_blog': set(['odoo/addons']), 'report_webkit': set(['odoo/addons']), 'mrp_byproduct': set(['odoo/addons']), 'l10n_syscohada': set(['odoo/addons']), 'l10n_at': set(['odoo/addons']), 'l10n_au': set(['odoo/addons']), 'l10n_ar': set(['odoo/addons']), 'sale_margin': set(['odoo/addons']), 'stock': set(['odoo/addons']), 'portal_stock': set(['odoo/addons']), 'product': set(['odoo/addons']), 'website_payment': set(['odoo/addons']), 'l10n_pt': set(['odoo/addons']), 'l10n_ae': set(['odoo/addons']), 'hr_attendance': set(['odoo/addons']), 'project_issue': set(['odoo/addons']), 'l10n_multilang': set(['odoo/addons']), 'payment_ogone': set(['odoo/addons']), 'web_calendar': set(['odoo/addons']), 'l10n_pa': set(['odoo/addons']), 'membership': set(['odoo/addons']), 'portal': set(['odoo/addons']), 'stock_calendar': set(['odoo/addons']), 'pos_cache': set(['odoo/addons']), 'l10n_nl': set(['odoo/addons']), 'l10n_pl': set(['odoo/addons']), 'mail_tip': set(['odoo/addons']), 'theme_default': set(['odoo/addons']), 'purchase': set(['odoo/addons']), 'website_sale_stock': set(['odoo/addons']), 'l10n_gr': set(['odoo/addons']), 'web_planner': set(['odoo/addons']), 'l10n_hr': set(['odoo/addons']), 'mrp': set(['odoo/addons']), 'sale': set(['odoo/addons']), 'pad_project': set(['odoo/addons']), 'website_mail_channel': set(['odoo/addons']), 'hr_timesheet_sheet': set(['odoo/addons']), 'l10n_ma': set(['odoo/addons']), 'l10n_fr_pos_cert': set(['odoo/addons']), 'l10n_hn': set(['odoo/addons']), 'google_drive': set(['odoo/addons']), 'sales_team': set(['odoo/addons']), 'stock_account': set(['odoo/addons'])} DEBUG:docker-odoo-base:Executing /opt/odoo/common/build.d/500-compile WARNING:docker-odoo-base:Not compiling Python code DEBUG:docker-odoo-base:Executing /opt/odoo/common/build.d/600-config-generate ls: cannot access /opt/odoo/custom/conf.d/*: No such file or directory INFO:docker-odoo-base:Merging 6 configuration files in /opt/odoo/auto/odoo.conf cat: /opt/odoo/custom/conf.d/*: No such file or directory DEBUG:docker-odoo-base:Resulting configuration: [options] ; Configuration file template that will be expanded on build admin_passwd = admin data_dir = /var/lib/odoo unaccent = true ; Addons in priority order: private, then other repos, then base Odoo addons_path = /opt/odoo/auto/addons ; Database settings, matching defaults when you execute `psql` db_user = odoo db_password = odoopassword db_host = db db_name = prod ; Normally Odoo should run behind a proxy proxy_mode = false ; Prepared to link with https://hub.docker.com/r/tecnativa/postfix-relay smtp_server = smtp ; Useful for testing, useless for production, disabled by default without_demo = false DEBUG:docker-odoo-base:Executing /opt/odoo/common/build.d/700-odoo-install INFO:docker-odoo-base:Installing Odoo from /opt/odoo/custom/src/odoo Obtaining file:///opt/odoo/custom/src/odoo Requirement already satisfied: babel>=1.0 in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: decorator in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: docutils in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: feedparser in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: gevent in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: Jinja2 in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: lxml in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: mako in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: mock in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: ofxparse in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: passlib in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: pillow in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: psutil in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: psycogreen in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: psycopg2>=2.2 in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: python-chart in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: pydot in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: pyparsing in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: pypdf in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: pyserial in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: python-dateutil in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: python-ldap in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: python-openid in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: pytz in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: pyusb>=1.0.0b1 in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: pyyaml in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: qrcode in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: reportlab in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: requests in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: suds-jurko in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: vatnumber in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: vobject in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: werkzeug in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: xlwt in /usr/local/lib/python2.7/dist-packages (from odoo==9.0rc0) Requirement already satisfied: greenlet>=0.4.7 in /usr/local/lib/python2.7/dist-packages (from gevent->odoo==9.0rc0) Requirement already satisfied: markupsafe in /usr/local/lib/python2.7/dist-packages (from Jinja2->odoo==9.0rc0) Requirement already satisfied: beautifulsoup4 in /usr/local/lib/python2.7/dist-packages (from ofxparse->odoo==9.0rc0) Requirement already satisfied: six in /usr/local/lib/python2.7/dist-packages (from ofxparse->odoo==9.0rc0) Requirement already satisfied: setuptools in /usr/local/lib/python2.7/dist-packages (from pydot->odoo==9.0rc0) Requirement already satisfied: pip>=1.4.1 in /usr/local/lib/python2.7/dist-packages (from reportlab->odoo==9.0rc0) Requirement already satisfied: python-stdnum in /usr/local/lib/python2.7/dist-packages (from vatnumber->odoo==9.0rc0) Installing collected packages: odoo Running setup.py develop for odoo Successfully installed odoo DEBUG:docker-odoo-base:Executing /opt/odoo/common/build.d/800-permissions DEBUG:docker-odoo-base:Executing /opt/odoo/common/build.d/900-dependencies-cleanup Step 1/1 : USER odoo ---> Running in b14ae515889e ---> 666b2f3abd11 Removing intermediate container ebb910cda269 Removing intermediate container 3922a51b62b3 Removing intermediate container de44e9251f02 Removing intermediate container 654e28f05172 Removing intermediate container b14ae515889e Removing intermediate container d369895c37b7 Removing intermediate container 50b04bfc6bc9 Removing intermediate container 8921a424bd9f Removing intermediate container 417a04bb44c4 Removing intermediate container d2d5c5f1b9e4 Removing intermediate container 4ca44c251f86 Removing intermediate container f0795efd1bf9 Removing intermediate container c5a1fa693ca8 Removing intermediate container 906be62f35d4 Removing intermediate container c64fc0022e6b Removing intermediate container 820ca93eb23b Removing intermediate container ff8ab3e8a0a0 Removing intermediate container 73c738d1bd0d Removing intermediate container b17714bd2b4b Removing intermediate container 14a9a82203c1 Removing intermediate container f834d79bfe38 Removing intermediate container a6e31d1d5539 Removing intermediate container 8be719bd32cf Removing intermediate container d677c2b56aa3 Removing intermediate container fa576a794e31 Removing intermediate container 568dcfa1bdc6 Successfully built 666b2f3abd11 Successfully tagged smallest_odoo:latest ```
docker-compose run --rm --no-deps odoo ls -lZAR ```bash root@odoo-dev-10:/media/sf_Repos/docker-odoo-base/tests/scaffoldings/smallest# docker-compose run --rm --no-deps odoo ls -lZAR INFO:docker-odoo-base:Not waiting for a postgres server INFO:docker-odoo-base:Linking all addons from /opt/odoo/custom/src/addons.yaml in /opt/odoo/auto/addons INFO:docker-odoo-base:File /opt/odoo/auto/odoo.conf exists, skipping config generation INFO:docker-odoo-base:Executing ls -lZAR .: total 12 drwxrwx--- 4 root odoo ? 4096 Jan 23 17:35 auto drwxr-x--- 10 root odoo ? 4096 Jan 23 17:35 common drwxr-x--- 7 root odoo ? 4096 Jan 23 17:35 custom ./auto: total 8 drwxrwx--- 2 root odoo ? 4096 Jan 11 11:00 addons -rw-rw---- 1 root odoo ? 612 Jan 23 17:35 odoo.conf ./auto/addons: total 0 ./common: total 20 -rwxr-x--- 2 root odoo ? 1056 Jan 11 10:51 build drwxr-x--- 2 root odoo ? 4096 Jan 23 17:35 build.d drwxr-x--- 2 root odoo ? 4096 Jan 23 17:35 conf.d -rwxr-x--- 2 root odoo ? 1056 Jan 11 10:51 entrypoint drwxr-x--- 2 root odoo ? 4096 Jan 23 17:35 entrypoint.d ./common/build.d: total 32 -rwxr-x--- 1 root odoo ? 138 Jan 11 10:51 100-repos-aggregate -rwxr-x--- 1 root odoo ? 720 Jan 11 10:51 200-dependencies -rwxr-x--- 1 root odoo ? 1156 Jan 11 10:51 400-clean -rwxr-x--- 1 root odoo ? 293 Jan 11 10:51 500-compile -rwxr-x--- 1 root odoo ? 167 Jan 11 10:51 600-config-generate -rwxr-x--- 1 root odoo ? 887 Jan 11 10:51 700-odoo-install -rwxr-x--- 1 root odoo ? 195 Jan 11 10:51 800-permissions -rwxr-x--- 1 root odoo ? 615 Jan 11 10:51 900-dependencies-cleanup ./common/conf.d: total 24 -rw-r----- 1 root odoo ? 148 Jan 11 10:51 00-base.conf -rw-r----- 1 root odoo ? 106 Jan 11 10:51 10-addons.conf -rw-r----- 1 root odoo ? 147 Jan 11 10:51 20-database.conf -rw-r----- 1 root odoo ? 67 Jan 11 10:51 30-proxy-mode.conf -rw-r----- 1 root odoo ? 100 Jan 11 10:51 40-smtp.conf -rw-r----- 1 root odoo ? 95 Jan 11 10:51 50-demo-data.conf ./common/entrypoint.d: total 16 -rwxr-x--- 1 root odoo ? 239 Jan 11 10:51 20-postgres-wait -rwxr-x--- 1 root odoo ? 374 Jan 11 10:51 30-unaccent-install -rwxr-x--- 1 root odoo ? 620 Jan 11 10:51 40-addons-link -rwxr-x--- 1 root odoo ? 150 Jan 11 10:51 50-config-generate ./custom: total 16 -rwxr-x--- 1 root odoo ? 6148 Jul 20 2017 .DS_Store drwxr-x--- 5 root odoo ? 4096 Jan 23 17:35 src drwx------ 2 root odoo ? 4096 Jan 23 17:34 ssh ./custom/src: ls: cannot access ./custom/src/odoo: Permission denied ls: cannot access ./custom/src/private: Permission denied total 12 -rwxr-x--- 1 root odoo ? 6148 Jul 19 2017 .DS_Store -rwxr-x--- 1 root odoo ? 0 Jan 9 19:12 addons.yaml d????????? ? ? ? 0 ? ? odoo d????????? ? ? ? 0 ? ? private -rwxr-x--- 1 root odoo ? 311 Jan 9 19:12 repos.yaml ls: cannot open directory ./custom/src/odoo: Permission denied ls: cannot open directory ./custom/src/private: Permission denied ls: cannot open directory ./custom/ssh: Permission denied ```
yajo commented 6 years ago

Thanks, @lasley. These logs expose some interesting details that can lead you to hints:

  1. All entries have a ? where the security context should be. This could be a problem if you're under an AppArmor/SELinux-enabled system. However, I'd say it isn't your case, since
  2. The last paragraph (for ./custom/src) is the most interesting one. I see some .DS_Store files that appear. It leads me to think that you are mounting some folder from a mac filesystem into the ubuntu VM. Maybe the mac file system doesn't support some feature Docker needs.
  3. Of course the parts of d????????? and Permission denied are most clear. Well, ./custom/ssh: Permission denied is expected, but the others are not. You can try with docker-compose run --rm --no-deps --user root odoo ls -lZAR to see if root has access. If it has, it can be a permissions problem. If it still does not, it can be a disk corruption/misconfiguration problem. You can check https://serverfault.com/questions/18110/permission-denied-to-a-file-i-own too.

I hope something of all of that helps...

lasley commented 6 years ago

I noticed the .DS_STORE files as well, and was coming to a similar conclusion. The only thing that made me not say something earlier is that this works absolutely fine if I build and run on my Mac. The more weird thing is that the drive is a network share, mounted via NFS on both sides.

I went ahead and cloned the repo directly to the VM drive and was able to run it without issues.

I'm inclined to call this fixed - it's something I can easily work around on my end. Thanks for the assistance πŸ˜„

I wonder though what is actually causing this issue (is it NFS specifically, or is Moby confused into thinking it's a Mac volume due to the index files). It's a Moby issue regardless I think, but it would be really nice to know.