[Bug]: Container Crashes - 'throw error' /server/libs/njodb/index.js:103 #468

Closed
opened 2026-04-24 23:10:19 +02:00 by adam · 6 comments
Owner

Originally created by @Borlean on GitHub (Jun 18, 2022).

Describe the issue

Container will crash after opening a new sessions (either web or android). I deleted the backups

> audiobookshelf@2.0.21 start
> node index.js

Config /config /metadata
[2022-06-18T16:12:08.544Z]  INFO: === Starting Server ===
[2022-06-18T16:12:08.544Z]  INFO: [Server] Init v2.0.21
[2022-06-18T16:12:08.554Z]  INFO: [DB] 0 Collections Loaded
[2022-06-18T16:12:08.590Z]  INFO: [DB] 2 Users Loaded
/server/libs/njodb/index.js:103
        throw error;
        ^

TypeError: Cannot read properties of undefined (reading 'find')
    at writeConcatFile (/server/utils/ffmpegHelpers.js:21:32)
    at Stream.start (/server/objects/Stream.js:240:32)
    at PlaybackSessionManager.startSession (/server/managers/PlaybackSessionManager.js:140:16)
    at async PlaybackSessionManager.startSessionRequest (/server/managers/PlaybackSessionManager.js:49:21)

### Steps to reproduce the issue

1. Play media, 
2. then close/stop media and docker will crash with the above log. 

### Audiobookshelf version

v2.0.21

### How are you running audiobookshelf?

Docker
Originally created by @Borlean on GitHub (Jun 18, 2022). ### Describe the issue Container will crash after opening a new sessions (either web or android). I deleted the backups ``` > audiobookshelf@2.0.21 start > node index.js Config /config /metadata [2022-06-18T16:12:08.544Z] INFO: === Starting Server === [2022-06-18T16:12:08.544Z] INFO: [Server] Init v2.0.21 [2022-06-18T16:12:08.554Z] INFO: [DB] 0 Collections Loaded [2022-06-18T16:12:08.590Z] INFO: [DB] 2 Users Loaded /server/libs/njodb/index.js:103 throw error; ^ TypeError: Cannot read properties of undefined (reading 'find') at writeConcatFile (/server/utils/ffmpegHelpers.js:21:32) at Stream.start (/server/objects/Stream.js:240:32) at PlaybackSessionManager.startSession (/server/managers/PlaybackSessionManager.js:140:16) at async PlaybackSessionManager.startSessionRequest (/server/managers/PlaybackSessionManager.js:49:21) ### Steps to reproduce the issue 1. Play media, 2. then close/stop media and docker will crash with the above log. ### Audiobookshelf version v2.0.21 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:10:19 +02:00
adam closed this issue 2026-04-24 23:10:20 +02:00
Author
Owner

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

I've been seeing this issue reported recently and I'm pretty sure this has to do with podcasts transcoding.

Was the last thing you played a podcast episode?

@advplyr commented on GitHub (Jun 18, 2022): I've been seeing this issue reported recently and I'm pretty sure this has to do with podcasts transcoding. Was the last thing you played a podcast episode?
Author
Owner

@Borlean commented on GitHub (Jun 18, 2022):

Yes, I was listening to podcasts. I don't recall if it happened with an audiobook as well, but definitely podcasts.

E: I also saw the "not syncing progress" error bar at the bottom of the Android app.

@Borlean commented on GitHub (Jun 18, 2022): Yes, I was listening to podcasts. I don't recall if it happened with an audiobook as well, but definitely podcasts. E: I also saw the "not syncing progress" error bar at the bottom of the Android app.
Author
Owner

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

I found the bug, it will be fixed on the next release. Next release will probably be later today but in the meantime if you have the mobile app you can play a book there which will close the last playback session causing this error.

@advplyr commented on GitHub (Jun 18, 2022): I found the bug, it will be fixed on the next release. Next release will probably be later today but in the meantime if you have the mobile app you can play a book there which will close the last playback session causing this error.
Author
Owner

@Borlean commented on GitHub (Jun 18, 2022):

Wonderful news, much appreciated. I'll hold off on playing podcasts until the release.

@Borlean commented on GitHub (Jun 18, 2022): Wonderful news, much appreciated. I'll hold off on playing podcasts until the release.
Author
Owner

@jt196 commented on GitHub (Jul 9, 2022):

@advplyr just to let you know, I'm still getting this error on 2.0.23:

[2022-07-09 12:19:17]  INFO: [Server] Socket Connected vVwpVXsQLqljJYP6AADd
> node index.js
    at async PlaybackSessionManager.startSessionRequest (/server/managers/PlaybackSessionManager.js:49:21)
[2022-07-09 12:19:21]  INFO: [PlaybackSessionManager] startSession: Closing open session "Dead Ringers Series 22 - 04. Episode 4 m0018xkt original.m4a" for user "jt196"
[2022-07-09 12:19:21]  INFO: [STREAM] START STREAM - Num Segments: 1395
    at writeConcatFile (/server/utils/ffmpegHelpers.js:21:32)
TypeError: Cannot read properties of undefined (reading 'find')
    at Stream.start (/server/objects/Stream.js:240:32)
    at PlaybackSessionManager.startSession (/server/managers/PlaybackSessionManager.js:140:16)
> audiobookshelf@2.0.23 start
^

/server/libs/njodb/index.js:103
        throw error;
[2022-07-09 12:19:18]  INFO: [Server] Socket Connected kiENV6QMX6YJIuGuAADf
[2022-07-09 12:19:17]  INFO: Recieved ping

(BTW there's a spelling error on "Recieved ping", "Received ping". My old primary school rhyme was I before E except after C).

@jt196 commented on GitHub (Jul 9, 2022): @advplyr just to let you know, I'm still getting this error on 2.0.23: ``` [2022-07-09 12:19:17] INFO: [Server] Socket Connected vVwpVXsQLqljJYP6AADd > node index.js at async PlaybackSessionManager.startSessionRequest (/server/managers/PlaybackSessionManager.js:49:21) [2022-07-09 12:19:21] INFO: [PlaybackSessionManager] startSession: Closing open session "Dead Ringers Series 22 - 04. Episode 4 m0018xkt original.m4a" for user "jt196" [2022-07-09 12:19:21] INFO: [STREAM] START STREAM - Num Segments: 1395 at writeConcatFile (/server/utils/ffmpegHelpers.js:21:32) TypeError: Cannot read properties of undefined (reading 'find') at Stream.start (/server/objects/Stream.js:240:32) at PlaybackSessionManager.startSession (/server/managers/PlaybackSessionManager.js:140:16) > audiobookshelf@2.0.23 start ^  /server/libs/njodb/index.js:103 throw error; [2022-07-09 12:19:18] INFO: [Server] Socket Connected kiENV6QMX6YJIuGuAADf [2022-07-09 12:19:17] INFO: Recieved ping ``` (BTW there's a spelling error on "Recieved ping", "Received ping". My old primary school rhyme was I before E except after C).
Author
Owner

@kindomLee commented on GitHub (May 25, 2023):

same error here, while downloading podcast

[2023-05-25 09:53:41] INFO: [PodcastManager] Found 277 new episodes for podcast "科学脱口秀" - starting download
/server/libs/njodb/index.js:103
        throw error;

^
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "AxiosError: Request failed with status code 404".] {
  code: 'ERR_UNHANDLED_REJECTION'
}
@kindomLee commented on GitHub (May 25, 2023): same error here, while downloading podcast ``` [2023-05-25 09:53:41] INFO: [PodcastManager] Found 277 new episodes for podcast "科学脱口秀" - starting download /server/libs/njodb/index.js:103 throw error;  ^ [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "AxiosError: Request failed with status code 404".] { code: 'ERR_UNHANDLED_REJECTION' } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#468