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

running reward env up throws error unable to set ownership of copied file #58

Open
techguyuk opened this issue Nov 3, 2023 · 7 comments
Assignees

Comments

@techguyuk
Copy link

techguyuk commented Nov 3, 2023

Hi

I have installed & setup rewardenv .

Im now trying to up the magento 2 environment.

When I run reward env up I get the following error

Starting mage_php-debug_1 ... done
INFO Checking if synced container is changed...
INFO Listing mutagen sync sessions...
INFO ...mutagen sync sessions listed.
INFO ...synced container ID is changed. Assuming the container is changed, restarting sync session.
INFO Terminating sync session...
INFO ...successfully terminated sync sessions.
INFO Creating mutagen sync session...
Copying agent...
Error: unable to connect to beta: unable to connect to endpoint: unable to dial agent endpoint: unable to install agent: unable to copy agent binary: unable to set ownership of copied file: exit status 1
ERROR error running env command: an error occurred while updating mutagen: an error occurred while starting mutagen sync: cannot create mutagen sync session: error running command: sh: exit status 1

I tried restarting my mac and also docker but issue still persist.

Any help appreciated.

Thanks

@github-actions github-actions bot added the Stale label Nov 18, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 23, 2023
@janosmiko janosmiko self-assigned this Nov 23, 2023
@janosmiko janosmiko reopened this Nov 23, 2023
@github-actions github-actions bot removed the Stale label Nov 24, 2023
@github-actions github-actions bot added the Stale label Dec 8, 2023
@janosmiko janosmiko removed the Stale label Dec 8, 2023
@rewardenv rewardenv deleted a comment from github-actions bot Dec 8, 2023
@rewardenv rewardenv deleted a comment from github-actions bot Dec 8, 2023
@janosmiko
Copy link
Contributor

Hi @atlenquiryuk ,

Could you provide some additional context around this issue?
What macOS and docker version do you use? What is your user's UID in the OS level?
Maybe try running DEBUG=true reward env up to see what's happening.

@techguyuk
Copy link
Author

Hi @janosmiko

Thanks for your reply.

Mac os: Big sur 11.7.10
Mutagen version 0.17.4
Docker version 24.0.7, build afdd53b4e3
colima version 0.6.7

I'm getting the following error

on running rewardenv command reward env up the first time I got error

Error response from daemon: error while creating mount source path '/Users/username/development/reward/magento/pub/media': chown /Users/username/development/reward/magento/pub/media: permission denied
ERROR   error running env command: error running command: docker-compose: exit status 1

on subsequent run of reward env up I got the following error

INFO    Checking if synced container is changed...   
INFO    Listing mutagen sync sessions...             
INFO    ...cannot list mutagen sync sessions: cannot list mutagen sync sessions: error running command: sh: exit status 1. Assuming the container is changed, restarting sync session. 
INFO    Terminating sync session...                  
Error: unable to connect to daemon: client/daemon version mismatch (daemon restart recommended)
ERROR   error running env command: an error occurred while updating mutagen: an error occurred while starting mutagen sync: cannot terminate mutagen sync session: cannot terminate previous sync session: error running command: sh: exit status 1

@janosmiko
Copy link
Contributor

You should try to restart mutagen:

mutagen daemon stop
mutagen daemon start

@techguyuk
Copy link
Author

Hi @janosmiko

I ran the commands above and get the following error now

$ reward env up ERROR an error occurred checking requirements: error checking docker: cannot fetch docker version: cannot fetch docker version: Cannot connect to the Docker daemon at unix:////Users/username/.colima/docker.sock. Is the docker daemon running?

Thanks

@janosmiko
Copy link
Contributor

Hi @atlenquiryuk ,

Colima was not supported previously, but I tried to install it locally, and can reproduce an issue that's similar.

Sadly, the current version of docker cli returns an unparsable json when I specify the --format json flag to it:

janosmiko@freya ~>docker context list --format json
{"Current":true,"Description":"colima","DockerEndpoint":"unix:///Users/janosmiko/.colima/default/docker.sock","Error":"","Name":"colima"}
{"Current":false,"Description":"Current DOCKER_HOST based configuration","DockerEndpoint":"unix:///var/run/docker.sock","Error":"","Name":"default"}
{"Current":false,"Description":"Docker Desktop","DockerEndpoint":"unix:///Users/janosmiko/.docker/run/docker.sock","Error":"","Name":"desktop-linux"}
{"Current":false,"Description":"OrbStack","DockerEndpoint":"unix:///Users/janosmiko/.orbstack/run/docker.sock","Error":"","Name":"orbstack"}

Even worse, it didn't work on Linux previously. moby/moby#44469

You can override the DOCKER_HOST using an environment variable. Maybe that can help.
For me it started to work after I exported it.

janosmiko@freya ~>export DOCKER_HOST=unix:///Users/janosmiko/.colima/default/docker.sock
janosmiko@freya ~>reward svc up
[+] Running 3/17
 ⠧ mailhog 3 layers [⠀⠀⠀]      0B/0B      Pulling                                                                                                                                                                                                                                                                        5.8s
 ⠧ traefik 4 layers [⠀⠀⠀⠀]      0B/0B      Pulling                                                                                                                                                                                                                                                                       5.8s
 ⠧ dnsmasq 2 layers [⠀⠀]      0B/0B      Pulling                                                                                                                                                                                                                                                                         5.8s
 ⠧ phpmyadmin 18 layers [⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]      0B/0B      Pulling                                                                                                                                                                                                                                                     5.8s
 ⠧ elastichq 10 layers [⣿⣿⣤⣿⣤⠀⠀⠀⠀⠀] 13.91MB/24.98MB Pulling                                                                                                                                                                                                                                                              5.8s
 ⠧ portainer 10 layers [⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]      0B/0B      Pulling

@techguyuk
Copy link
Author

techguyuk commented Dec 19, 2023

Hi @janosmiko

Yes that worked, however when I try to visit any global services (https://rewardenv.readthedocs.io/en/latest/services.html) like https://traefik.reward.test/ I get "This site can’t be reached"

on running sudo lsof -i -P | grep LISTEN | grep :80 I get the below which suggest its listening correctly
ssh 31150 username 26u IPv4 0x4cd0de6a7be1d223 0t0 TCP *:80 (LISTEN)

See from screenshot its using traffic self cert.
Screenshot 2023-12-19 at 22 31 38

Not sure whats happening here, are you able to access any of the rewardenv global services ?

Thanks

@github-actions github-actions bot added the Stale label Jan 3, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 8, 2024
@rewardenv rewardenv deleted a comment from github-actions bot Jan 8, 2024
@janosmiko janosmiko reopened this Jan 8, 2024
@janosmiko janosmiko removed the Stale label Jan 8, 2024
@sreejith-ac-2hats
Copy link

sreejith-ac-2hats commented Mar 21, 2024

There is a similar issue. When the container is launched for the application, webserver with fpm is running as www-data user. But the host machine has its own user. Lets say "user". We cannot edit any files directly on the host. If we fix permission inside the reward shell, we wont be edit the file anymore.

Reward should launch the container as the host user instead of www-data. Normally it can be achieved by passing the UID and GID to match it to the host current user into the container upon build and launch

I guess this only happens if you have any UID other than 1000

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

3 participants