Plesk Fail2Ban ERROR add_watch: cannot watch – – Errno=No space left on device (ENOSPC)

When adding fail2ban to a server with a lot of sites and enabling all jails the client got this error during the enabling process. Half the sites wouldn’t monitor.

2024-02-18 17:01:32,168 fail2ban.filterpyinotify[1111498]: ERROR add_watch: cannot watch /var/www/vhosts/system/domainname.com/logs WD=-1, Errno=No space left on device (ENOSPC)

Contrary to the error message.  This server had lots of free space and plenty of iNodes.  This was a watch problem.

Run this command;

cat /proc/sys/fs/inotify/max_user_watches

If it is lower than the amount of watches you are adding then this is the cause.  You can try this command.

echo 20000 | tee -a /proc/sys/fs/inotify/max_user_watches

I have not yet had chance to test this on the clients server. This is documentation for the future when testing is possible.

Be the first to comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.