adlogix / docker-machine-nfs

Activates NFS on docker-machine
MIT License
794 stars 104 forks source link

Not syncing files properly in High Sierra #79

Closed rabdulhaq closed 5 years ago

rabdulhaq commented 6 years ago

After updating to High Sierra, files are not syncing/mounting properly. Some files are missing and others are duplicated.

tonivdv commented 6 years ago

@rabdulhaq can you test if you have the issue too without NFS? Maybe it's a docker-machine/boot2docker/virtualbox issue?

rabdulhaq commented 6 years ago

Without docker-machine-nfs, Docker works fine but slow of course.

tonivdv commented 6 years ago

@rabdulhaq Seems an issue with NFS from an APFS volume

rabdulhaq commented 6 years ago

Yes definitely. I was hoping you guys can maybe have a workaround for that issue. Thanks!

tonivdv commented 6 years ago

@rabdulhaq nobody at the company is running High Sierra currently so it will be hard to fix ;) However if you find some time, contributions are always welcome :)

ctrlrsf commented 6 years ago

@rabdulhaq These mount options helped for me: nolock,vers=3,tcp,fsc,rw,noatime

rabdulhaq commented 6 years ago

@ctrlrsf, I tried doing that but I get the "Cannot detect the NFS mount :(" error with these options. This is what I ran: docker-machine-nfs default --mount-opts="nolock,vers=3,tcp,fsc,rw,noatime"

Thank you!

ckortekaas commented 6 years ago

Modifying my /var/lib/boot2docker/bootlocal.sh to this seems to have worked:

sudo mount -t nfs -o nolock,vers=3,tcp,rw,noatime :/Users /Users

Worked fine for me. Notice the lack of 'fsc' because the boot2docker NFS client doesn't seem to support it. But i've had no problems since. Good to be back on NFS!

rabdulhaq commented 6 years ago

@ckortekaas, this did not work either :(

pcasaretto commented 6 years ago

As mentioned on the referenced issues, High Sierra 10.13.2 Beta 2 solves the issue.

ab9-er commented 6 years ago

I updated to High Sierra 10.3.2 Beta 3 (Build 17C76a) and it seems to solve the problem.

rabdulhaq commented 6 years ago

I can also confirm that updating to Public Beta 3 (Build 17C67b) solved the problem. Thanks guys.

jasiu001 commented 6 years ago

I have the same issue on macOS High Sierra (build 17B48).

xxxcoltxxx commented 6 years ago

problem still exists on beta 10.13.3 (17D20a)

The problem manifests itself with the file that has just been edited. After a while he appears in the docker-machine

Error immediatly after change file: I/O error

tonivdv commented 6 years ago

Hello guys,

We have currently one colleague who (mistakenly) upgraded to high sierra, but does not have any NFS issues. He's currently on version 10.13.1 (17B1003) and has following configuration:

In /etc/exports

/Users 192.168.99.100 -alldirs -mapall=501:20

In bootlocal.sh (docker-machine ssh [machine-name] cat /var/lib/boot2docker/bootlocal.sh)

#!/bin/sh
  sudo umount /Users
    sudo mkdir -p /Users
  sudo /usr/local/etc/init.d/nfs-client start
    sudo mount -t nfs -o noacl,async 192.168.99.1:/Users /Users

And last but not least, it's a php project.

Not sure why some have problems, why with others it works. Maybe this can shed some lights.

Cheers

paolomainardi commented 6 years ago

Same problems here, some files are missing with ls but you can access it with cd

High Sierra 10.13.1 (17B1003)

fmfsaisai commented 6 years ago

My OSX version 10.13.2

When I edited a file on Host. Then type ls on container

ls changed_file.php

it will display

ls: cannot access changed_file.php: Input/output error

I must wait a while then it can be accessed

but if I ls the folder like

ls  .

it will directly display the file info

changed_file.php

and then everything will be ok

$ls changed_file.php changed_file.php

xxxcoltxxx commented 6 years ago

Solution (in my case)

I changed mount options to async,noatime,actimeo=1,nolock,vers=3,udp:

echo "" | sudo tee /etc/exports
docker-machine-nfs default --mount-opts="async,noatime,actimeo=1,nolock,vers=3,udp" -f

Additional info:

Server: Version: 17.09.1-ce API version: 1.32 (minimum version 1.12) Go version: go1.8.3 Git commit: 19e2cf6 Built: Thu Dec 7 22:28:28 2017 OS/Arch: linux/amd64 Experimental: false

* `docker info`:

Containers: 19 Running: 8 Paused: 0 Stopped: 11 Images: 52 Server Version: 17.09.1-ce Storage Driver: aufs Root Dir: /mnt/sda1/var/lib/docker/aufs Backing Filesystem: extfs Dirs: 341 Dirperm1 Supported: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: 06b9cb35161009dcb7123345749fef02f7cea8e0 runc version: 3f2f8b84a77f73d38244dd690525642a72156c64 init version: 949e6fa Security Options: seccomp Profile: default Kernel Version: 4.4.104-boot2docker Operating System: Boot2Docker 17.09.1-ce (TCL 7.2); HEAD : e7de9ae - Fri Dec 8 19:41:36 UTC 2017 OSType: linux Architecture: x86_64 CPUs: 1 Total Memory: 7.79GiB Name: default ID: V4S5:YJKZ:AXYG:V63S:OPXO:YV2C:ZE3C:T2VM:AJIQ:JRAI:BBD7:RCJO Docker Root Dir: /mnt/sda1/var/lib/docker Debug Mode (client): false Debug Mode (server): true File Descriptors: 83 Goroutines: 78 System Time: 2017-12-26T20:57:34.020536741Z EventsListeners: 1 Registry: https://index.docker.io/v1/ Labels: provider=virtualbox Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false

tonivdv commented 6 years ago

I migrated to 10.13.2 (17C88), and did not encounter any issues ...

tonivdv commented 5 years ago

I believe we can close this topic. I guess, either you never had the issue, or you were able to solve it with @xxxcoltxxx solutions using following mount options (--mount opts="async,noatime,actimeo=1,nolock,vers=3,udp")

geo0000 commented 4 years ago

it works with v18.06.1-ce. On the newest 18 versions and 19.* sync doesn't work. My stack: MacOS Mojave 10.14 Virtualbox 6.0.4 r128413 Docker version 19.03.1, build 74b1e89 docker-machine version 0.16.1, build cce350d7

Just use docker-machine create --driver virtualbox --virtualbox-boot2docker-url=https://github.com/boot2docker/boot2docker/releases/download/v18.06.1-ce/boot2docker.iso