chokidar
chokidar copied to clipboard
Add events not fired for external drives on MacOS + Docker
Describe the bug
I have a user reporting that when they add images to an external drive that's connected to their MacOS machine that my app, which runs in Docker, isn't detecting the new files.
Versions (please complete the following information):
- Chokidar version: 3.4.0
- Node version: v14.4.0
- OS version: macOS Catalina (Version 10.15.5)
- Docker version: 19.03.8
To Reproduce:
Here's the code I'm using to watch:
try {
this._watcher = chokidar
.watch(this.watchPattern, { awaitWriteFinish: Settings.awaitWriteFinish })
.on("add", this.processImage.bind(this));
log.verbose(`Trigger ${this.name}`, `Listening for new images in ${this.watchPattern}`);
} catch (e) {
throw Error(`Trigger ${this.name} unable to start watching for images: ${e}`);
}
For this user their watch pattern is /aiinput/Dog*.jpg
. awaitWriteFinish
is false. Globally the environment variable CHOKIDAR_USEPOLLING
is set: I have it set by default in my Docker image (Alpine Linux) and have confirmed it is set in my user's container.
Expected behavior
The file is detected.
Additional context
This only happens for files on an external drive. I had the user try pointing to a folder on the local machine and it works fine.
I've dug through the documentation to see if there's any special setting I should be including to make this work and didn't see anything obvious.
Git repo for the project: https://github.com/danecreekphotography/node-deepstackai-trigger
-
See Issue #895
-
And PR #1025
-
Wait for @paulmillr to publish a new version with the fix and enable polling (
usePolling: true
) for network paths.
Awesome, thank you @nicograef! Yes, am already using polling since my code runs in Docker. Will open a tracking issue in my codebase to update to the new release once available.