watchmedo not working on M1 Mac

See original GitHub issue

Hey Guys,

We have two mac Big Sur, one intel and the other M1. watchmedo is not working when called from the M1.

test_app| Inotify._raise_error() test_app | File "/usr/local/lib/python3.8/dist-packages/watchdog/observers/inotify_c.py", line 405, in _raise_error test_app | raise OSError(err, os.strerror(err)) **test_app | OSError: [Errno 38] Function not implemented** test_app_valid exited with code 1 test_app exited with code 1

watchmedo is being called inside a docker image.

Our compose.yml command: command: watchmedo auto-restart -d test_app/test_app_valid/ -p '*.py' -- python3 -m debugpy --listen 0.0.0.0:20000 -m test_app. test_app_valid

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:10
  • Comments:8

github_iconTop GitHub Comments

5reactions
aantncommented, Oct 9, 2021

I’m having a similar issue with the watchdog library (not watchmedo):

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
    self.run()
  File "/usr/local/lib/python3.8/threading.py", line 870, in run
  File "/usr/local/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/app/robusta/utils/directory_watcher.py", line 47, in watch
    observer.start()
  File "/usr/local/lib/python3.8/site-packages/watchdog/observers/api.py", line 256, in start
    emitter.start()
  File "/usr/local/lib/python3.8/site-packages/watchdog/utils/__init__.py", line 93, in start
    self.on_thread_start()
  File "/usr/local/lib/python3.8/site-packages/watchdog/observers/inotify.py", line 118, in on_thread_start
    self._inotify = InotifyBuffer(path, self.watch.is_recursive)
  File "/usr/local/lib/python3.8/site-packages/watchdog/observers/inotify_buffer.py", line 35, in __init__
    self._inotify = Inotify(path, recursive)
  File "/usr/local/lib/python3.8/site-packages/watchdog/observers/inotify_c.py", line 155, in __init__
    Inotify._raise_error()
  File "/usr/local/lib/python3.8/site-packages/watchdog/observers/inotify_c.py", line 405, in _raise_error
    raise OSError(err, os.strerror(err))
OSError: [Errno 38] Function not implemented

The base image is python:3.9-slim.

0reactions
chrisdailcommented, Apr 25, 2022

If you have the flexibility of using an arm64 based container, this is also another solution to this problem. The docker issue is with inotify under the emulation mode only. If you have the option to use an arm based container, watchdog should work normally.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to set up locally in M1 Mac · Issue #615 · fastai/fastpages
I tried building it locally in my M1 Macbook by make server ... File "/usr/local/lib/python3.7/site-packages/watchdog/watchmedo.py", ...
Read more >
Watchdog kernel panics in M1 Macs running macOS X ...
A web search for watchdog and kernel panics indicates that this problem is a common one, and has been an issue since at...
Read more >
Running Redash on M1 Mac on Docker - Stephan Meijer
This removes the watchmedo binary. The downside is that the daemons will not restart on changes in the Redash source code. Source for...
Read more >
Fix broken Docker Development on Apple Macbook M1
Docker has written a blog post that explains all the problems that need to be solved: Migrate to new hypervisor framework (does not...
Read more >
Watchdog - PyPI
python -m pip install -U watchdog # or to install the watchmedo utility: ... This is an inherent problem with kqueue because it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found