Repository navigation
[Bug]: Server hang/crash - FATAL: [Server] Unhandled rejection: Error #4908
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
Server hangs every one to few days.
What did you expect to happen?
Server to not hang and work as expected.
Steps to reproduce the issue
- Start server
- Observe it hangs and stops responding after few hours "503 Service Unavailable"
Audiobookshelf version
2.31.0
How are you running audiobookshelf?
Built from source
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
[2025-12-11 15:54:12.432] DEBUG: Loaded 1 of 1 items for "Listen/Read Again" in 0.00s
[2025-12-11 15:54:12.434] DEBUG: Loaded 3 of 3 authors for "Newest Authors" in 0.00s
[2025-12-11 15:54:12.434] DEBUG: Loaded 6 personalized shelves in 0.08s
[2025-12-11 15:54:12.434] DEBUG: [ApiCacheManager] Cache miss: {"user":"Marian","url":"/libraries/8c3ec8ef-7cfb-4b8a-b37a-143c2e0ea62c/personalized"}
[2025-12-11 15:54:12.434] DEBUG: [ApiCacheManager] Caching with 1800000 ms TTL
[2025-12-11 15:54:13.467] DEBUG: [ApiCacheManager] count: 2 size: 65758
[2025-12-11 15:54:13.468] DEBUG: [ApiCacheManager] Cache hit: {"user":"Marian","url":"/libraries/8c3ec8ef-7cfb-4b8a-b37a-143c2e0ea62c/personalized"}
[2025-12-11 15:54:13.940] DEBUG: [ApiCacheManager] count: 2 size: 65758
[2025-12-11 15:54:13.969] DEBUG: [ApiCacheManager] count: 2 size: 65758
[2025-12-11 15:54:14.111] DEBUG: [ApiCacheManager] Cache miss: {"user":"Marian","url":"/libraries/8c3ec8ef-7cfb-4b8a-b37a-143c2e0ea62c/series?minified=1&sort=name&limit=10000"}
[2025-12-11 15:54:14.128] DEBUG: [ApiCacheManager] Cache miss: {"user":"Marian","url":"/libraries/8c3ec8ef-7cfb-4b8a-b37a-143c2e0ea62c/authors"}
[2025-12-11 15:54:14.771] DEBUG: [ApiCacheManager] count: 4 size: 685987
[2025-12-11 15:54:15.475] DEBUG: [ApiCacheManager] Cache miss: {"user":"Marian","url":"/libraries/8c3ec8ef-7cfb-4b8a-b37a-143c2e0ea62c/collections?minified=1&sort=name&limit=1000"}
[2025-12-11 15:54:15.568] DEBUG: [ApiCacheManager] count: 4 size: 685987
[2025-12-11 15:54:15.569] DEBUG: [ApiCacheManager] count: 4 size: 685987
[2025-12-11 15:54:15.570] DEBUG: [ApiCacheManager] count: 4 size: 685987
[2025-12-11 15:54:15.571] DEBUG: [ApiCacheManager] count: 4 size: 685987
[2025-12-11 15:54:15.592] FATAL: [Server] Unhandled rejection: Error
at Database.<anonymous> (/root/audiobookshelf/node_modules/sequelize/lib/dialects/sqlite/query.js:185:27)
at /root/audiobookshelf/node_modules/sequelize/lib/dialects/sqlite/query.js:183:50
at new Promise (<anonymous>)
at Query.run (/root/audiobookshelf/node_modules/sequelize/lib/dialects/sqlite/query.js:183:12)
at /root/audiobookshelf/node_modules/sequelize/lib/sequelize.js:315:28
at async SQLiteQueryInterface.select (/root/audiobookshelf/node_modules/sequelize/lib/dialects/abstract/query-interface.js:407:12)
at async book.findAll (/root/audiobookshelf/node_modules/sequelize/lib/model.js:1140:21)
at async Promise.all (index 1)
at async book.findAndCountAll (/root/audiobookshelf/node_modules/sequelize/lib/model.js:1322:27)
at async findAndCountAll (/root/audiobookshelf/server/utils/queries/libraryItemsBookFilters.js:380:12) {
name: 'SequelizeDatabaseError',
parent: [Error: SQLITE_ERROR: no such column: "be3fa60f-d9a3-4398-b132-7835374f51d7" - should this be a string literal in single-quotes?] {
errno: 1,
code: 'SQLITE_ERROR',
sql: 'SELECT `book`.`id`, `book`.`title`, `book`.`titleIgnorePrefix`, `book`.`subtitle`, `book`.`publishedYear`, `book`.`publishedDate`, `book`.`publisher`, `book`.`description`, `book`.`isbn`, `book`.`asin`, `book`.`language`, `book`.`explicit`, `book`.`abridged`, `book`.`coverPath`, `book`.`duration`, `book`.`narrators`, `book`.`audioFiles`, `book`.`ebookFile`, `book`.`chapters`, `book`.`tags`, `book`.`genres`, `book`.`createdAt`, `book`.`updatedAt`, IFNULL((SELECT s.name FROM bookSeries AS bs, series AS s WHERE bs.seriesId = s.id AND bs.bookId = book.id AND bs.id IN ("be3fa60f-d9a3-4398-b132-7835374f51d7")), `libraryItem`.`title`) AS `display_title`, `libraryItem`.`id` AS `libraryItem.id`, `libraryItem`.`ino` AS `libraryItem.ino`, `libraryItem`.`path` AS `libraryItem.path`, `libraryItem`.`relPath` AS `libraryItem.relPath`, `libraryItem`.`mediaId` AS `libraryItem.mediaId`, `libraryItem`.`mediaType` AS `libraryItem.mediaType`, `libraryItem`.`isFile` AS `libraryItem.isFile`, `libraryItem`.`isMissing` AS `libraryItem.isMissing`, `libraryItem`.`isInvalid` AS `libraryItem.isInvalid`, `libraryItem`.`mtime` AS `libraryItem.mtime`, `libraryItem`.`ctime` AS `libraryItem.ctime`, `libraryItem`.`birthtime` AS `libraryItem.birthtime`, `libraryItem`.`size` AS `libraryItem.size`, `libraryItem`.`lastScan` AS `libraryItem.lastScan`, `libraryItem`.`lastScanVersion` AS `libraryItem.lastScanVersion`, `libraryItem`.`libraryFiles` AS `libraryItem.libraryFiles`, `libraryItem`.`extraData` AS `libraryItem.extraData`, `libraryItem`.`title` AS `libraryItem.title`, `libraryItem`.`titleIgnorePrefix` AS `libraryItem.titleIgnorePrefix`, `libraryItem`.`authorNamesFirstLast` AS `libraryItem.authorNamesFirstLast`, `libraryItem`.`authorNamesLastFirst` AS `libraryItem.authorNamesLastFirst`, `libraryItem`.`createdAt` AS `libraryItem.createdAt`, `libraryItem`.`updatedAt` AS `libraryItem.updatedAt`, `libraryItem`.`libraryId` AS `libraryItem.libraryId`, `libraryItem`.`libraryFolderId` AS `libraryItem.libraryFolderId`, `authors`.`id` AS `authors.id`, `authors`.`name` AS `authors.name` FROM `books` AS `book` INNER JOIN `libraryItems` AS `libraryItem` ON `book`.`id` = `libraryItem`.`mediaId` AND (`libraryItem`.`libraryId` = \'8c3ec8ef-7cfb-4b8a-b37a-143c2e0ea62c\' AND `libraryItem`.`mediaType` = \'book\') INNER JOIN ( `bookAuthors` AS `authors->bookAuthor` INNER JOIN `authors` AS `authors` ON `authors`.`id` = `authors->bookAuthor`.`authorId`) ON `book`.`id` = `authors->bookAuthor`.`bookId` AND `authors`.`id` = \'8f91751e-cab6-4901-add0-428a6d634e0b\' ORDER BY display_title COLLATE NOCASE ASC LIMIT 0, 1000;'
},
original: [Error: SQLITE_ERROR: no such column: "be3fa60f-d9a3-4398-b132-7835374f51d7" - should this be a string literal in single-quotes?] {
errno: 1,
code: 'SQLITE_ERROR',
sql: 'SELECT `book`.`id`, `book`.`title`, `book`.`titleIgnorePrefix`, `book`.`subtitle`, `book`.`publishedYear`, `book`.`publishedDate`, `book`.`publisher`, `book`.`description`, `book`.`isbn`, `book`.`asin`, `book`.`language`, `book`.`explicit`, `book`.`abridged`, `book`.`coverPath`, `book`.`duration`, `book`.`narrators`, `book`.`audioFiles`, `book`.`ebookFile`, `book`.`chapters`, `book`.`tags`, `book`.`genres`, `book`.`createdAt`, `book`.`updatedAt`, IFNULL((SELECT s.name FROM bookSeries AS bs, series AS s WHERE bs.seriesId = s.id AND bs.bookId = book.id AND bs.id IN ("be3fa60f-d9a3-4398-b132-7835374f51d7")), `libraryItem`.`title`) AS `display_title`, `libraryItem`.`id` AS `libraryItem.id`, `libraryItem`.`ino` AS `libraryItem.ino`, `libraryItem`.`path` AS `libraryItem.path`, `libraryItem`.`relPath` AS `libraryItem.relPath`, `libraryItem`.`mediaId` AS `libraryItem.mediaId`, `libraryItem`.`mediaType` AS `libraryItem.mediaType`, `libraryItem`.`isFile` AS `libraryItem.isFile`, `libraryItem`.`isMissing` AS `libraryItem.isMissing`, `libraryItem`.`isInvalid` AS `libraryItem.isInvalid`, `libraryItem`.`mtime` AS `libraryItem.mtime`, `libraryItem`.`ctime` AS `libraryItem.ctime`, `libraryItem`.`birthtime` AS `libraryItem.birthtime`, `libraryItem`.`size` AS `libraryItem.size`, `libraryItem`.`lastScan` AS `libraryItem.lastScan`, `libraryItem`.`lastScanVersion` AS `libraryItem.lastScanVersion`, `libraryItem`.`libraryFiles` AS `libraryItem.libraryFiles`, `libraryItem`.`extraData` AS `libraryItem.extraData`, `libraryItem`.`title` AS `libraryItem.title`, `libraryItem`.`titleIgnorePrefix` AS `libraryItem.titleIgnorePrefix`, `libraryItem`.`authorNamesFirstLast` AS `libraryItem.authorNamesFirstLast`, `libraryItem`.`authorNamesLastFirst` AS `libraryItem.authorNamesLastFirst`, `libraryItem`.`createdAt` AS `libraryItem.createdAt`, `libraryItem`.`updatedAt` AS `libraryItem.updatedAt`, `libraryItem`.`libraryId` AS `libraryItem.libraryId`, `libraryItem`.`libraryFolderId` AS `libraryItem.libraryFolderId`, `authors`.`id` AS `authors.id`, `authors`.`name` AS `authors.name` FROM `books` AS `book` INNER JOIN `libraryItems` AS `libraryItem` ON `book`.`id` = `libraryItem`.`mediaId` AND (`libraryItem`.`libraryId` = \'8c3ec8ef-7cfb-4b8a-b37a-143c2e0ea62c\' AND `libraryItem`.`mediaType` = \'book\') INNER JOIN ( `bookAuthors` AS `authors->bookAuthor` INNER JOIN `authors` AS `authors` ON `authors`.`id` = `authors->bookAuthor`.`authorId`) ON `book`.`id` = `authors->bookAuthor`.`bookId` AND `authors`.`id` = \'8f91751e-cab6-4901-add0-428a6d634e0b\' ORDER BY display_title COLLATE NOCASE ASC LIMIT 0, 1000;'
},
(...)
sql: 'SELECT `book`.`id`, `book`.`title`, `book`.`titleIgnorePrefix`, `book`.`subtitle`, `book`.`publishedYear`, `book`.`publishedDate`, `book`.`publisher`, `book`.`description`, `book`.`isbn`, `book`.`asin`, `book`.`language`, `book`.`explicit`, `book`.`abridged`, `book`.`coverPath`, `book`.`duration`, `book`.`narrators`, `book`.`audioFiles`, `book`.`ebookFile`, `book`.`chapters`, `book`.`tags`, `book`.`genres`, `book`.`createdAt`, `book`.`updatedAt`, IFNULL((SELECT s.name FROM bookSeries AS bs, series AS s WHERE bs.seriesId = s.id AND bs.bookId = book.id AND bs.id IN ("c7e69044-553b-419f-b284-07393b512863")), `libraryItem`.`title`) AS `display_title`, `libraryItem`.`id` AS `libraryItem.id`, `libraryItem`.`ino` AS `libraryItem.ino`, `libraryItem`.`path` AS `libraryItem.path`, `libraryItem`.`relPath` AS `libraryItem.relPath`, `libraryItem`.`mediaId` AS `libraryItem.mediaId`, `libraryItem`.`mediaType` AS `libraryItem.mediaType`, `libraryItem`.`isFile` AS `libraryItem.isFile`, `libraryItem`.`isMissing` AS `libraryItem.isMissing`, `libraryItem`.`isInvalid` AS `libraryItem.isInvalid`, `libraryItem`.`mtime` AS `libraryItem.mtime`, `libraryItem`.`ctime` AS `libraryItem.ctime`, `libraryItem`.`birthtime` AS `libraryItem.birthtime`, `libraryItem`.`size` AS `libraryItem.size`, `libraryItem`.`lastScan` AS `libraryItem.lastScan`, `libraryItem`.`lastScanVersion` AS `libraryItem.lastScanVersion`, `libraryItem`.`libraryFiles` AS `libraryItem.libraryFiles`, `libraryItem`.`extraData` AS `libraryItem.extraData`, `libraryItem`.`title` AS `libraryItem.title`, `libraryItem`.`titleIgnorePrefix` AS `libraryItem.titleIgnorePrefix`, `libraryItem`.`authorNamesFirstLast` AS `libraryItem.authorNamesFirstLast`, `libraryItem`.`authorNamesLastFirst` AS `libraryItem.authorNamesLastFirst`, `libraryItem`.`createdAt` AS `libraryItem.createdAt`, `libraryItem`.`updatedAt` AS `libraryItem.updatedAt`, `libraryItem`.`libraryId` AS `libraryItem.libraryId`, `libraryItem`.`libraryFolderId` AS `libraryItem.libraryFolderId`, `authors`.`id` AS `authors.id`, `authors`.`name` AS `authors.name` FROM `books` AS `book` INNER JOIN `libraryItems` AS `libraryItem` ON `book`.`id` = `libraryItem`.`mediaId` AND (`libraryItem`.`libraryId` = \'8c3ec8ef-7cfb-4b8a-b37a-143c2e0ea62c\' AND `libraryItem`.`mediaType` = \'book\') INNER JOIN ( `bookAuthors` AS `authors->bookAuthor` INNER JOIN `authors` AS `authors` ON `authors`.`id` = `authors->bookAuthor`.`authorId`) ON `book`.`id` = `authors->bookAuthor`.`bookId` AND `authors`.`id` = \'a44452a3-8d2c-4e68-b883-1bcd0be32ac1\' ORDER BY display_title COLLATE NOCASE ASC LIMIT 0, 1000;',
parameters: {}
}
}
[2025-12-11 15:54:15.594] DEBUG: Loaded 1 of 1 items for libary page in 0.02s
[2025-12-11 15:54:15.594] DEBUG: [ApiCacheManager] Cache miss: {"user":"Marian","url":"/libraries/8c3ec8ef-7cfb-4b8a-b37a-143c2e0ea62c/items?limit=1000&minified=1&filter=authors.YTY0MTc5MGItMjEwZS00Y2VkLWExZWQtMDY3ZmM4Yzc4OTBh&sort=media.metadata.title&collapseseries=1"}
^[[31m[nodemon] app crashed - waiting for file changes before starting...^[[39mAdditional Notes
root@audiobookshelf:~ # sqlite3 /usr/local/etc/AudioBookShelf/config/absdatabase.sqlite "PRAGMA integrity_check;"
ok
root@audiobookshelf:~ # npm --version
11.6.4
root@audiobookshelf:~ # freebsd-version -u
14.3-RELEASE-p5
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
Vito0912 commentedon Dec 12, 2025
Can you give more details?
Was it your first setup?
Do you click something if that happens etc?
Did you modify the sqlite db at some point
t0maz commentedon Dec 12, 2025
Thanks for your reply.
The setup worked fine for a year or two.
I've noticed the issue a week or two ago.
Recent updates of npm haven't helped so I've updated audiobookshelf from 2.26 to 2.31.0 but the issue still persist.
I've collected the logs and made this report.
Hard to say what was done on client side if anything, I see in the log that one of users (Marian) was most probably active at this time. He's using Android client.
Perhaps this part of log can help to determine what was happening before the issue occurred?
t0maz commentedon Dec 12, 2025
The web UI shows user Marian last activity as 28 days ago.
Perhaps server went done before it stored info about user activity in db.
I'll try to figure out when user used audiobookshelf last in reality.
nichwall commentedon Dec 13, 2025
Does the
be3fa60f-d9a3-4398-b132-7835374f51d7mean anything in your database? If we can narrow down where that came from (specifically the table) that may help to debug the cause, such as trying to use a stale author, collection, or series ID. It's a little hard to determine where the server hangs, is it when filtering by author?And to clarify, it is the beta Android app from Audiobookshelf, not a 3rd party app? There have been a lot of 3rd party apps showing up in the past few months so just want to make sure it is not one of those. The web UI "last activity" also only works if the app reports access to the server using the websocket, which almost no 3rd party apps do.
t0maz commentedon Dec 15, 2025
I can see the value in db dump:
and search for the two values referenced above shows:
Interesting as this is not a new thing and was in the server and database already for quite long time.
Playback session and media progress related to this book is from mid 2024.
Note: user doesn't speak english so it's also quite unlikely he was listening the Alien Novelisations and it's much more likely that it was displayed in his client app when browsing series or in some recommendations than actively listening to it.
Haven't been able to talk to user Marian yet but this is still in my plan.
I'll try to figure out what was his activity in recent days and which client is in use.
t0maz commentedon Dec 15, 2025
User Marian is using Audiobookshelf 0.11.0-beta for Android but last time he was using the client app was 6th December while the server was hanging/crashing multiple times since then.
Server hang again today and it's around the same activity pointing to the same bookSeries although sometimes other IDs are seen in the server log file:
and all this indices are bookSeries: