colima icon indicating copy to clipboard operation
colima copied to clipboard

Mountpoint is not empty if docker containers were not quit

Open jjeising opened this issue 3 years ago • 5 comments

If colima is stopped while docker containers are running (e.g. colima stop or computer restart), mounting directories on the next start fails:

> msg="[hostagent] Mounting \"/Users/…/Library/Caches/colima\""
> msg="[hostagent] Mounting \"/Users/…/src\""
> msg="[hostagent] fuse: mountpoint is not empty"
> msg="[hostagent] fuse: if you are sure this is safe, use the 'nonempty' mount option"

When connecting to the instance via SSH an empty directory structure representing the docker mount points is found. After shutting down all running docker containers, stopping and starting colima the mount point works again.

Reproduce:

  1. colima start --mount ~/src:w
  2. cd ~/src/foo/bar/prj/ && docker-compose up with volumes, e.g. volumes: - ./data/db:/var/lib/mysql:rw
  3. colima stop && colima start
  4. See message fuse: mountpoint is not empty
  5. docker-compose down
  6. colima ssh, delete empty directory structure …/src/foo/bar/prj/data/db (via sudo rm …)
  7. colima stop && colima start, mount works again

Looks like something is started before the files are mounted?

jjeising avatar Jan 21 '22 13:01 jjeising

@jjeising I am struggling to reproduce this. Can you kindly verify your version of colima and lima?

colima version
lima --version

abiosoft avatar Feb 09 '22 18:02 abiosoft

Sure:

colima version 0.3.2
git commit: 272db4732b90390232ed9bdba955877f46a50552

limactl version 0.8.2

This is still reproducible.

Is this maybe a permission issue? The first folder inside the vm belongs to lima, but the subfolders belong to root.

jjeising avatar Feb 11 '22 08:02 jjeising

@jjeising We ran into the same issue over in https://github.com/lima-vm/lima/issues/584 if you want to join the conversation. We have some workarounds but no clean fix yet. To reproduce you need a docker container that has a restart policy, we're running into it with always but I think it also happens with the other restart policies.

ngetahun-aclu avatar Feb 14 '22 22:02 ngetahun-aclu

Delaying Docker daemon startup until boot is complete may fix this.

abiosoft avatar Feb 15 '22 06:02 abiosoft

To reproduce you need a docker container that has a restart policy

Yes, the containers all have restart: unless-stopped.

This would also be the expected behaviour, similar to Docker Desktop: if the containers where once startet (with a policy) they are always running if Colima is running.

jjeising avatar Feb 16 '22 12:02 jjeising