watchfiles: M1 mac with Docker WatchfilesRustInternalError: Error creating watcher: Function not implemented (os error 38)
Description
When starting django with the watcher (after installing from pypi from the wheel)
PostgreSQL is available
INFO: Will watch for changes in these directories: ['/app']
INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO: Started reloader process [18] using WatchFiles
Traceback (most recent call last):
File "/usr/local/bin/uvicorn", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
=== Starting migration
Operations to perform:
Apply all migrations: account, address, admin, auth, contenttypes, customers, orders_tenant, permissions, sessions, socialaccount, users
Running migrations:
No migrations to apply.
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/uvicorn/main.py", line 407, in main
run(
File "/usr/local/lib/python3.9/site-packages/uvicorn/main.py", line 570, in run
ChangeReload(config, target=server.run, sockets=[sock]).run()
File "/usr/local/lib/python3.9/site-packages/uvicorn/supervisors/basereload.py", line 45, in run
for changes in self:
File "/usr/local/lib/python3.9/site-packages/uvicorn/supervisors/basereload.py", line 64, in __next__
return self.should_restart()
File "/usr/local/lib/python3.9/site-packages/uvicorn/supervisors/watchfilesreload.py", line 85, in should_restart
changes = next(self.watcher)
File "/usr/local/lib/python3.9/site-packages/watchfiles/main.py", line 103, in watch
watcher = RustNotify([str(p) for p in paths], debug, force_polling, poll_delay_ms)
_rust_notify.WatchfilesRustInternalError: Error creating watcher: Function not implemented (os error 38)
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
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (10 by maintainers)
Commits related to this issue
- fallback to poll watcher on OS Error 38, fix #167 — committed to samuelcolvin/watchfiles by samuelcolvin 2 years ago
- fallback to poll watcher on OS Error 38 (#172) * fallback to poll watcher on OS Error 38, fix #167 * tweak error on fallback poll watcher — committed to samuelcolvin/watchfiles by samuelcolvin 2 years ago
Great, thank you for confirming. I’ll make a new release tomorrow.
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:
pypi_files
from the CI runpip install pypi_files/watchfiles-0.0.0-cp37-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
missed the notifications for these. but the immediate issue is definitely fixed. thanks!
It is working for me when I use the updated wheel! Thank you for fixing!
Okay, I can reproduce this.
First the good news:
--platform linux/amd64
force_polling=True
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?