Stirling-Tools / Stirling-PDF

#1 Locally hosted web application that allows you to perform various operations on PDF files
MIT License
41.73k stars 3.31k forks source link

FAQ: "unable to register monitoring" on Synology #1728

Closed mpstein closed 3 weeks ago

mpstein commented 3 weeks ago

This issue is being submitted and then closed so that others can benefit from my suffering.

Installation model: Docker Platform: Synology NAS

Error from logs:

WARN s.s.S.u.FileMonitor [scheduling-1] not monitoring any directory, even the root directory itself: ./pipeline/watchedFolders
ERROR s.s.S.u.FileMonitor [scheduling-1] unable to register monitoring
java.io.IOException: User limit of inotify watches reached
        at java.base/sun.nio.fs.LinuxWatchService$Poller.implRegister(LinuxWatchService.java:257)
        at java.base/sun.nio.fs.AbstractPoller.processRequests(AbstractPoller.java:266)
        at java.base/sun.nio.fs.LinuxWatchService$Poller.run(LinuxWatchService.java:357)
        at java.base/java.lang.Thread.run(Thread.java:1583)

Solution: This is caused due to the Synology's low default amount for max_user_watches. Based on the documentation from SyncThing, the following instructions were provided by Zeuhl on Reddit.

Go to Control Panel > Task Scheduler.
Create a New Task > Triggered Task > User-defined script.
In General Settings tab: give it a name (e.g. “sysctl inotify fix”) and Event = Boot-up.
In the Task Settings tab: enter this in the Run Command box:

sh -c '(sleep 90 && echo 204800 > /proc/sys/fs/inotify/max_user_watches)&'
mpstein commented 3 weeks ago

Closing issue to serve as FAQ per Froodle's recommendation in Discord.