-
-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
M1 mac with Docker WatchfilesRustInternalError: Error creating watcher: Function not implemented (os error 38) #167
Comments
Which docker image? |
Sorry I forgot to include that it is I'm running docker in intel chip emulation mode, too. I don't remember the correct technical name for it. |
Maybe worth checking if the correct wheel was installed. I've run watchfiles inside docket on my M1 Mac and it worked fine. |
I can reproduce this without Django or Uvicorn. The error occurs on an Apple Silicon M1 Mac, but not on an Intel Mac, and occurs even if specifying the platform. watch.py from watchfiles import watch
for changes in watch('/hello.py'):
print(changes) hello.py print('hello world') Dockerfile FROM python:3.10
RUN pip install watchfiles==0.15.0
COPY hello.py watch.py /
CMD watchfiles watch /hello.py docker build . --platform linux/amd64 -t watchfiles-example
docker run -p 8080:80 --platform linux/amd64 -v "$(pwd)/hello.py":"/hello.py" watchfiles-example
Consider reporting to Docker upstream (docker/roadmap#7). |
+1 on this |
Okay, I can reproduce this. First the good news:
It might also be worth honouring an env variable to enable polling for those who are using watchfiles via a third party library and therefore aren't able to use the kwarg directly. In terms of the underlying error and how to handle it, I'm not really sure where to go. @messense do you have any ideas? |
From the logs, pip is installing I tried hacking pip to allow me to install other wheels directly and tried installing I also tried install 0.14.1 in case it was an issue with abi3, but it doesn't seem to be. |
I cannot reproduce this with lima on M1 Pro Mac. root@49fb5ab8d2ea:/# watchfiles watch /hello.py
[02:19:00] watchfiles 👀 path="/hello.py" target="watch" (command) filter=DefaultFilter...
Usage:
watch [options] command
Options:
-b, --beep beep if command has a non-zero exit
-c, --color interpret ANSI color and style sequences
-d, --differences[=<permanent>]
highlight changes between updates
-e, --errexit exit if command has a non-zero exit
-g, --chgexit exit when output from command changes
-n, --interval <secs> seconds to wait between updates
-p, --precise attempt run command in precise intervals
-t, --no-title turn off header
-w, --no-wrap turn off line wrapping
-x, --exec pass command to exec instead of "sh -c"
-h, --help display this help and exit
-v, --version output version information and exit
For more details see watch(1).
^C[02:19:03] KeyboardInterrupt caught, stopping watch
[02:19:03] process already dead, exit code: 1 |
I think I'll ask on notify and see if they have any ideas. |
Partial fix / work around building now in #170. Reported upstream, see notify-rs/notify#423. |
FYI, https://docs.docker.com/desktop/mac/apple-silicon/#known-issues
|
Amazing, thanks for finding that! Maybe one day notify will catch this and fall back to polling, in the meantime we can catch this and fallback in watchfiles, I'll create a PR. |
Okay, this is fixed in #172. Please could those experiencing this problem @daniel-butler @br3ndonland @gravy-jones-locker try this and confirm it fixes the problem for you. To install from wheel from the PR:
|
It is working for me when I use the updated wheel! Thank you for fixing!
|
Great, thank you for confirming. I'll make a new release tomorrow. |
* fallback to poll watcher on OS Error 38, fix #167 * tweak error on fallback poll watcher
v0.16.0 has just be released. |
Nice! It works with 0.16.0 from PyPI, too. |
missed the notifications for these. but the immediate issue is definitely fixed. thanks! |
Description
When starting django with the watcher (after installing from pypi from the wheel)
Example Code
No response
Example Code Output
No response
Operating System
Mac M1 12.3.1 (21E258)
Environment
Docker
Watchfiles Version
0.15.0
Python Version
3.9
Rust & Cargo Version
cargo: not found; rustc: not found
The text was updated successfully, but these errors were encountered: