[Bug]: Crash during Re-Scan - TypeError: Cannot read properties of null (reading 'mediaType') #346

Closed
opened 2026-04-24 23:05:33 +02:00 by adam · 3 comments
Owner

Originally created by @soilheart on GitHub (May 9, 2022).

Describe the issue

When doing a Force Re-Scan Audiobookshelf crashes with the following log:

2022-05-09 08:39:58.310297+00:00/server/njodb/index.js:103
2022-05-09 08:39:58.310387+00:00throw error;
2022-05-09 08:39:58.310416+00:00^
2022-05-09 08:39:58.310425+00:002022-05-09T08:39:58.310425362Z
2022-05-09 08:39:58.310432+00:00TypeError: Cannot read properties of null (reading 'mediaType')
2022-05-09 08:39:58.310439+00:00at Scanner.createNewAuthorsAndSeries (/server/scanner/Scanner.js:419:21)
2022-05-09 08:39:58.310446+00:00at Scanner.rescanLibraryItemDataChunk (/server/scanner/Scanner.js:296:18)
2022-05-09 08:39:58.310454+00:00at runMicrotasks (<anonymous>)
2022-05-09 08:39:58.310461+00:00at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-05-09 08:39:58.310469+00:00at async Scanner.scanLibrary (/server/scanner/Scanner.js:273:7)
2022-05-09 08:39:58.310477+00:00at async Scanner.scan (/server/scanner/Scanner.js:136:20)
2022-05-09 08:39:58.310484+00:00at async ApiRouter.scan (/server/controllers/LibraryController.js:478:5)

Enabling Debug logs does not provide any more information.
I tried adding debug prints to Scanner.js, but as a docker noob I couldn't find a way to edit the file inside the running docker image, and building a new (local?) docker image is a bit out of my knowledge.

Steps to reproduce the issue

  1. ???
  2. Force Re-Scan
  3. Crash

Audiobookshelf version

v2.0.11

How are you running audiobookshelf?

Docker

Originally created by @soilheart on GitHub (May 9, 2022). ### Describe the issue When doing a Force Re-Scan Audiobookshelf crashes with the following log: ``` 2022-05-09 08:39:58.310297+00:00/server/njodb/index.js:103 2022-05-09 08:39:58.310387+00:00throw error; 2022-05-09 08:39:58.310416+00:00^ 2022-05-09 08:39:58.310425+00:002022-05-09T08:39:58.310425362Z 2022-05-09 08:39:58.310432+00:00TypeError: Cannot read properties of null (reading 'mediaType') 2022-05-09 08:39:58.310439+00:00at Scanner.createNewAuthorsAndSeries (/server/scanner/Scanner.js:419:21) 2022-05-09 08:39:58.310446+00:00at Scanner.rescanLibraryItemDataChunk (/server/scanner/Scanner.js:296:18) 2022-05-09 08:39:58.310454+00:00at runMicrotasks (<anonymous>) 2022-05-09 08:39:58.310461+00:00at processTicksAndRejections (node:internal/process/task_queues:96:5) 2022-05-09 08:39:58.310469+00:00at async Scanner.scanLibrary (/server/scanner/Scanner.js:273:7) 2022-05-09 08:39:58.310477+00:00at async Scanner.scan (/server/scanner/Scanner.js:136:20) 2022-05-09 08:39:58.310484+00:00at async ApiRouter.scan (/server/controllers/LibraryController.js:478:5) ``` Enabling Debug logs does not provide any more information. I tried adding debug prints to Scanner.js, but as a docker noob I couldn't find a way to edit the file inside the running docker image, and building a new (local?) docker image is a bit out of my knowledge. ### Steps to reproduce the issue 1. ??? 2. Force Re-Scan 3. Crash ### Audiobookshelf version v2.0.11 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:05:33 +02:00
adam closed this issue 2026-04-24 23:05:33 +02:00
Author
Owner

@szemlicka commented on GitHub (May 9, 2022):

good to read that I am not the only person that have that problem.....
https://github.com/advplyr/audiobookshelf/issues/566

@szemlicka commented on GitHub (May 9, 2022): good to read that I am not the only person that have that problem..... [https://github.com/advplyr/audiobookshelf/issues/566](url)
Author
Owner

@advplyr commented on GitHub (May 9, 2022):

Thanks, that was the log I needed to see. Will be fixed in next release soon.

@advplyr commented on GitHub (May 9, 2022): Thanks, that was the log I needed to see. Will be fixed in next release soon.
Author
Owner

@advplyr commented on GitHub (May 10, 2022):

Fixed in v2.0.12

@advplyr commented on GitHub (May 10, 2022): Fixed in [v2.0.12](https://github.com/advplyr/audiobookshelf/releases/tag/v2.0.12)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#346