Agents use system file watchers to be notified of files updates. The error message appears for Synchronization jobs and is frequent for a Linux OS, especially if there are lot of files and subdirectories in the synced folder.  If the agent process hits the system’s limit of watchers, the Agent won’t be notified about file update and thus the only way for it to learn about these is by rescanning the folder, either manually or periodically. It’s better to increase the watchers limit.

By default, system allocates 8192 watchers. Run the command to check that and see the output

cat /proc/sys/fs/inotify/max_user_watches

There are two ways to increase it. In either case, XXXXX is the number of watchers you’d like to set. Do not set amount of watchers more than 2147483647. Please also note that majority Linux distros can only support up to 524288 watchers even if you configure more.

1. Temporary solution. The increased number of notify watchers is preserved only until the computer is rebooted. In Terminal run command

sudo sysctl fs.inotify.max_user_watches=XXXXX

Recheck with cat /proc/sys/fs/inotify/max_user_watches that the number is indeed increased.
Restart the Agent.

2. Permanent solution.

  • Run the two commands:
    echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
    sudo sysctl -p
  • Recheck with cat /proc/sys/fs/inotify/max_user_watches that the number is indeed increased.
  • Restart the Agent.

Synology NAS

  • Open Synology Control Panel -> Task scheduler
  • Create new triggered task “User-defined script”
    mceclip0.png
  • Pick the “root” user and “Boot-up” event
    mceclip3.png
  • Put the following text to “User defined script” box
    sysctl fs.inotify.max_user_watches=524288

    mceclip4.png

  • Reboot the NAS.

QNAP NAS

  • SSH to your NAS
  • Follow this QNAP instruction to mount config volume
  • Put the script increasing watchers in /tmp/config/autorun.sh file with command
    echo -en "echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf\nsudo sysctl -p\n" > /tmp/config/autorun.sh
  • Apply execute permission and run the autorun.sh with command
    chmod +x /tmp/config/autorun.sh && /tmp/config/autorun.sh
  • Unmount the config volume with command
    umount /tmp/config
  • Open QNAP WebUI, navigate to Control Panel -> Hardware -> General and check the checkbox “Run user defined startup processes” and apply it.
    mceclip0.png
  • The settings will now be applied during every reboot