QNAP TVS-h874X-i9-64G Age old "failed to setup inotify handler" error, even after adding "inotify.max_user_watches=204800" to the sysctl.conf file

Using Syncthing v1.27.2 on a QNAP TVS-h874X-i9-64G with OS version QTS 5.1.4.2596. Help? Regarding the Age old “failed to setup inotify handler” error, even after adding “inotify.max_user_watches=204800” to the sysctl.conf file using what I found in your support doc area.

How can this newbie modify this for my QNAP TVS-H874X with OS version QTS 5.1.4.2596? Please remember that I’m new to the SSH command line. I cann SSH into my server but that’s as far as my experise goes. In addition I’ve followed what I found in your support are as below but it doesnt work, even after I reboot bot my QNAP servers. H-E-L-P??? THANKS IN ADVANCE.

Syncthing Error Recv’d:

Failed to start filesystem watcher for folder your failed to setup inotify handler. Please increase inotify limits, see FAQ — Syncthing documentation

Linux typically restricts the amount of watches per user (usually 8192). When you have more directories you need to adjust that number.

On many Linux distributions you can run the following to fix it:

echo “fs.inotify.max_user_watches=204800” | sudo tee -a /etc/sysctl.conf

Did you reboot? Otherwise you need to modify it directly on /proc as well to make it take effect, as the faq explains.

Yes I did. Still the same on both QNAP server.

Check the kernel value to see if the change took effect:

After logging on via SSH, issue the following command to see the current user watch limit:

cat /proc/sys/fs/inotify/max_user_watches

Hi imsodin. Thanks for the response.
No it didn’t take. When typing your specified command it responded with a value of “262144”.
That is much more than the “204800” recommended by the fix found in you FAQ’s. It should be working with that value of which I don’t know where its getting it from. I’m not Linux saavy enough to know how to change that anywhere. Do we need to change that value for a higher value?

Hi imsodin. Thanks for the response.
No it didn’t take. When typing your specified command it responded with a value of “262144”.
That is much more than the “204800” recommended by the fix found in your FAQ’s. It should still be working with that value of which I don’t know where its getting it from. I’m not Linux saavy enough to know how to change that anywhere. Do we need to change that value to match or change it for a higher value?

I’d say that Syncthing is likely running inside a virtual machine on your QNAP. How did you install Syncthing?

My installation method is as I do with all other apps on my QNAP servers.

I don’t use virtual machine apps or software for anything.

For testing purposes since my normal login with admin equivalence didn’t seem to do the trick I am now using the ADMIN account for this until it can get resolved.
After logging on with the ADMIN account I continue to opening up the App Center Folder, clicking on the “install manually” option, then point to the location of the .qpkg file and letting it install from there using the default settings.
No virtual machines on any of my QNAP servers of which I have two.

What’s the size of the .qpkg file?

It needs to be higher than the number of things to watch (files + directories) on the filesystem.

The file size is 9.92MB as Windows 11 File Explorer reports it and the file name is SyncThing_1.27.2_x86_64.qpkg

What file(s) am I editing to make that change. What are the commands for QNAP. I will be signed in as admin so there are no excuses for the system to say I don’t have enough rights for this purpose only. Thank you.

No idea, I don’t have QNAP, I’m just saying the number isn’t magical - it depends on the size of your data set.

For the time being, instead of editing any files, let’s keep it simple since you’re still getting familiar with the command line and Linux.

SSH onto the QNAP and issue the following command to temporarily change the user watch limit (effect is immediate, no reboot required):

echo 1000000 > /proc/sys/fs/inotify/max_user_watches

Then confirm that it’s been changed:

cat /proc/sys/fs/inotify/max_user_watches

(Your QNAP has a 16-core CPU plus 64GB of RAM, so bumping the limit to 1 million is fine.)

I don’t have a QNAP available to check, but QNAP’s admin account might not necessarily be the same as root on a regular Linux system, so it’s something to keep in mind.

Will try that. Soon as I fix the database sizing issue. Ran into space issues with SyncThing now sucking up almost 1.14TB, that’s right, 1.14TB for the database. Syncing 40TB from one Qnap to the other.

Had to migrate SyncThing over to the 40TB share. Sizing problem solved after a 1 hour migration process. Wow!!!

Yeah, like I said, things here will depend on your actual setup. I suspect that with 40 TB of data the suggested value of 204800 will be rather inadequate.

I used the previously suggested value of 1000,000. That seem to work on my primary QNAP server which has the 64GB RAM in it. That is the server sending to the other QNAP server which is a TVS-872XT-i7-16GB. That server is the receiving sync server and it was complaining too, but since then stopped complaining after I increased from , fs.inotify.max_user_watches=204800, and fs.inotify.max_user_watches=512240. It, too, worked with the value fs.inotify.max_user_watches=1000000. One more thing. None of these values worked no matter what until after I uninstalled syncthing, rebooted, then reinstalled SyncThing with the previously working fs.inotify.max_user_watches=1000000 already in place. Thank you for you support.

IIRC, it’s roughly 1 GB of RAM per million user watches, and that’s only if the entire queue is full, so the other QNAP with 16GB of RAM should be fine (especially since you’re not running any virtual machines).

The only scenario I can see that being the case is if Syncthing was running while fs.inotify.max_user_watches was changed. Restarting Syncthing would have been sufficient. Uninstalling/reinstalling Syncthing doesn’t really have any effect – or is affected by – setting the inotify kernel value.

Note that echo 1000000 > /proc/sys/fs/inotify/max_user_watches is temporary. The limit resets to the kernel default or whatever override might be in /etc/sysctl.conf or the subdirectory /etc/sysctl.d/.

Don’t know what else to do except that when I reboot any of the QNAP NAS servers I have to reapply and increase the max_user_watches back to 1000000 even though I’ve been using the following commands, logged in as admin, just for this purpose because it wasn’t staying either with an admin equivalent account user: echo “fs.inotify.max_user_watches=204800” | sudo tee -a /etc/sysctl.conf over and over. I then confirm that the changes have taken affect by following up with the command: cat /proc/sys/fs/inotify/max_user_watches which returns the value of: 1000000

Is this a QNAP only issue where changes don’t stay after a reboot? Tanks for the assist.