[Bug]: [Watcher] Error: ENOSPC: System limit for number of file watchers reached #2097

Closed
opened 2026-04-25 00:03:25 +02:00 by adam · 2 comments
Owner

Originally created by @bilbags on GitHub (Jul 9, 2024).

What happened?

After updating to the latest version, I noticed the log file had over 50,000 entries with the message "[Watcher] Error: ENOSPC: System limit for number of file watchers reached, watch '<path & filename>' (Watcher.js:81 for 3 of my libraries. Eventually, it showed "INFO: [Watcher] "" Ready" for each of these 3 libraries.

What did you expect to happen?

Not to receive an error... It seems to be working most of the time, but there are times it doesn't detect file changes (additions or removals).

Steps to reproduce the issue

  1. Start the server & check the log

Audiobookshelf version

v2.11.0

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Other (list in "Additional Notes" box)

If the issue is being seen in the UI, what browsers are you seeing the problem on?

None

Logs

7/9/2024 10:01	stdout	[2024-07-09 15:01:11.856] INFO: [Watcher] "NonFiction" Ready

----

{"timestamp":"2024-07-09 15:01:10.525","source":"Watcher.js:81","message":"[Watcher] Error: ENOSPC: System limit for number of file watchers reached, watch '/NonFiction/Will Durant/The Story of Civilization/Volume 5 - 2014 - The Renaissance {Grover Gardner}'","levelName":"ERROR","level":4}
"

---

{"timestamp":"2024-07-05 23:43:28.193","source":"Watcher.js:77","message":"[Watcher] Error: ENOSPC: System limit for number of file watchers reached, watch '/NonFiction/Will Durant/The Story of Civilization/Volume 4 - 1995 - The Age of Faith {Alexander Adams}'","levelName":"ERROR","level":4}

Additional Notes

I checked a log prior to upgrading and it also the errors (included one above from 07/05/24). I only included a few lines from the log, since it has over 55k entries & is over 15MB. It lists files of every type (m4b, mp3, jpg), although there are only a very few jpg files listed. I am running the server via Docker on a Synology server.

Originally created by @bilbags on GitHub (Jul 9, 2024). ### What happened? After updating to the latest version, I noticed the log file had over 50,000 entries with the message "[Watcher] Error: ENOSPC: System limit for number of file watchers reached, watch '<path & filename>' (Watcher.js:81 for 3 of my libraries. Eventually, it showed "INFO: [Watcher] "<name of library>" Ready" for each of these 3 libraries. ### What did you expect to happen? Not to receive an error... It seems to be working most of the time, but there are times it doesn't detect file changes (additions or removals). ### Steps to reproduce the issue 1. Start the server & check the log ### Audiobookshelf version v2.11.0 ### How are you running audiobookshelf? Docker ### What OS is your Audiobookshelf server hosted from? Other (list in "Additional Notes" box) ### If the issue is being seen in the UI, what browsers are you seeing the problem on? None ### Logs ```shell 7/9/2024 10:01 stdout [2024-07-09 15:01:11.856] INFO: [Watcher] "NonFiction" Ready ---- {"timestamp":"2024-07-09 15:01:10.525","source":"Watcher.js:81","message":"[Watcher] Error: ENOSPC: System limit for number of file watchers reached, watch '/NonFiction/Will Durant/The Story of Civilization/Volume 5 - 2014 - The Renaissance {Grover Gardner}'","levelName":"ERROR","level":4} " --- {"timestamp":"2024-07-05 23:43:28.193","source":"Watcher.js:77","message":"[Watcher] Error: ENOSPC: System limit for number of file watchers reached, watch '/NonFiction/Will Durant/The Story of Civilization/Volume 4 - 1995 - The Age of Faith {Alexander Adams}'","levelName":"ERROR","level":4} ``` ### Additional Notes I checked a log prior to upgrading and it also the errors (included one above from 07/05/24). I only included a few lines from the log, since it has over 55k entries & is over 15MB. It lists files of every type (m4b, mp3, jpg), although there are only a very few jpg files listed. I am running the server via Docker on a Synology server.
adam added the bug label 2026-04-25 00:03:25 +02:00
adam closed this issue 2026-04-25 00:03:26 +02:00
Author
Owner

@nichwall commented on GitHub (Jul 9, 2024):

This is an operating system setting, not something that ABS controls. You will need to increase the maximum number of files you can watch (in the OS) or disable the watcher (in ABS).

Related to https://github.com/advplyr/audiobookshelf/issues/3123

@nichwall commented on GitHub (Jul 9, 2024): This is an operating system setting, not something that ABS controls. You will need to increase the maximum number of files you can watch (in the OS) or disable the watcher (in ABS). Related to https://github.com/advplyr/audiobookshelf/issues/3123
Author
Owner

@bilbags commented on GitHub (Jul 11, 2024):

Thanks, @nichwall - I found the command to run to set this higher and thought I'd leave it here for someone who may find this in the future. At least this worked for me on my Synology DS920+ running DSM 7.x.

image

My understanding is that this command makes the change permanent (persistent after a NAS reboot). I used the max number of watchers, but I could have chosen a lower number. I have plenty of RAM, so I wasn't worried about any performance issues with the increase to maximum.

You can check the current number of active watchers by running: sysctl fs.inotify.max_user_watches

@bilbags commented on GitHub (Jul 11, 2024): Thanks, @nichwall - I found the command to run to set this higher and thought I'd leave it here for someone who may find this in the future. At least this worked for me on my Synology DS920+ running DSM 7.x. ![image](https://github.com/advplyr/audiobookshelf/assets/109483059/721b4324-40f4-4763-9f65-325fc1e81e63) My understanding is that this command makes the change permanent (persistent after a NAS reboot). I used the max number of watchers, but I could have chosen a lower number. I have plenty of RAM, so I wasn't worried about any performance issues with the increase to maximum. You can check the current number of active watchers by running: sysctl fs.inotify.max_user_watches
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2097