[Bug]: Crash after library scan #828

Closed
opened 2026-04-24 23:23:00 +02:00 by adam · 1 comment
Owner

Originally created by @tomazed on GitHub (Dec 18, 2022).

Describe the issue

I get a crash in the latest commit of master 54b41b15c2
where abs crash after library scan with the following log

[2022-12-18 21:11:11]  INFO: [Scanner] Library scan lscan_miomud1dt5cqtngo1c completed in 0:28.0 | 1 Added | 79 Updated | 0 Missing
[2022-12-18 21:11:11]  INFO: [LibraryController] Scan complete
/home/abs/audiobookshelf/server/libs/njodb/index.js:103
        throw error;
        ^

ReferenceError: logDir is not defined
    at LibraryScan.saveLog (/home/abs/audiobookshelf/server/scanner/LibraryScan.js:131:34)

problem seem to have been introduced in d130dd6d5e where the function saveLog do not take logDir as a variable but still uses it.
https://github.com/advplyr/audiobookshelf/blob/54b41b15c287b9f392ceb61f8b3fcb13448b0c0b/server/scanner/LibraryScan.js#L128-L131

Steps to reproduce the issue

  1. Download lastest dev version
  2. Run a library scan with at least one new audiobook
  3. Crash

Audiobookshelf version

2.2.8

How are you running audiobookshelf?

Built from source

Originally created by @tomazed on GitHub (Dec 18, 2022). ### Describe the issue I get a crash in the latest commit of master 54b41b15c287b9f392ceb61f8b3fcb13448b0c0b where abs crash after library scan with the following log ``` [2022-12-18 21:11:11] INFO: [Scanner] Library scan lscan_miomud1dt5cqtngo1c completed in 0:28.0 | 1 Added | 79 Updated | 0 Missing [2022-12-18 21:11:11] INFO: [LibraryController] Scan complete /home/abs/audiobookshelf/server/libs/njodb/index.js:103 throw error; ^ ReferenceError: logDir is not defined at LibraryScan.saveLog (/home/abs/audiobookshelf/server/scanner/LibraryScan.js:131:34) ``` problem seem to have been introduced in d130dd6d5e9f53590a40e18655f4e3767e32a485 where the function saveLog do not take logDir as a variable but still uses it. https://github.com/advplyr/audiobookshelf/blob/54b41b15c287b9f392ceb61f8b3fcb13448b0c0b/server/scanner/LibraryScan.js#L128-L131 ### Steps to reproduce the issue 1. Download lastest dev version 2. Run a library scan with at least one new audiobook 3. Crash ### Audiobookshelf version 2.2.8 ### How are you running audiobookshelf? Built from source
adam added the bug label 2026-04-24 23:23:00 +02:00
adam closed this issue 2026-04-24 23:23:02 +02:00
Author
Owner

@advplyr commented on GitHub (Dec 18, 2022):

Thanks fixed it

@advplyr commented on GitHub (Dec 18, 2022): Thanks fixed it
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#828