mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-30 23:40:40 +02:00
[Bug]: Server crash when reaching maximum file watchers #2165
Closed
opened 2026-04-25 00:04:22 +02:00 by adam
·
43 comments
No Branch/Tag Specified
master
book_tags_genres_dedupe
episode_download_fallback
Issue-4540-SortBy-StartedDate-and-FinishedDate
episode_meta_tagging
fix_authorize_race_condition
redirect_transcode_requests
progress_updated_sort
fix_ereader_socket_event
fix_change_empty_root_password
fix_podcast_session_track_index
fix_set_token
session_modal_user
localize_durations
fix_oidc_create_user
jwt_auth_refactor
fix_scanner_deleting_single_file_books
fix_mediaprogress_updatedat_2
experimental_next_client
podcast_episode_duration
episode-timestamps-clickable
book_author_secondary_sort_title
podcast_useragents
pathexists_user_access
fix_pathexists_join
book_author_secondary_sort
clean_duplicate_mediaprogress
sanitize_html_description
trix_prevent_attachments
check_path_api_fix
fix_mediaprogress_updatedat
increase_express_json_limit
fix_dockerfile_nunicode
search_episodes
audiobook_tools_update
episode_secondary_sorts
hls_stream_url_update
new_session_track_endpoint
audiobook_tools_enhancements
watcher_rescans_update
player_track_tooltip
fix_exclude_prefixes_crash
socket_item_events
fix_podcast_episode_scanner_promise
new_stats_controller
count_cache_for_userpermissions
parsing-opf-v3
validate_migration_files
fix-quick-match-all-crash
fix-chapter-end-sleep-timer
stringify_sequelize_query
remove-col-ambiguity
fix_next_prev_edit_description
details_trim_whitespace
fix_content_url_basepath
fix_logger_fatal
progress_bar_visibility
batch-edit-populate-map-details
feed_generator_updates
bookmark-modal-updates
migrate-library-item-in-scanner
migrate-new-library-items
migrate-podcasts-new-library-item-2
migrate-podcasts-new-library-item
fix-remove-episode-from-playlist
playback-session-use-new-library-item
refactor-library-item
fix-heatmap-caption
feed-episodes-upsert
share-media-player-media-session-api
remove-old-playlist
remove_old_collection_object
plugin-implementation-demo
feed_migration
refactor-feeds-from-item
fix_remove_authors_no_books
v2.17.3-fk-constraints-migration
migrations-first-upgrade
sqlite_2
feature/nuxt-target-server
waveform
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1
v1.3.4
v1.3.3
v1.3.1
v1.2.8
v1.2.6
v1.2.5
v1.2.4
v1.2.1
v1.1.15
v1.1.14
v1.1.13
v1.1.12
v1.1.11
v1.1.10
v1.1.9
v1.1.8
v1.0.0
0.9.61-beta.0
0.9.61-beta
Labels
Clear labels
authentication
backlog
bug
chapter editor
config-issue
ebooks
encoding/embedding
enhancement
help wanted
listening sessions & progress
planned
possible plugin
progress sync
pull-request
sorting/filtering/searching
unable to reproduce
upload
users & permissions
waiting
Mirrored from GitHub Pull Request
No Label
bug
Milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
adam (Adam Melkus)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/audiobookshelf#2165
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MikeGold on GitHub (Aug 8, 2024).
What happened?
I'm using audiobookshelf for way over a year now. I never had issues with it. Recently I've added a lot of books and yesterday I've noticed for the first time that the audiobookshelf is crashed. I can't reach the webpage. To fix it I had to manually restart the container (although it has option to autorestart). This morning it crashed again. I've checked the logs and it seems to be filled with errors like this:
[Watcher] Error: ENOSPC: System limit for number of file watchers reached, watch '/audiobooks/Terry Pratchett/Świat Dysku/Vol 26 Złodziej czasu/@eaDir/07 Złodziej czasu.mp3'
The errors were generating non stop. I have stopped watcher in the settings, restarted the container and it works so far without errors. But it's odd.
I'm using audiobookshelf in the docker on Synology NAS 920+
2024-08-08.txt
What did you expect to happen?
I expected the page to load
Steps to reproduce the issue
Audiobookshelf version
v2.12.1
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?
Chrome
Logs
Additional Notes
Synology NAS docker
Checked on multiple browsers both mobile and desktop, on multiple internet connections local/remote.
@Vito0912 commented on GitHub (Aug 8, 2024):
You've hit the maximum number of file watchers allowed. Fortunately, you can adjust this limit on most os's.
See also: https://github.com/advplyr/audiobookshelf/issues/905
The following comment seems to be for Synology NAS:
https://github.com/advplyr/audiobookshelf/issues/905#issuecomment-1333287237
@MikeGold commented on GitHub (Aug 8, 2024):
I've added the command on start of Synology, and still got the error. But when I run the task on it's own after it booted, I haven't received any errors (yet). So I guess it's ok. Still, is it ok that it crashes the whole Audiobookshelf when it runs out of watchers?
@nichwall commented on GitHub (Aug 8, 2024):
Do you have anything in
crash-logs.txt? ABS is probably crashing for a different reason@MikeGold commented on GitHub (Aug 8, 2024):
No such file in the logs. The log from yesterday is a bare minimum, not stating any crash or anything. The only errors I've noticed were those watchers.
@ajurna commented on GitHub (Aug 8, 2024):
i've had the same happen to me. only thing in my crash log is below.
{"timestamp":"2024-08-03 12:03:38.531","source":"Server.js:171","message":"[Server] Unhandled rejection: [object Object], promise: Promise {\n <rejected> {\n message: 'Parsing filters is unsupported.',\n name: 'Error',\n stack: 'Error: Parsing filters is unsupported.\\n' +\n ' at ArchiveReader.entries (/server/libs/libarchive/wasm-module.js:110:17)\\n' +\n ' at entries.next (<anonymous>)\\n' +\n ' at MessagePort.<anonymous> (/server/libs/libarchive/libarchiveWorker.js:43:20)\\n' +\n ' at [nodejs.internal.kHybridDispatch] (node:internal/event_target:820:20)\\n' +\n ' at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)'\n }\n}","levelName":"FATAL","level":5}@rpgdev commented on GitHub (Aug 8, 2024):
I'm having the same issue.. I just started using abs a few weeks ago so I only have 21 books on it. If it's because of file watchers then it's quite a coincidence. My primary language is Spanish and this happened without me realizing it at first just finding the container crashed and unable to access it then "matching" authors with Spanish names.
@rpgdev commented on GitHub (Aug 8, 2024):
This is my crash log:
@Scarprovider commented on GitHub (Aug 8, 2024):
Same here, running on a Synology docker for more than 6 months without issue. Today just crashed, no upgrade involve, without any reason and showed Unhealthy status in Portainer. A simple restart and ABS is running great again.
Error text:
[AudioBookShelf] [🔴 Down] Request failed with status code 524
@glacasa commented on GitHub (Aug 8, 2024):
Same here !
I run audiobookshelf in Docker, in a VPS. No problem for months, and then 2 crashes in the last 2 days.
The app just stops responding, nothing loads until I get a timeout. No error in the logs.
I'm also on version v2.12.1
@Vito0912 commented on GitHub (Aug 8, 2024):
Do your CPU spikes during the downtime?
@glacasa commented on GitHub (Aug 8, 2024):
I can't tell because I don't monitor the server cpu, sorry 😅
But after looking this other issue, it seems I have the same problem : some people noticed ABS crashed after 24 hours, and I can confirm the second crash happened 24 hours after the last restart
@MikeGold commented on GitHub (Aug 8, 2024):
For me it was also 2 crashes in the last 48 hours and no issues whatsoever in the past. My CPU does not spike and I never have downtimes as the same NAS is running a quite massive Plex server and about 10 other docker containers. Everything is incredibly stable and never freezes. It's the only docker container that I ever seen crashing. Maybe I'm just lucky...
@nikolausmoll commented on GitHub (Aug 8, 2024):
Same here... didn't change anything, had to restart ABS yesterday and after about 24h right now again.
Can't remember any ABS crash before.
@bloodscript commented on GitHub (Aug 8, 2024):
I today had this issue the second time, approximately 24 Hours After Last occurance. I looked into the Logs and found nothing that made me think that I found the issue. Will provide the Logs tomorrow. Running in Container on Pi for 6 Montag without any issues. Watchtower may have upgraded the Image...
@rweatherly commented on GitHub (Aug 8, 2024):
same issue here. after the lates update (skipped 2.12.0 went directly to 2.12.1. haven't added any books, and same 2 users using it daily and the container has crashed each day now since the update
@ghost commented on GitHub (Aug 9, 2024):
Mine was at 99% of one cpu, which is how I found that it was not responding. It has crashed twice now.
@vicerious001 commented on GitHub (Aug 9, 2024):
I think I'm having this issue also since updating to 2.12.1. The container stops responding to web requests almost exactly 24 hours after it was started.
@rweatherly commented on GitHub (Aug 9, 2024):
im seeing the same thing, it was 24 hours from the restart yesterday till when it crashed again today
@daneroo commented on GitHub (Aug 9, 2024):
Similar issue, 2 restarts in 2 days. Never happened before 2.12.1.
(docker compose on ubuntu 22.04)
Would love to help diagnose this; Let us know how to help to resolve this.
@lyguang90716 commented on GitHub (Aug 9, 2024):
I think I'm having this issue also since updating to 2.12.1
@nichwall commented on GitHub (Aug 9, 2024):
Release 2.12.2 released earlier today reverted the new Memory store, so the server should not stop responding after 24 hours
@AemonCao commented on GitHub (Aug 9, 2024):
After updating to 2.12.2 I can't start the container.
@olnir commented on GitHub (Aug 9, 2024):
Same here.
Running in docker on Synology.
Had no issues until upgrading to latest version.
@rpgdev commented on GitHub (Aug 9, 2024):
Updated to 2.12.2 and I see no issues on the logs so far 🤞
@nikolausmoll commented on GitHub (Aug 9, 2024):
@rpgdev: When did you update to 2.12.2?
@rpgdev commented on GitHub (Aug 9, 2024):
@nikolausmoll just now.
@nikolausmoll commented on GitHub (Aug 9, 2024):
okay, it is not about the bug but about what AemonCao wrote?
My ABS is running 2.12.2 since 2024-08-09 06:04:00 (UTC+2 I guess), almost 9 hours, but I care for what happens tonight.
@SyndicatedPillbug commented on GitHub (Aug 9, 2024):
Glad this isn't just me. I keep getting a "Warning" on my Container Manager in Synology. The container hasn't fully crashed, but it's not responding. This has happened three times in the last four or so days. I have to restart the container. Then it works for a while, but I inevitably have to go back and restart it again.
In the ABS logs I don't see an error, just "WARN Removed 1 sessions that were 3 seconds or less"
@MikeGold commented on GitHub (Aug 9, 2024):
So I've mentioned yesterday that I've turned off the watchers and my logs were absolutely error free since. Today, about 24 hours since the last restart, my audiobookshelf had a fullblown crash that forced the docker container to restart. Well, that's something different. No crash logs :D.
Should I update to 2.12.2? Some said that it's not starting for them...
@AemonCao commented on GitHub (Aug 9, 2024):
Sorry, my reply may be off topic.
After an update, the container suddenly became inaccessible (it could run normally for a while after restart), but it became inaccessible again after a while (usually the next day). So today I updated to the latest version 2.12.2. Then the container became inaccessible.
After that, I had to downgrade to 2.11.0, which is still normal. I don’t know if the original inaccessibility problem will occur again tomorrow.
@ghost commented on GitHub (Aug 9, 2024):
Working fine on 2.12.2 here, no crashes, no high cpu
@SyndicatedPillbug commented on GitHub (Aug 9, 2024):
Container crashed today. Not a weir freeze with a Warning like I saw before, but an actual crash notification. It auto-restarted fine, but...
@nikolausmoll commented on GitHub (Aug 9, 2024):
I guess no one here tested 2.12.2 long enough to say that it does not crash after a day... i can tell tomorrow morning, if it crashed.
@advplyr commented on GitHub (Aug 9, 2024):
@SyndicatedPillbug that warning isn't related to any crash. Are you able to get the actual crash log?
It would be in
/metadata/logs/crash_logs.txt@SyndicatedPillbug commented on GitHub (Aug 9, 2024):
I don't see any crash_logs file, sadly. :/
@advplyr commented on GitHub (Aug 10, 2024):
This issue got derailed into completely separate issues. This is specific to the server crashing when the system cannot assign anymore file watchers.
I will leave this open because we should try to handle this more gracefully and disable the watcher.
Any issues unrelated to file watchers should go in another thread.
@rpgdev commented on GitHub (Aug 10, 2024):
@advplyr roger! I'll unwatch this issue since my issue was different, it just happened to coincide and the title of the bug described my situation (or someone linked it in a different one that was related).
@MikeGold commented on GitHub (Aug 10, 2024):
@advplyr It was proven here, that my crashes were not related to the watchers errors, but were some other issue that does not leave trace in logs. Multiple other people had the same issue as I did (with semi crash after 24 hours) and reported it here. If you are planning to limit this bug report to just watchers, can you please point all of us to some new bug post that we can follow for that 24 hours crash? I don't think that anyone care about watchers, but the daily crashes are rather major issue for all of us.
Or maybe alternatively you'd like me to open a new bug?
@MikeGold commented on GitHub (Aug 10, 2024):
@nikolausmoll Regardless everything else, please let us know in here tomorrow if the server crashed for you again.
@nikolausmoll commented on GitHub (Aug 10, 2024):
I will. Didn't crash so far (17h runtime)

@MikeGold commented on GitHub (Aug 10, 2024):
I believe that most appropriate place for the issue we all experienced is this bug: #3251
So it may be better to move there.
@nikolausmoll commented on GitHub (Aug 10, 2024):
agreed
@advplyr commented on GitHub (Aug 10, 2024):
Ah okay thanks. I see the watcher isn't causing a crash, just an error message like it should.
The 24h server locking up issue was the MemoryStore fixed in v2.12.2 reported in #3251.
Then there was a server crash issue happening that was fixed in v2.12.3.
Thanks to everyone reporting the issues