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

Cannot start environment using recommended docker desktop in Linux #1786

Open
luislard opened this issue Apr 21, 2024 · 0 comments
Open

Cannot start environment using recommended docker desktop in Linux #1786

luislard opened this issue Apr 21, 2024 · 0 comments

Comments

@luislard
Copy link

luislard commented Apr 21, 2024

Expected/Desired Behavior

When executing the start command in Linux with docker desktop (as recommended), it works.

vip dev-env start --slug=acme-website

Actual Behavior

I get:

✕ Please contact VIP Support with the following information:
Error: Error: EACCES: permission denied, open '/home/johndoe/.local/share/vip/lando/scripts/add-cert.sh'
    at exports.moveConfig (/home/johndoe/.nvm/versions/node/v20.12.1/lib/node_modules/@automattic/vip/node_modules/lando/lib/utils.js:165:13)
   at /home/johndoe/.nvm/versions/node/v20.12.1/lib/node_modules/@automattic/vip/node_modules/lando/lib/lando.js:119:32
    at process.processImmediate (node:internal/timers:478:21)
From previous event:
    at bootstrapEngine (/home/johndoe/.nvm/versions/node/v20.12.1/lib/node_modules/@automattic/vip/node_modules/lando/lib/lando.js:116:39)
    at bootstrapRouter (/home/johndoe/.nvm/versions/node/v20.12.1/lib/node_modules/@automattic/vip/node_modules/lando/lib/lando.js:154:27)
    at /home/johndoe/.nvm/versions/node/v20.12.1/lib/node_modules/@automattic/vip/node_modules/lando/lib/lando.js:310:19
From previous event:
    at /home/johndoe/.nvm/versions/node/v20.12.1/lib/node_modules/@automattic/vip/node_modules/lando/lib/lando.js:310:8
From previous event:
    at Lando.bootstrap (/home/johndoe/.nvm/versions/node/v20.12.1/lib/node_modules/@automattic/vip/node_modules/lando/lib/lando.js:255:25)
    at bootstrapLando (/home/johndoe/.nvm/versions/node/v20.12.1/lib/node_modules/@automattic/vip/dist/lib/dev-environment/dev-environment-lando.js:191:17)
    at async /home/johndoe/.nvm/versions/node/v20.12.1/lib/node_modules/@automattic/vip/dist/bin/vip-dev-env-start.js:22:17
    at async _args.default.argv (/home/johndoe/.nvm/versions/node/v20.12.1/lib/node_modules/@automattic/vip/dist/lib/cli/command.js:444:11)

Steps to Reproduce the Problem

OS: Linux Ubuntu 22.04
Docker desktop: 4.29.0
VIP CLI: 2.39.0

  1. Set docker context to use docker-desktop context
  2. Create a project
vip dev-env create --app-code="./vip" --slug="acme-website" \
  --title="Acme Website" --php="8.2" \
  --wordpress="6.5" \
  --mu-plugins="demo" \
  --multisite=subdirectory \
  --xdebug \
  --mailpit \
  --phpmyadmin \
  --elasticsearch \
  --photon
  1. Start the project
vip dev-env start --slug=acme-website

(Optional) Additional notes

Where is the issue?

For some reason, the target folder /home/johndoe/.local/share/vip/lando is owned by docker-desktop uid 100999 and gid 100999. I added created a group docker_share with gid 100999 but still get the error.

➜  acme-website git:(ABC-123) ls -la /home/johndoe/.local/share/vip/lando
total 76
drwxrwxr-x+ 10   100999 docker_share 4096 abr 21 23:42 .
drwxrwxr-x   5 johndoe johndoe     4096 abr 21 23:42 ..
drwxrwxr-x+  2   100999 docker_share 4096 abr 21 23:43 cache
drwxrwxr-x+  2   100999 docker_share 4096 abr 21 23:43 certs
drwxrwxr-x+  3   100999 docker_share 4096 abr 21 23:42 compose
drwxrwxr-x+  3   100999 docker_share 4096 abr 21 23:42 config
drwxrwxr-x+  3   100999 docker_share 4096 abr 21 23:42 home
drwxrwxr-x+  2   100999 docker_share 4096 abr 21 23:42 keys
drwxrwxr-x+  3   100999 docker_share 4096 abr 21 23:42 proxy
drwxrwxr-x+  2   100999 docker_share 4096 abr 21 23:42 scripts

The issue is entering here in the lando-core utils file.

The problem is that the node process is running by the host johndoe but the script is trying to do some file operations in files owned by 100999:100999.

I tried using setfacl like this:

sudo setfacl -Rm u:johndoe:rwx /home/johndoe/.local/share/vip/lando
sudo setfacl -Rdm u:johndoe:rwx /home/johndoe/.local/share/vip/lando

sudo setfacl -Rm g:johndoe:rwx /home/johndoe/.local/share/vip/lando
sudo setfacl -Rdm g:johndoe:rwx /home/johndoe/.local/share/vip/lando

That solved the first problem, now the process can open the files, but since the script tries to chmod here the operation is giving a new error:

✕ Please contact VIP Support with the following information:
Error: Error: EPERM: operation not permitted, chmod '/home/johndoe/.local/share/vip/lando/scripts/add-cert.sh'
    at exports.moveConfig (/home/johndoe/.nvm/versions/node/v20.12.1/lib/node_modules/@automattic/vip/node_modules/lando/lib/utils.js:167:13)
    at /home/johndoe/.nvm/versions/node/v20.12.1/lib/node_modules/@automattic/vip/node_modules/lando/lib/lando.js:119:32
    at process.processImmediate (node:internal/timers:478:21)
From previous event:
    at bootstrapEngine (/home/johndoe/.nvm/versions/node/v20.12.1/lib/node_modules/@automattic/vip/node_modules/lando/lib/lando.js:116:39)
    at bootstrapRouter (/home/johndoe/.nvm/versions/node/v20.12.1/lib/node_modules/@automattic/vip/node_modules/lando/lib/lando.js:154:27)
    at /home/johndoe/.nvm/versions/node/v20.12.1/lib/node_modules/@automattic/vip/node_modules/lando/lib/lando.js:310:19
From previous event:
    at /home/johndoe/.nvm/versions/node/v20.12.1/lib/node_modules/@automattic/vip/node_modules/lando/lib/lando.js:310:8
From previous event:
    at Lando.bootstrap (/home/johndoe/.nvm/versions/node/v20.12.1/lib/node_modules/@automattic/vip/node_modules/lando/lib/lando.js:255:25)
    at bootstrapLando (/home/johndoe/.nvm/versions/node/v20.12.1/lib/node_modules/@automattic/vip/dist/lib/dev-environment/dev-environment-lando.js:191:17)
    at async /home/johndoe/.nvm/versions/node/v20.12.1/lib/node_modules/@automattic/vip/dist/bin/vip-dev-env-destroy.js:23:17
    at async _args.default.argv (/home/johndoe/.nvm/versions/node/v20.12.1/lib/node_modules/@automattic/vip/dist/lib/cli/command.js:444:11)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant