[Bug]: Authors page is non-responsive for large (>30k) number of authors. Page does not lazy load. #1920

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

Originally created by @CoffeeKnyte on GitHub (Apr 28, 2024).

Describe the issue

What happened:

  • With a large (>30k) audiobook library, i open the authors page.
  • The authors page then stays blank for approximately 90 seconds before finally loading the authors.
  • Server is unresponsive during this time.
  • On the android ABS app, opening the authors tab causes the app to crash.

Expected behavior:

  • The page should load immediately with the first 40 or so authors, before lazy-loading the rest.

Logs with userId and libraryId redacted:

[2024-04-28 00:54:13.423] DEBUG: Ran the following query in 1148ms:
 Executed (default): SELECT `author`.`id`, `author`.`name`, `author`.`lastFirst`, `author`.`asin`, `author`.`description`, `author`.`imagePath`, `author`.`createdAt`, `author`.`updatedAt`, `author`.`libraryId`, `books`.`id` AS `books.id`, `books`.`tags` AS `books.tags`, `books`.`explicit` AS `books.explicit` FROM `authors` AS `author` LEFT OUTER JOIN ( `bookAuthors` AS `books->bookAuthor` INNER JOIN `books` AS `books` ON `books`.`id` = `books->bookAuthor`.`bookId`) ON `author`.`id` = `books->bookAuthor`.`authorId` AND 1=1 WHERE `author`.`libraryId` = '07d45413-6ad9-44c7-883e-xxxxxxxxxxxx' ORDER BY name COLLATE NOCASE ASC; (Database.js:189)
[2024-04-28 00:54:14.918] DEBUG: [ApiCacheManager] Cache miss: {"user":"root","url":"/libraries/07d45413-6ad9-44c7-883e-xxxxxxxxxxxx/authors"} (ApiCacheManager.js:50)
[2024-04-28 00:54:51.112] DEBUG: [SocketAuthority] User Offline root (SocketAuthority.js:131)
[2024-04-28 00:54:51.112] INFO: [SocketAuthority] Socket k47lr_2sk3rnt71qAAAd disconnected from client "root" after 498659ms (Reason: ping timeout)
[2024-04-28 00:54:51.387] DEBUG: [SocketAuthority] User Offline root (SocketAuthority.js:131)
[2024-04-28 00:54:51.387] INFO: [SocketAuthority] Socket LHwm3XgBiqxNe6TmAAAf disconnected from client "root" after 498368ms (Reason: ping timeout)
[2024-04-28 00:55:42.550] INFO: [SocketAuthority] Socket Connected CoKxNvmz7QHRYjMtAAAh
[2024-04-28 00:55:42.758] DEBUG: Ran the following query in 1ms:
 Executed (default): SELECT `user`.*, `mediaProgresses`.`id` AS `mediaProgresses.id`, `mediaProgresses`.`mediaItemId` AS `mediaProgresses.mediaItemId`, `mediaProgresses`.`mediaItemType` AS `mediaProgresses.mediaItemType`, `mediaProgresses`.`duration` AS `mediaProgresses.duration`, `mediaProgresses`.`currentTime` AS `mediaProgresses.currentTime`, `mediaProgresses`.`isFinished` AS `mediaProgresses.isFinished`, `mediaProgresses`.`hideFromContinueListening` AS `mediaProgresses.hideFromContinueListening`, `mediaProgresses`.`ebookLocation` AS `mediaProgresses.ebookLocation`, `mediaProgresses`.`ebookProgress` AS `mediaProgresses.ebookProgress`, `mediaProgresses`.`finishedAt` AS `mediaProgresses.finishedAt`, `mediaProgresses`.`extraData` AS `mediaProgresses.extraData`, `mediaProgresses`.`createdAt` AS `mediaProgresses.createdAt`, `mediaProgresses`.`updatedAt` AS `mediaProgresses.updatedAt`, `mediaProgresses`.`userId` AS `mediaProgresses.userId` FROM (SELECT `user`.`id`, `user`.`username`, `user`.`email`, `user`.`pash`, `user`.`type`, `user`.`token`, `user`.`isActive`, `user`.`isLocked`, `user`.`lastSeen`, `user`.`permissions`, `user`.`bookmarks`, `user`.`extraData`, `user`.`createdAt`, `user`.`updatedAt` FROM `users` AS `user` WHERE (`user`.`id` = '92b775b5-4198-4688-af0a-xxxxxxxxxxxx' OR `user`.`extraData` LIKE '%92b775b5-4198-4688-af0a-xxxxxxxxxxxx%') LIMIT 1) AS `user` LEFT OUTER JOIN `mediaProgresses` AS `mediaProgresses` ON `user`.`id` = `mediaProgresses`.`userId`; (Database.js:189)
[2024-04-28 00:55:42.759] DEBUG: [SocketAuthority] User Online root (SocketAuthority.js:204)

The authors sql query was completed at "2024-04-28 00:54:13.423" but the socket disconnected after and the page was unresponsive. The page and server only started responding again at "2024-04-28 00:55:42.758" when it ran the next query. This is approximately 90 seconds of blocking behavior.

It should be resolved if the page can only load the first 40 authors or so and then lazy load the rest.

Steps to reproduce the issue

  1. Have 31,033 authors in the database.
  2. Open the server webview or the app.
  3. Open the authors page.
  4. Page will take more than a minute to load (around 90s for my library). On the android ABS app, the app will crash.
  5. Server will be unresponsive during that time

Audiobookshelf version

v2.9.0

How are you running audiobookshelf?

Docker

Originally created by @CoffeeKnyte on GitHub (Apr 28, 2024). ### Describe the issue What happened: - With a large (>30k) audiobook library, i open the authors page. - The authors page then stays blank for approximately 90 seconds before finally loading the authors. - Server is unresponsive during this time. - On the android ABS app, opening the authors tab causes the app to crash. Expected behavior: - The page should load immediately with the first 40 or so authors, before lazy-loading the rest. Logs with userId and libraryId redacted: ``` [2024-04-28 00:54:13.423] DEBUG: Ran the following query in 1148ms: Executed (default): SELECT `author`.`id`, `author`.`name`, `author`.`lastFirst`, `author`.`asin`, `author`.`description`, `author`.`imagePath`, `author`.`createdAt`, `author`.`updatedAt`, `author`.`libraryId`, `books`.`id` AS `books.id`, `books`.`tags` AS `books.tags`, `books`.`explicit` AS `books.explicit` FROM `authors` AS `author` LEFT OUTER JOIN ( `bookAuthors` AS `books->bookAuthor` INNER JOIN `books` AS `books` ON `books`.`id` = `books->bookAuthor`.`bookId`) ON `author`.`id` = `books->bookAuthor`.`authorId` AND 1=1 WHERE `author`.`libraryId` = '07d45413-6ad9-44c7-883e-xxxxxxxxxxxx' ORDER BY name COLLATE NOCASE ASC; (Database.js:189) [2024-04-28 00:54:14.918] DEBUG: [ApiCacheManager] Cache miss: {"user":"root","url":"/libraries/07d45413-6ad9-44c7-883e-xxxxxxxxxxxx/authors"} (ApiCacheManager.js:50) [2024-04-28 00:54:51.112] DEBUG: [SocketAuthority] User Offline root (SocketAuthority.js:131) [2024-04-28 00:54:51.112] INFO: [SocketAuthority] Socket k47lr_2sk3rnt71qAAAd disconnected from client "root" after 498659ms (Reason: ping timeout) [2024-04-28 00:54:51.387] DEBUG: [SocketAuthority] User Offline root (SocketAuthority.js:131) [2024-04-28 00:54:51.387] INFO: [SocketAuthority] Socket LHwm3XgBiqxNe6TmAAAf disconnected from client "root" after 498368ms (Reason: ping timeout) [2024-04-28 00:55:42.550] INFO: [SocketAuthority] Socket Connected CoKxNvmz7QHRYjMtAAAh [2024-04-28 00:55:42.758] DEBUG: Ran the following query in 1ms: Executed (default): SELECT `user`.*, `mediaProgresses`.`id` AS `mediaProgresses.id`, `mediaProgresses`.`mediaItemId` AS `mediaProgresses.mediaItemId`, `mediaProgresses`.`mediaItemType` AS `mediaProgresses.mediaItemType`, `mediaProgresses`.`duration` AS `mediaProgresses.duration`, `mediaProgresses`.`currentTime` AS `mediaProgresses.currentTime`, `mediaProgresses`.`isFinished` AS `mediaProgresses.isFinished`, `mediaProgresses`.`hideFromContinueListening` AS `mediaProgresses.hideFromContinueListening`, `mediaProgresses`.`ebookLocation` AS `mediaProgresses.ebookLocation`, `mediaProgresses`.`ebookProgress` AS `mediaProgresses.ebookProgress`, `mediaProgresses`.`finishedAt` AS `mediaProgresses.finishedAt`, `mediaProgresses`.`extraData` AS `mediaProgresses.extraData`, `mediaProgresses`.`createdAt` AS `mediaProgresses.createdAt`, `mediaProgresses`.`updatedAt` AS `mediaProgresses.updatedAt`, `mediaProgresses`.`userId` AS `mediaProgresses.userId` FROM (SELECT `user`.`id`, `user`.`username`, `user`.`email`, `user`.`pash`, `user`.`type`, `user`.`token`, `user`.`isActive`, `user`.`isLocked`, `user`.`lastSeen`, `user`.`permissions`, `user`.`bookmarks`, `user`.`extraData`, `user`.`createdAt`, `user`.`updatedAt` FROM `users` AS `user` WHERE (`user`.`id` = '92b775b5-4198-4688-af0a-xxxxxxxxxxxx' OR `user`.`extraData` LIKE '%92b775b5-4198-4688-af0a-xxxxxxxxxxxx%') LIMIT 1) AS `user` LEFT OUTER JOIN `mediaProgresses` AS `mediaProgresses` ON `user`.`id` = `mediaProgresses`.`userId`; (Database.js:189) [2024-04-28 00:55:42.759] DEBUG: [SocketAuthority] User Online root (SocketAuthority.js:204) ``` The authors sql query was completed at "2024-04-28 00:54:13.423" but the socket disconnected after and the page was unresponsive. The page and server only started responding again at "2024-04-28 00:55:42.758" when it ran the next query. This is approximately 90 seconds of blocking behavior. It should be resolved if the page can only load the first 40 authors or so and then lazy load the rest. ### Steps to reproduce the issue 1. Have 31,033 authors in the database. 2. Open the server webview or the app. 3. Open the authors page. 4. Page will take more than a minute to load (around 90s for my library). On the android ABS app, the app will crash. 5. Server will be unresponsive during that time ### Audiobookshelf version v2.9.0 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-25 00:01:22 +02:00
adam closed this issue 2026-04-25 00:01:22 +02:00
Author
Owner

@BrianCArnold commented on GitHub (May 26, 2024):

I'm encountering this as well. I'm going to see if I can fix it, and if so, I'll PR it.

@BrianCArnold commented on GitHub (May 26, 2024): I'm encountering this as well. I'm going to see if I can fix it, and if so, I'll PR it.
Author
Owner

@nichwall commented on GitHub (Oct 19, 2024):

I think this has been fixed in the web client https://github.com/advplyr/audiobookshelf/pull/3487 in v2.15.0. There has not been a change for the mobile apps yet.

@nichwall commented on GitHub (Oct 19, 2024): I think this has been fixed in the web client https://github.com/advplyr/audiobookshelf/pull/3487 in [v2.15.0](https://github.com/advplyr/audiobookshelf/releases/tag/v2.15.0). There has not been a change for the mobile apps yet.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1920