merofeev / docker-windows-volume-watcher

A tool to notify Docker contianers about changes in mounts on Windows.
MIT License
188 stars 30 forks source link

error message constantly printed #12

Closed marzelin closed 5 years ago

marzelin commented 5 years ago

pip show docker-windows-volume-watcher Version: 1.0.8

pip show docker Version: 3.5.0

docker --version Docker version 18.06.1-ce, build e68fc7a

when I run:

docker-volume-watcher.exe

this is printed every second:

ERROR:root:Exec run returned non-zero exit code: 1

beside of this everything works as expected (a container is informed when a change is made).

marzelin commented 5 years ago

Switching to --verbose mode showed what is causing the error: .git/index.lock is created when there's a change and immediately removed so when the program tries to access the file in a container it cannot find it and throws an error.

Is there a fix for this?

merofeev commented 5 years ago

Hi Marcin! Thanks for reporting this! Do you know which software on your system makes git to constantly create and remove .git/index.lock file? It sounds like some other tool (e.g. plugin to your IDE/text editor) monitors git status.

Is there a fix for this?

So far I know only one solution that should fix this: I can implement ignore CLI argument that will make docker-windows-volume-watcher to ignore any changes in given files. This will enable people experiencing this issue to run docker-windows-volume-watcher --ignore "*.git*" to fix this problem.

marzelin commented 5 years ago

It's probably vscode that constantly runs git status to fetch any updates to git repo being done by other processes. Having ignore option would be great.

Also I'm trying to run the watcher as a background process with nohup docker-volume-watcher.exe & but it gets killed when a terminal is closed. Any advice on this?

merofeev commented 5 years ago

Hi Marcin! I have release the new version 1.1.0 with exclude feature. Please update to latest vesrion:

pip install --upgrade docker-windows-volume-watcher

And then check if ignoring .git folder fixes this issue for you

docker-windows-volume-watcher -e "*.git*"

Also I'm trying to run the watcher as a background process with nohup docker-volume-watcher.exe & but it gets killed when a terminal is closed. Any advice on this?

Well, you probably can try to employ one of techniques described here https://superuser.com/questions/62525/run-a-batch-file-in-a-completely-hidden-way To be honest I haven't tried them.

marzelin commented 5 years ago

Works like a charm. Thanks!