crane
crane copied to clipboard
Syncing many files with unison
File sync didn't work properly on bigger projects (>100.000 files). Sometimes files were missing inside the guest or on the host. After some investigation I noticed that the unison container was crashing from time to time.
Looking at the container logs, I found the following error message:
Fatal error: Filesystem watcher error: cannot add a watcher: system limit reached
The watcher can be disabled by setting preference 'watch' to false
I am using docker-machine + boot2docker.
The following commands fixed the issue:
1. Log into boot2docker
docker-machine ssh
2. Increase the number of filesystem watches that unison can start
Add the following line to the end of /var/lib/boot2docker/profile:
sudo sysctl fs.inotify.max_user_watches=524288
3. Restart docker machine
docker-machine restart
After that, syncing bigger projects started to work for me. This is not a support ticket. It's a limitation of boot2docker, but I still wanted to document the behaviour somewhere, in case anybody else is running into the same problem.
Nice find. Thanks a lot for the report. I might add the issue to a "Troubleshooting" section, and a general indication how to solve it. I never tried Crane with docker-machine, I'm using it with Docker for Mac and a project with ~50k files.