Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
bilbags opened this issue Jul 9, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@bilbags
Copy link

bilbags commented 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.

@bilbags bilbags added the bug Something isn't working label Jul 9, 2024
@nichwall
Copy link
Contributor

nichwall commented 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 #3123

@advplyr advplyr closed this as not planned Won't fix, can't repro, duplicate, stale Jul 9, 2024
@bilbags
Copy link
Author

bilbags commented 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants