Sysctl: permission denied on key "fs.inotify.max_user_watches", ignoring

I need to increase max user watches in one of my containers. So I’ve edited the /etc/sysctl.conf but

sudo sysctl -p

returns

sysctl: permission denied on key "fs.inotify.max_user_watches", ignoring

Google searches leads to hosting company configurations. Since this is my local test environment, I couldn’t find a resolution.

Do you have any idea? I think we haven’t suffered this previous versions.

lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.3 LTS
Release:	20.04
Codename:	focal
lxc version
Client version: 4.21
Server version: 4.21

That sysctl is a global one, you need to increase it on the host instead.

1 Like

Thank you for your efforts. Do I have any other option? Because I don’t want to increase it on my machine.

Hmm, no. This is a kernel limitation. I guess you could rework your container to not need to use inotify in the first place somehow, but if you need more watches, your only option is to increase the number of watches on the system.

1 Like