[Bug]: System limit for number of file watchers reached Error #579

Closed
opened 2026-04-24 23:13:29 +02:00 by adam · 13 comments
Owner

Originally created by @Cobolt78 on GitHub (Aug 12, 2022).

Describe the issue

Started to receive this error lately when adding books, if I add multiple books at a time the watched folder normally only adds the first book. All books are added to audiobookshelf library if I do a manual scan.

Audiobookshelf error

Let me know if you require any additional information or if I can try/test something.

Thanks

Steps to reproduce the issue

  1. When multiple books are added at the same time.

Audiobookshelf version

2.1.2

How are you running audiobookshelf?

Docker

Originally created by @Cobolt78 on GitHub (Aug 12, 2022). ### Describe the issue Started to receive this error lately when adding books, if I add multiple books at a time the watched folder normally only adds the first book. All books are added to audiobookshelf library if I do a manual scan. ![Audiobookshelf error](https://user-images.githubusercontent.com/104347696/184273221-8b3b196e-ccb4-4629-84b2-33a36a2c7153.jpg) Let me know if you require any additional information or if I can try/test something. Thanks ### Steps to reproduce the issue 1. When multiple books are added at the same time. ### Audiobookshelf version 2.1.2 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:13:29 +02:00
adam closed this issue 2026-04-24 23:13:29 +02:00
Author
Owner

@Cobolt78 commented on GitHub (Sep 5, 2022):

Just to let advplyr know I still am having this issue, do you know if it is a known issue or is it just me?
Thanks

@Cobolt78 commented on GitHub (Sep 5, 2022): Just to let advplyr know I still am having this issue, do you know if it is a known issue or is it just me? Thanks
Author
Owner

@advplyr commented on GitHub (Sep 27, 2022):

I haven't seen this error before. Are you able to narrow down exactly when this happens?

@advplyr commented on GitHub (Sep 27, 2022): I haven't seen this error before. Are you able to narrow down exactly when this happens?
Author
Owner

@Cobolt78 commented on GitHub (Oct 3, 2022):

I have got a few new screenshots and events/triggers when it happens.
When I restart the Audiobookshelf server I get 500+ of these errors.
Restart audiobookshelf 1
Restart audiobookshelf 2
When I copy 9 new books (same series) over the watcher picked up 2 of the books automatically
adding 9 new 1
adding 9 new 2
adding 9 new 3
as you can see in the next pic the watcher only picked up 2 new books
adding 9 new 4
After a manual scan all books are added and logs show no errors during the manual scan
after manual scan

If there is anything I can try let me know.
Also this is just a quess and I have no evidence but I think this issue may have started after the 1000th different series added.

@Cobolt78 commented on GitHub (Oct 3, 2022): I have got a few new screenshots and events/triggers when it happens. When I restart the Audiobookshelf server I get 500+ of these errors. ![Restart audiobookshelf 1](https://user-images.githubusercontent.com/104347696/193490452-cc7d25a8-ce60-47f6-a8a6-1a400c5a7748.jpg) ![Restart audiobookshelf 2](https://user-images.githubusercontent.com/104347696/193490478-0261c595-9ea1-4f19-a58a-85132c5fe7a2.jpg) When I copy 9 new books (same series) over the watcher picked up 2 of the books automatically ![adding 9 new 1](https://user-images.githubusercontent.com/104347696/193500379-22b4316c-2958-4bd2-aea5-cda2cb298054.jpg) ![adding 9 new 2](https://user-images.githubusercontent.com/104347696/193500405-05752bbd-aa01-4719-b7a3-4e901dfb873a.jpg) ![adding 9 new 3](https://user-images.githubusercontent.com/104347696/193500417-5ad3fd81-3026-4a0b-88ce-d71e538a14ce.jpg) as you can see in the next pic the watcher only picked up 2 new books ![adding 9 new 4](https://user-images.githubusercontent.com/104347696/193500551-2a878140-c399-4e41-b8ad-db0379103bc8.jpg) After a manual scan all books are added and logs show no errors during the manual scan ![after manual scan](https://user-images.githubusercontent.com/104347696/193500605-621cc986-e1b5-4486-93b3-4fb7602bf497.jpg) If there is anything I can try let me know. Also this is just a quess and I have no evidence but I think this issue may have started after the 1000th different series added.
Author
Owner

@Cobolt78 commented on GitHub (Oct 3, 2022):

This time I have added 6 new books, 3 different series (new series). 3 books from 1 series, 2 books from another series and 1 book from another series.
6 new added 1
6 new added 2
6 new added 3
6 new added 4
6 new added 5
As you can see in the following pic only 3 have been added, 1 from each new series.
only 3 added 1
Here is a pic of the added files/names
mp3tag
Here is a pic after a manual scan and as you can see the other books have been added to the series, the logs showed no errors during manual scan.
after manual scan new
Let me know if you want to know anything else or can try something for you.

@Cobolt78 commented on GitHub (Oct 3, 2022): This time I have added 6 new books, 3 different series (new series). 3 books from 1 series, 2 books from another series and 1 book from another series. ![6 new added 1](https://user-images.githubusercontent.com/104347696/193508622-0395f158-4d28-4c92-bd1e-6d37a09ce54f.jpg) ![6 new added 2](https://user-images.githubusercontent.com/104347696/193508636-8d0183e7-9207-4565-a73c-987417abe1da.jpg) ![6 new added 3](https://user-images.githubusercontent.com/104347696/193508659-544c9301-81ed-4bc5-96af-dc182fe55bbb.jpg) ![6 new added 4](https://user-images.githubusercontent.com/104347696/193508699-381403ca-f601-478d-87b2-cc9162ad2ec1.jpg) ![6 new added 5](https://user-images.githubusercontent.com/104347696/193508711-f6f62f3e-5775-4c5b-ae90-a52dfc5d1dc7.jpg) As you can see in the following pic only 3 have been added, 1 from each new series. ![only 3 added 1](https://user-images.githubusercontent.com/104347696/193508781-27184502-64c1-4176-8c65-44c452fc86e0.jpg) Here is a pic of the added files/names ![mp3tag](https://user-images.githubusercontent.com/104347696/193508817-0034bf6d-b9f5-47a9-b4c0-d5ce9ff5f0ac.jpg) Here is a pic after a manual scan and as you can see the other books have been added to the series, the logs showed no errors during manual scan. ![after manual scan new](https://user-images.githubusercontent.com/104347696/193509043-b1930300-80a5-4f53-87e5-8ae0e54a5224.jpg) Let me know if you want to know anything else or can try something for you.
Author
Owner

@Cobolt78 commented on GitHub (Oct 3, 2022):

This time I copied over the 4 remaining books too the Princess of the Ironbound series
Barbarian Alchemist
Barbarian Gladiator
Barbarian Dragonslayer
Barbarian Conqueror
As you can see I still got errors in the above pics, but as you can see in the following pic they were all added automatically by the watcher, from this it appears as though the errors have no bearing if they are added by the watcher?
watcher added
As stated previously it only seems to happen if I add multiple books from a new series, the watcher might add 1 or 2 books but not the entire series until I do a manual scan.

@Cobolt78 commented on GitHub (Oct 3, 2022): This time I copied over the 4 remaining books too the Princess of the Ironbound series ![Barbarian Alchemist](https://user-images.githubusercontent.com/104347696/193512229-bac952ca-7f5c-47f9-a3f7-0d11b5f2d6f4.jpg) ![Barbarian Gladiator](https://user-images.githubusercontent.com/104347696/193512252-24df84c6-c09b-494a-b243-bcb0c3e612c5.jpg) ![Barbarian Dragonslayer](https://user-images.githubusercontent.com/104347696/193512263-03688f5f-3cff-469e-891d-b40004870c11.jpg) ![Barbarian Conqueror](https://user-images.githubusercontent.com/104347696/193512277-3da9e509-3a15-4745-bb95-8102331ef547.jpg) As you can see I still got errors in the above pics, but as you can see in the following pic they were all added automatically by the watcher, from this it appears as though the errors have no bearing if they are added by the watcher? ![watcher added](https://user-images.githubusercontent.com/104347696/193512397-57c62153-d839-4538-be80-825a54720499.jpg) As stated previously it only seems to happen if I add multiple books from a new series, the watcher might add 1 or 2 books but not the entire series until I do a manual scan.
Author
Owner

@Hoempi commented on GitHub (Nov 14, 2022):

I get the same error, running on a Synology NAS. @Cobolt78 what system are you using to host audiobookshelf?

I found this question on stackoverflow, which might explain it. But I am unsure whether the command should be run on the NAS itself or the Docker container.

Also, I am somewhat hesitant as due to a possible impact on overall system performance.

@Hoempi commented on GitHub (Nov 14, 2022): I get the same error, running on a Synology NAS. @Cobolt78 what system are you using to host audiobookshelf? I found [this question on stackoverflow](https://stackoverflow.com/questions/53930305/nodemon-error-system-limit-for-number-of-file-watchers-reached), which might explain it. But I am unsure whether the command should be run on the NAS itself or the Docker container. Also, I am somewhat hesitant as due to a possible impact on overall system performance.
Author
Owner

@feuerkind99 commented on GitHub (Nov 30, 2022):

I'm having the same issue ... looks like if this problem has something to do withe the number of files in the librarys as this problem was not here from beginning but started suddenly when I was adding a lot of books ... at the beginning, when testing with 3-400 books everything was fine ... currently I have about 2000 books most of them with more mp3 files so there are a lot of files ...

@feuerkind99 commented on GitHub (Nov 30, 2022): I'm having the same issue ... looks like if this problem has something to do withe the number of files in the librarys as this problem was not here from beginning but started suddenly when I was adding a lot of books ... at the beginning, when testing with 3-400 books everything was fine ... currently I have about 2000 books most of them with more mp3 files so there are a lot of files ...
Author
Owner

@advplyr commented on GitHub (Nov 30, 2022):

This does have to do with the number of files in your libraries but the limit is set by your system. I have seen libraries with 250k+ audio files that don't hit this limit.
If you don't want to increase the limit on your system or it doesn't make sense there is a "Disable Watcher" setting you can enable. You can also enable this on individual libraries so if there is one big library you don't want to watch then you can disable that one.

@advplyr commented on GitHub (Nov 30, 2022): This does have to do with the number of files in your libraries but the limit is set by your system. I have seen libraries with 250k+ audio files that don't hit this limit. If you don't want to increase the limit on your system or it doesn't make sense there is a "Disable Watcher" setting you can enable. You can also enable this on individual libraries so if there is one big library you don't want to watch then you can disable that one.
Author
Owner

@advplyr commented on GitHub (Nov 30, 2022):

The reason that you can schedule automatic library scans in Abs is because some users don't use the Watcher. That is an option for you as well so you don't have to manually scan.

@advplyr commented on GitHub (Nov 30, 2022): The reason that you can schedule automatic library scans in Abs is because some users don't use the Watcher. That is an option for you as well so you don't have to manually scan.
Author
Owner

@advplyr commented on GitHub (Nov 30, 2022):

I'm going to consider this closed since it is to do with your system and not Abs. I'm not really familiar with how to change the max file watchers in all the different systems but I'm sure it is easy enough to find.

@advplyr commented on GitHub (Nov 30, 2022): I'm going to consider this closed since it is to do with your system and not Abs. I'm not really familiar with how to change the max file watchers in all the different systems but I'm sure it is easy enough to find.
Author
Owner

@feuerkind99 commented on GitHub (Nov 30, 2022):

ABS is currently running as a docker image on my synology. Sorry to say that I don't have enough linux know how to change this setting ... if anyone could give me a hint? I guess this limitation must be somewhere inside the docker image but I'm not able to get a "shell" working as bash is not exepted but as I said there is a lot of linux knowledge missing on my side :-( But even if I could change this value I'd guess this change will be gone if I update the image to a new version? right?

@feuerkind99 commented on GitHub (Nov 30, 2022): ABS is currently running as a docker image on my synology. Sorry to say that I don't have enough linux know how to change this setting ... if anyone could give me a hint? I guess this limitation must be somewhere inside the docker image but I'm not able to get a "shell" working as bash is not exepted but as I said there is a lot of linux knowledge missing on my side :-( But even if I could change this value I'd guess this change will be gone if I update the image to a new version? right?
Author
Owner

@advplyr commented on GitHub (Nov 30, 2022):

I just searched "synology nas max_user_watches" and saw many results.

@advplyr commented on GitHub (Nov 30, 2022): I just searched "synology nas max_user_watches" and saw many results.
Author
Owner

@feuerkind99 commented on GitHub (Dec 1, 2022):

thanks! ... this pointed me to the right direction ... I guessed this was a setting inside docker but it turned out to be a setting on synology ... hopfully solved it by adding a task on startup with "sh -c '(sleep 90 && sudo sysctl fs.inotify.max_user_watches=204800)&'" lets see if this is the right solution.

@feuerkind99 commented on GitHub (Dec 1, 2022): thanks! ... this pointed me to the right direction ... I guessed this was a setting inside docker but it turned out to be a setting on synology ... hopfully solved it by adding a task on startup with "sh -c '(sleep 90 && sudo sysctl fs.inotify.max_user_watches=204800)&'" lets see if this is the right solution.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#579