Gramex raises an "inotify watch limited reached" error in a Docker container

648 Views Asked by At

We are seeing the following error when we deploy a Gramex portal in production as time passes by.

Inotify._raise_error()
File "/opt/conda/lib/python3.7/site-packages/watchdog/observers/inotify_c.py", line 421, in _raise_error
raise OSError(errno.ENOSPC, "inotify watch limit reached")
OSError: [Errno 28] inotify watch limit reached

The error does not occur immediately after we deploy. It occurs after 1 or 2 hours after deployment. After that, the portal stops working. We're restarting our docker containers when the application stops responding after 2 or 3 hours.

1

There are 1 best solutions below

0
On

Set watch: false under app: in your gramex.yaml.

app:
  watch: false

You can increase the inotify limit in the host, but you can't set these in docker containers.

This means that if your files change, Gramex needs to be restarted. But it won't fail due to the inotify limit.