Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

entrypoint.d python scripts do not work for prod.yaml/compile #509

Closed
ap-wtioit opened this issue Jul 4, 2022 · 1 comment
Closed

entrypoint.d python scripts do not work for prod.yaml/compile #509

ap-wtioit opened this issue Jul 4, 2022 · 1 comment
Labels

Comments

@ap-wtioit
Copy link
Contributor

ap-wtioit commented Jul 4, 2022

Describe the bug

When adding a python script to a doodba-... project in entrypoint.d one cannot use compile=true

Creating entrypoint_odoo_run ... done
doodba INFO: Waiting until postgres is listening at db...
doodba INFO: Linking all addons from /opt/odoo/custom/src/addons.yaml in /opt/odoo/auto/addons
doodba INFO: Generating /opt/odoo/auto/odoo.conf file. Overriding any existing...
doodba INFO: Merging found configuration files in /opt/odoo/auto/odoo.conf
Traceback (most recent call last):
  File "/opt/odoo/common/entrypoint", line 30, in <module>
    subprocess.check_call(command)
  File "/usr/local/lib/python3.8/subprocess.py", line 359, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/local/lib/python3.8/subprocess.py", line 340, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/local/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: '/opt/odoo/custom/entrypoint.d/__pycache__'
INFO:root:Subtest execution: test_entrypoint_python (tests.ScaffoldingCase) (PWD='/home/runner/work/doodba/doodba/tests/scaffoldings/entrypoint', ODOO_MINOR='14.0', DB_VERSION='14', UID='1001', GID='121')

edit: Updated with error in github actions (to make it clear it's not my custom setup)

To Reproduce

Affected versions:

Steps to reproduce the behavior:

  1. run tests in [FIX] direxec should not try to execute directories #508

Expected behavior

python scripts in entrypoint.d should work with compile=true

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

I'm working on a fix for this in #508

Info @wt-io-it

@ap-wtioit ap-wtioit added the bug label Jul 4, 2022
@ap-wtioit
Copy link
Contributor Author

Bug exists since f931b53, where the bash script direxec.sh was incorrectly converted to python direxec:

  • run-parts --exit-on-error does not try to execute sub directories even if they have x permissions (for traversing into the directory)
  • os.access(command, os.X_OK) returns true for directories with permission x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants