[Bug]: API Get All Collections will cause server crash #2230

Closed
opened 2026-04-25 00:05:14 +02:00 by adam · 1 comment
Owner

Originally created by @shanyan-wcx on GitHub (Sep 3, 2024).

What happened?

API Get All Collections will cause server crash.

What did you expect to happen?

The server does not crash.

Steps to reproduce the issue

  1. Call "Get All Collections" api
  2. Server crash

Audiobookshelf version

v2.13.3

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

None

Logs

{"timestamp":"2024-09-03 15:33:11.759","source":"Server.js:185","message":"[Server] Unhandled rejection: TypeError: Cannot read properties of undefined (reading 'includes'), promise: Promise {\n  <rejected> TypeError: Cannot read properties of undefined (reading 'includes')\n      at collection.getOldCollectionsJsonExpanded (/server/models/Collection.js:41:17)\n      at ApiRouter.findAll (/server/controllers/CollectionController.js:68:64)\n      at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n      at next (/node_modules/express/lib/router/route.js:144:13)\n      at Route.dispatch (/node_modules/express/lib/router/route.js:114:3)\n      at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n      at /node_modules/express/lib/router/index.js:284:15\n      at Function.process_params (/node_modules/express/lib/router/index.js:346:12)\n      at next (/node_modules/express/lib/router/index.js:280:10)\n      at expressInit (/node_modules/express/lib/middleware/init.js:40:5)\n}","levelName":"FATAL","level":5}
{"timestamp":"2024-09-03 15:34:29.641","source":"Server.js:185","message":"[Server] Unhandled rejection: TypeError: Cannot read properties of undefined (reading 'includes'), promise: Promise {\n  <rejected> TypeError: Cannot read properties of undefined (reading 'includes')\n      at collection.getOldCollectionsJsonExpanded (/server/models/Collection.js:41:17)\n      at ApiRouter.findAll (/server/controllers/CollectionController.js:68:64)\n      at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n      at next (/node_modules/express/lib/router/route.js:144:13)\n      at Route.dispatch (/node_modules/express/lib/router/route.js:114:3)\n      at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n      at /node_modules/express/lib/router/index.js:284:15\n      at Function.process_params (/node_modules/express/lib/router/index.js:346:12)\n      at next (/node_modules/express/lib/router/index.js:280:10)\n      at expressInit (/node_modules/express/lib/middleware/init.js:40:5)\n}","levelName":"FATAL","level":5}
{"timestamp":"2024-09-03 15:36:48.591","source":"Server.js:185","message":"[Server] Unhandled rejection: TypeError: Cannot read properties of undefined (reading 'includes'), promise: Promise {\n  <rejected> TypeError: Cannot read properties of undefined (reading 'includes')\n      at collection.getOldCollectionsJsonExpanded (/server/models/Collection.js:41:17)\n      at ApiRouter.findAll (/server/controllers/CollectionController.js:68:64)\n      at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n      at next (/node_modules/express/lib/router/route.js:144:13)\n      at Route.dispatch (/node_modules/express/lib/router/route.js:114:3)\n      at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n      at /node_modules/express/lib/router/index.js:284:15\n      at Function.process_params (/node_modules/express/lib/router/index.js:346:12)\n      at next (/node_modules/express/lib/router/index.js:280:10)\n      at expressInit (/node_modules/express/lib/middleware/init.js:40:5)\n}","levelName":"FATAL","level":5}
{"timestamp":"2024-09-03 15:37:44.452","source":"Server.js:185","message":"[Server] Unhandled rejection: TypeError: Cannot read properties of undefined (reading 'includes'), promise: Promise {\n  <rejected> TypeError: Cannot read properties of undefined (reading 'includes')\n      at collection.getOldCollectionsJsonExpanded (/server/models/Collection.js:41:17)\n      at ApiRouter.findAll (/server/controllers/CollectionController.js:68:64)\n      at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n      at next (/node_modules/express/lib/router/route.js:144:13)\n      at Route.dispatch (/node_modules/express/lib/router/route.js:114:3)\n      at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n      at /node_modules/express/lib/router/index.js:284:15\n      at Function.process_params (/node_modules/express/lib/router/index.js:346:12)\n      at next (/node_modules/express/lib/router/index.js:280:10)\n      at expressInit (/node_modules/express/lib/middleware/init.js:40:5)\n}","levelName":"FATAL","level":5}
{"timestamp":"2024-09-03 15:41:24.747","source":"Server.js:185","message":"[Server] Unhandled rejection: TypeError: Cannot read properties of undefined (reading 'includes'), promise: Promise {\n  <rejected> TypeError: Cannot read properties of undefined (reading 'includes')\n      at collection.getOldCollectionsJsonExpanded (/server/models/Collection.js:41:17)\n      at ApiRouter.findAll (/server/controllers/CollectionController.js:68:64)\n      at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n      at next (/node_modules/express/lib/router/route.js:144:13)\n      at Route.dispatch (/node_modules/express/lib/router/route.js:114:3)\n      at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n      at /node_modules/express/lib/router/index.js:284:15\n      at Function.process_params (/node_modules/express/lib/router/index.js:346:12)\n      at next (/node_modules/express/lib/router/index.js:280:10)\n      at expressInit (/node_modules/express/lib/middleware/init.js:40:5)\n}","levelName":"FATAL","level":5}

Additional Notes

No response

Originally created by @shanyan-wcx on GitHub (Sep 3, 2024). ### What happened? API Get All Collections will cause server crash. ### What did you expect to happen? The server does not crash. ### Steps to reproduce the issue 1. Call "Get All Collections" api 2. Server crash ### Audiobookshelf version v2.13.3 ### How are you running audiobookshelf? Docker ### What OS is your Audiobookshelf server hosted from? Linux ### If the issue is being seen in the UI, what browsers are you seeing the problem on? None ### Logs ```shell {"timestamp":"2024-09-03 15:33:11.759","source":"Server.js:185","message":"[Server] Unhandled rejection: TypeError: Cannot read properties of undefined (reading 'includes'), promise: Promise {\n <rejected> TypeError: Cannot read properties of undefined (reading 'includes')\n at collection.getOldCollectionsJsonExpanded (/server/models/Collection.js:41:17)\n at ApiRouter.findAll (/server/controllers/CollectionController.js:68:64)\n at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n at next (/node_modules/express/lib/router/route.js:144:13)\n at Route.dispatch (/node_modules/express/lib/router/route.js:114:3)\n at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n at /node_modules/express/lib/router/index.js:284:15\n at Function.process_params (/node_modules/express/lib/router/index.js:346:12)\n at next (/node_modules/express/lib/router/index.js:280:10)\n at expressInit (/node_modules/express/lib/middleware/init.js:40:5)\n}","levelName":"FATAL","level":5} {"timestamp":"2024-09-03 15:34:29.641","source":"Server.js:185","message":"[Server] Unhandled rejection: TypeError: Cannot read properties of undefined (reading 'includes'), promise: Promise {\n <rejected> TypeError: Cannot read properties of undefined (reading 'includes')\n at collection.getOldCollectionsJsonExpanded (/server/models/Collection.js:41:17)\n at ApiRouter.findAll (/server/controllers/CollectionController.js:68:64)\n at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n at next (/node_modules/express/lib/router/route.js:144:13)\n at Route.dispatch (/node_modules/express/lib/router/route.js:114:3)\n at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n at /node_modules/express/lib/router/index.js:284:15\n at Function.process_params (/node_modules/express/lib/router/index.js:346:12)\n at next (/node_modules/express/lib/router/index.js:280:10)\n at expressInit (/node_modules/express/lib/middleware/init.js:40:5)\n}","levelName":"FATAL","level":5} {"timestamp":"2024-09-03 15:36:48.591","source":"Server.js:185","message":"[Server] Unhandled rejection: TypeError: Cannot read properties of undefined (reading 'includes'), promise: Promise {\n <rejected> TypeError: Cannot read properties of undefined (reading 'includes')\n at collection.getOldCollectionsJsonExpanded (/server/models/Collection.js:41:17)\n at ApiRouter.findAll (/server/controllers/CollectionController.js:68:64)\n at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n at next (/node_modules/express/lib/router/route.js:144:13)\n at Route.dispatch (/node_modules/express/lib/router/route.js:114:3)\n at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n at /node_modules/express/lib/router/index.js:284:15\n at Function.process_params (/node_modules/express/lib/router/index.js:346:12)\n at next (/node_modules/express/lib/router/index.js:280:10)\n at expressInit (/node_modules/express/lib/middleware/init.js:40:5)\n}","levelName":"FATAL","level":5} {"timestamp":"2024-09-03 15:37:44.452","source":"Server.js:185","message":"[Server] Unhandled rejection: TypeError: Cannot read properties of undefined (reading 'includes'), promise: Promise {\n <rejected> TypeError: Cannot read properties of undefined (reading 'includes')\n at collection.getOldCollectionsJsonExpanded (/server/models/Collection.js:41:17)\n at ApiRouter.findAll (/server/controllers/CollectionController.js:68:64)\n at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n at next (/node_modules/express/lib/router/route.js:144:13)\n at Route.dispatch (/node_modules/express/lib/router/route.js:114:3)\n at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n at /node_modules/express/lib/router/index.js:284:15\n at Function.process_params (/node_modules/express/lib/router/index.js:346:12)\n at next (/node_modules/express/lib/router/index.js:280:10)\n at expressInit (/node_modules/express/lib/middleware/init.js:40:5)\n}","levelName":"FATAL","level":5} {"timestamp":"2024-09-03 15:41:24.747","source":"Server.js:185","message":"[Server] Unhandled rejection: TypeError: Cannot read properties of undefined (reading 'includes'), promise: Promise {\n <rejected> TypeError: Cannot read properties of undefined (reading 'includes')\n at collection.getOldCollectionsJsonExpanded (/server/models/Collection.js:41:17)\n at ApiRouter.findAll (/server/controllers/CollectionController.js:68:64)\n at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n at next (/node_modules/express/lib/router/route.js:144:13)\n at Route.dispatch (/node_modules/express/lib/router/route.js:114:3)\n at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n at /node_modules/express/lib/router/index.js:284:15\n at Function.process_params (/node_modules/express/lib/router/index.js:346:12)\n at next (/node_modules/express/lib/router/index.js:280:10)\n at expressInit (/node_modules/express/lib/middleware/init.js:40:5)\n}","levelName":"FATAL","level":5} ``` ### Additional Notes _No response_
adam added the bug label 2026-04-25 00:05:14 +02:00
adam closed this issue 2026-04-25 00:05:15 +02:00
Author
Owner

@github-actions[bot] commented on GitHub (Sep 9, 2024):

Fixed in v2.13.4.

@github-actions[bot] commented on GitHub (Sep 9, 2024): Fixed in [v2.13.4](https://github.com/advplyr/audiobookshelf/releases/tag/v2.13.4).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2230