[Bug]: chromecast error: Load media failed invalid_parameter #2712

Open
opened 2026-02-20 10:21:59 -05:00 by deekerman · 7 comments
Owner

Originally created by @h4de5 on GitHub (Apr 7, 2025).

What happened?

still trying to figure the actual problem, but I am kind of stuck.

most smaller/shorter audiobooks work correctly and they can be streamed to my chromecast (compatible device). but the big ones always fail.

it seems as soon as they have more than ~30 chapters, streaming directly fails with: "Load media failed invalid_parameter" in javascript console and the player keeps loading.

I also noticed, that for some audiobooks that have around 30-32 chapters, special characters (e.g. a - ) in the title are also a problem, while they are not for those with like 10 chapters only.

I tested it with a sherlock holmes collection of different books - all of them are encoded as mp3, stereo, 320kbit, etc. they do have between 15 and 40 chapters, while their total lenght are always around 70-80min, and their total size is also comparable. all of those with less than ~30 chapters work, while others don't.

What did you expect to happen?

Streaming to chromecast should work regardless of numbers of chapters or title.
The app should try to adapt any incompatibilities before starting the streaming session.

If the streaming still fails for whatever reason, the UI should display the error instead of silently ignoring it.

Steps to reproduce the issue

  1. run audiobookshelf on https (e.g. via a reverse proxy)
  2. have a audiobook with more than ~35 chapters
  3. have a chromecast
  4. to stream that audiobook to the chromecast
  5. -> open the javascript console and check for errors

Audiobookshelf version

v2.20.0

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?

Chrome

Logs

tested with 44 chapters (not working), then with 30 chapters (not working) and another one with 30 chapters (working)

Chromecast enabled import script
8c00c2e.js:1 Socket initialized
8c00c2e.js:1 Fetched tasks {tasks: Array(0), queuedTaskData: {}}
8c00c2e.js:1 [SOCKET] Connected
8c00c2e.js:1 Init Payload {userId: '0b87391b-b537-4247-affe-0241937028e5', username: 'userX', usersOnline: Array(1)}
3d6d76a.js:1 Session state changed event Ob {type: 'sessionstatechanged', session: null, sessionState: 'SESSION_STARTING', errorCode: null}
3d6d76a.js:1 Session state changed event Ob {type: 'sessionstatechanged', session: V, sessionState: 'SESSION_STARTED', errorCode: null}
3d6d76a.js:1 [chromecast] CAST SESSION STARTED
8c00c2e.js:1 [PlayerHandler] Switching to cast player
8c00c2e.js:1 [PlayerHandler] Player state change LOADING
8c00c2e.js:1 [PlayerHandler] Preparing Session {id: '3019ab7c-2d66-481a-bab8-bafa90448fcb', userId: '0b87391b-b537-4247-affe-0241937028e5', libraryId: '3c410bae-74a5-404a-bce3-9eb49ddca057', libraryItemId: '97d23fa0-4a3d-4f5f-b76a-fb4ddb408a16', bookId: 'a2b234be-3392-4663-9ddd-ddf51210a4ca', …}
8c00c2e.js:1 Set media session metadata MediaMetadata {title: 'Der Club des Höllenfeuers', artist: 'Franziska Franke', album: 'Sherlock Holmes Chronicles #14', artwork: Array(1), chapterInfo: Array(44)}
8c00c2e.js:1 Load media failed invalid_parameter
(anonymous) @ 8c00c2e.js:1
Promise.then
(anonymous) @ 8c00c2e.js:1
v @ 8c00c2e.js:1
(anonymous) @ 8c00c2e.js:1
m @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
r @ 9050dc2.js:2
f @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
(anonymous) @ 8c00c2e.js:1
value @ 8c00c2e.js:1
(anonymous) @ 8c00c2e.js:1
m @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
r @ 9050dc2.js:2
f @ 9050dc2.js:2
Promise.then
r @ 9050dc2.js:2
f @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
(anonymous) @ 8c00c2e.js:1
value @ 8c00c2e.js:1
value @ 8c00c2e.js:1
(anonymous) @ 8c00c2e.js:1
m @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
r @ 9050dc2.js:2
f @ 9050dc2.js:2
Promise.then
r @ 9050dc2.js:2
f @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
playLibraryItem @ 8c00c2e.js:1
He @ 9050dc2.js:2
t.$emit @ 9050dc2.js:2
playItem @ c9d405b.js:1
He @ 9050dc2.js:2
n @ 9050dc2.js:2
He @ 9050dc2.js:2
t.$emit @ 9050dc2.js:2
click @ 8c00c2e.js:1
He @ 9050dc2.js:2
n @ 9050dc2.js:2
c._wrapper @ 9050dc2.js:2Understand this errorAI
8c00c2e.js:1 [PlayerHandler] Preparing Session {id: '045e7681-f83e-44e1-bbe4-84280d272c4d', userId: '0b87391b-b537-4247-affe-0241937028e5', libraryId: '3c410bae-74a5-404a-bce3-9eb49ddca057', libraryItemId: '4b9a28fe-8919-4cd0-9505-4e252327d8ae', bookId: 'e49d7ebe-029c-49a1-9469-111551f1a8d3', …}
8c00c2e.js:1 Set media session metadata MediaMetadata {title: 'Die neuen Fälle, Fall 32: Der Fall John Watson', artist: 'Sherlock Holmes', album: 'Sherlock Holmes - Die neuen Fälle #32', artwork: Array(1), chapterInfo: Array(30)}
8c00c2e.js:1 Load media failed invalid_parameter
(anonymous) @ 8c00c2e.js:1
Promise.then
(anonymous) @ 8c00c2e.js:1
v @ 8c00c2e.js:1
(anonymous) @ 8c00c2e.js:1
m @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
r @ 9050dc2.js:2
f @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
(anonymous) @ 8c00c2e.js:1
value @ 8c00c2e.js:1
(anonymous) @ 8c00c2e.js:1
m @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
r @ 9050dc2.js:2
f @ 9050dc2.js:2
Promise.then
r @ 9050dc2.js:2
f @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
(anonymous) @ 8c00c2e.js:1
value @ 8c00c2e.js:1
(anonymous) @ 8c00c2e.js:1
m @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
r @ 9050dc2.js:2
f @ 9050dc2.js:2
Promise.then
r @ 9050dc2.js:2
f @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
(anonymous) @ 9050dc2.js:2
playLibraryItem @ 8c00c2e.js:1
He @ 9050dc2.js:2
t.$emit @ 9050dc2.js:2
playItem @ c9d405b.js:1
He @ 9050dc2.js:2
n @ 9050dc2.js:2
He @ 9050dc2.js:2
t.$emit @ 9050dc2.js:2
click @ 8c00c2e.js:1
He @ 9050dc2.js:2
n @ 9050dc2.js:2
c._wrapper @ 9050dc2.js:2Understand this errorAI
8c00c2e.js:1 [PlayerHandler] Preparing Session {id: 'df96ea36-143f-44d5-83e1-549af75e2b87', userId: '0b87391b-b537-4247-affe-0241937028e5', libraryId: '3c410bae-74a5-404a-bce3-9eb49ddca057', libraryItemId: '71fa24ef-80e4-42b4-96ea-c6367afe5467', bookId: '0be10ff3-9bc1-406a-9a8b-f1b02a9af51d', …}
8c00c2e.js:1 Set media session metadata MediaMetadata {title: 'Im Labyrinth des Wahnsinns', artist: 'Andreas Masuth', album: 'Sherlock Holmes - Die neuen Fälle #29', artwork: Array(1), chapterInfo: Array(30)}
8c00c2e.js:1 [PlayerHandler] Player state change BUFFERING
8c00c2e.js:1 [PlayerHandler] Player state change PLAYING

docker logs do not show much

[2025-04-08 03:38:53.522] INFO: [PlaybackSessionManager] startSession: Closing open session "Die neuen Fälle, Fall 40: Die Speise der Götter" for user "userX" (Device: Windows 10 / Chrome)
[2025-04-08 03:39:06.909] INFO: [PlaybackSessionManager] startSession: Closing open session "Der Club des Höllenfeuers" for user "userX" (Device: Windows 10 / Chrome)
[2025-04-08 03:39:13.827] INFO: [PlaybackSessionManager] startSession: Closing open session "Die neuen Fälle, Fall 32: Der Fall John Watson" for user "userX" (Device: Windows 10 / Chrome)

Additional Notes

No response

Originally created by @h4de5 on GitHub (Apr 7, 2025). ### What happened? still trying to figure the actual problem, but I am kind of stuck. most smaller/shorter audiobooks work correctly and they can be streamed to my chromecast (compatible device). but the big ones always fail. it seems as soon as they have more than ~30 chapters, streaming directly fails with: "Load media failed invalid_parameter" in javascript console and the player keeps loading. I also noticed, that for some audiobooks that have around 30-32 chapters, special characters (e.g. a - ) in the title are also a problem, while they are not for those with like 10 chapters only. I tested it with a sherlock holmes collection of different books - all of them are encoded as mp3, stereo, 320kbit, etc. they do have between 15 and 40 chapters, while their total lenght are always around 70-80min, and their total size is also comparable. all of those with less than ~30 chapters work, while others don't. ### What did you expect to happen? Streaming to chromecast should work regardless of numbers of chapters or title. The app should try to adapt any incompatibilities before starting the streaming session. If the streaming still fails for whatever reason, the UI should display the error instead of silently ignoring it. ### Steps to reproduce the issue 1. run audiobookshelf on https (e.g. via a reverse proxy) 2. have a audiobook with more than ~35 chapters 3. have a chromecast 4. to stream that audiobook to the chromecast 5. -> open the javascript console and check for errors ### Audiobookshelf version v2.20.0 ### 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? Chrome ### Logs tested with 44 chapters (not working), then with 30 chapters (not working) and another one with 30 chapters (working) ```shell Chromecast enabled import script 8c00c2e.js:1 Socket initialized 8c00c2e.js:1 Fetched tasks {tasks: Array(0), queuedTaskData: {…}} 8c00c2e.js:1 [SOCKET] Connected 8c00c2e.js:1 Init Payload {userId: '0b87391b-b537-4247-affe-0241937028e5', username: 'userX', usersOnline: Array(1)} 3d6d76a.js:1 Session state changed event Ob {type: 'sessionstatechanged', session: null, sessionState: 'SESSION_STARTING', errorCode: null} 3d6d76a.js:1 Session state changed event Ob {type: 'sessionstatechanged', session: V, sessionState: 'SESSION_STARTED', errorCode: null} 3d6d76a.js:1 [chromecast] CAST SESSION STARTED 8c00c2e.js:1 [PlayerHandler] Switching to cast player 8c00c2e.js:1 [PlayerHandler] Player state change LOADING 8c00c2e.js:1 [PlayerHandler] Preparing Session {id: '3019ab7c-2d66-481a-bab8-bafa90448fcb', userId: '0b87391b-b537-4247-affe-0241937028e5', libraryId: '3c410bae-74a5-404a-bce3-9eb49ddca057', libraryItemId: '97d23fa0-4a3d-4f5f-b76a-fb4ddb408a16', bookId: 'a2b234be-3392-4663-9ddd-ddf51210a4ca', …} 8c00c2e.js:1 Set media session metadata MediaMetadata {title: 'Der Club des Höllenfeuers', artist: 'Franziska Franke', album: 'Sherlock Holmes Chronicles #14', artwork: Array(1), chapterInfo: Array(44)} 8c00c2e.js:1 Load media failed invalid_parameter (anonymous) @ 8c00c2e.js:1 Promise.then (anonymous) @ 8c00c2e.js:1 v @ 8c00c2e.js:1 (anonymous) @ 8c00c2e.js:1 m @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 r @ 9050dc2.js:2 f @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 (anonymous) @ 8c00c2e.js:1 value @ 8c00c2e.js:1 (anonymous) @ 8c00c2e.js:1 m @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 r @ 9050dc2.js:2 f @ 9050dc2.js:2 Promise.then r @ 9050dc2.js:2 f @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 (anonymous) @ 8c00c2e.js:1 value @ 8c00c2e.js:1 value @ 8c00c2e.js:1 (anonymous) @ 8c00c2e.js:1 m @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 r @ 9050dc2.js:2 f @ 9050dc2.js:2 Promise.then r @ 9050dc2.js:2 f @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 playLibraryItem @ 8c00c2e.js:1 He @ 9050dc2.js:2 t.$emit @ 9050dc2.js:2 playItem @ c9d405b.js:1 He @ 9050dc2.js:2 n @ 9050dc2.js:2 He @ 9050dc2.js:2 t.$emit @ 9050dc2.js:2 click @ 8c00c2e.js:1 He @ 9050dc2.js:2 n @ 9050dc2.js:2 c._wrapper @ 9050dc2.js:2Understand this errorAI 8c00c2e.js:1 [PlayerHandler] Preparing Session {id: '045e7681-f83e-44e1-bbe4-84280d272c4d', userId: '0b87391b-b537-4247-affe-0241937028e5', libraryId: '3c410bae-74a5-404a-bce3-9eb49ddca057', libraryItemId: '4b9a28fe-8919-4cd0-9505-4e252327d8ae', bookId: 'e49d7ebe-029c-49a1-9469-111551f1a8d3', …} 8c00c2e.js:1 Set media session metadata MediaMetadata {title: 'Die neuen Fälle, Fall 32: Der Fall John Watson', artist: 'Sherlock Holmes', album: 'Sherlock Holmes - Die neuen Fälle #32', artwork: Array(1), chapterInfo: Array(30)} 8c00c2e.js:1 Load media failed invalid_parameter (anonymous) @ 8c00c2e.js:1 Promise.then (anonymous) @ 8c00c2e.js:1 v @ 8c00c2e.js:1 (anonymous) @ 8c00c2e.js:1 m @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 r @ 9050dc2.js:2 f @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 (anonymous) @ 8c00c2e.js:1 value @ 8c00c2e.js:1 (anonymous) @ 8c00c2e.js:1 m @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 r @ 9050dc2.js:2 f @ 9050dc2.js:2 Promise.then r @ 9050dc2.js:2 f @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 (anonymous) @ 8c00c2e.js:1 value @ 8c00c2e.js:1 (anonymous) @ 8c00c2e.js:1 m @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 r @ 9050dc2.js:2 f @ 9050dc2.js:2 Promise.then r @ 9050dc2.js:2 f @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 (anonymous) @ 9050dc2.js:2 playLibraryItem @ 8c00c2e.js:1 He @ 9050dc2.js:2 t.$emit @ 9050dc2.js:2 playItem @ c9d405b.js:1 He @ 9050dc2.js:2 n @ 9050dc2.js:2 He @ 9050dc2.js:2 t.$emit @ 9050dc2.js:2 click @ 8c00c2e.js:1 He @ 9050dc2.js:2 n @ 9050dc2.js:2 c._wrapper @ 9050dc2.js:2Understand this errorAI 8c00c2e.js:1 [PlayerHandler] Preparing Session {id: 'df96ea36-143f-44d5-83e1-549af75e2b87', userId: '0b87391b-b537-4247-affe-0241937028e5', libraryId: '3c410bae-74a5-404a-bce3-9eb49ddca057', libraryItemId: '71fa24ef-80e4-42b4-96ea-c6367afe5467', bookId: '0be10ff3-9bc1-406a-9a8b-f1b02a9af51d', …} 8c00c2e.js:1 Set media session metadata MediaMetadata {title: 'Im Labyrinth des Wahnsinns', artist: 'Andreas Masuth', album: 'Sherlock Holmes - Die neuen Fälle #29', artwork: Array(1), chapterInfo: Array(30)} 8c00c2e.js:1 [PlayerHandler] Player state change BUFFERING 8c00c2e.js:1 [PlayerHandler] Player state change PLAYING ``` docker logs do not show much ```shell [2025-04-08 03:38:53.522] INFO: [PlaybackSessionManager] startSession: Closing open session "Die neuen Fälle, Fall 40: Die Speise der Götter" for user "userX" (Device: Windows 10 / Chrome) [2025-04-08 03:39:06.909] INFO: [PlaybackSessionManager] startSession: Closing open session "Der Club des Höllenfeuers" for user "userX" (Device: Windows 10 / Chrome) [2025-04-08 03:39:13.827] INFO: [PlaybackSessionManager] startSession: Closing open session "Die neuen Fälle, Fall 32: Der Fall John Watson" for user "userX" (Device: Windows 10 / Chrome) ``` ### Additional Notes _No response_
Author
Owner

@Vito0912 commented on GitHub (Apr 11, 2025):

Do you have any other Chromecast device to test on?

Also, could you please send the content of the chapterInfo and artwork array for failed items?

I have tested it with books that have over 300 chapters as well as with books that have around 30 chapters, including special characters, German umlauts, etc.

I even tested if it was due to too large of a payload. I had a chapter name that was 4MB in size, and it still worked without any issues on my JBL Bar.

@Vito0912 commented on GitHub (Apr 11, 2025): Do you have any other Chromecast device to test on? Also, could you please send the content of the `chapterInfo` and `artwork` array for failed items? I have tested it with books that have over 300 chapters as well as with books that have around 30 chapters, including special characters, German umlauts, etc. I even tested if it was due to too large of a payload. I had a chapter name that was 4MB in size, and it still worked without any issues on my JBL Bar.
Author
Owner

@h4de5 commented on GitHub (Apr 19, 2025):

just tested it on an original chromecast audio. same problem :(
i can play individual files but not a whole audio book.

@h4de5 commented on GitHub (Apr 19, 2025): just tested it on an original chromecast audio. same problem :( i can play individual files but not a whole audio book.
Author
Owner

@Vito0912 commented on GitHub (Apr 19, 2025):

i can play individual files but not a whole audio book.

What do you mean by this? As far as I know, ABS can only play or stream the whole book (although I might be wrong).

Regarding chapterInfo and artwork, could you share this information so we can try reproducing the issue with the same data? (And if doable for you, the API response for that book)

Also, please try initiating the Chromecast session using another device (for example, the PWA on a smartphone or directly through the Android app).

@Vito0912 commented on GitHub (Apr 19, 2025): > i can play individual files but not a whole audio book. What do you mean by this? As far as I know, ABS can only play or stream the whole book (although I might be wrong). Regarding `chapterInfo` and `artwork`, could you share this information so we can try reproducing the issue with the same data? (And if doable for you, the API response for that book) Also, please try initiating the Chromecast session using another device (for example, the PWA on a smartphone or directly through the Android app).
Author
Owner

@h4de5 commented on GitHub (Apr 19, 2025):

I took one of those files and added it as its own audiobook - a single file plays fine (I also assume a bunch of them would also play - it seems to have something to do with the amount or total size)

I am not sure how to extract the chapterInfo. I can see it in the developer console, but when I try to copy it, it only shows: {}

I tested so far (mostly the same issue)

  • original chromecast device from chrome
  • chromecast group from chrome
  • chromecast compatible device from chrome
  • chromecast compatible device from mobile chrome
  • chromecast compatible device from PWA

then:

  • chromecast compatible device from android app (could not get to play any file)
  • original chromecast device from android app (worked once!!)
  • chromecast group from android app (worked once!!)

especially the last two tests, which for heaven's sake I can't reproduce - make me think, there is something wrong on my network :
any idea is appreciated

@h4de5 commented on GitHub (Apr 19, 2025): I took one of those files and added it as its own audiobook - a single file plays fine (I also assume a bunch of them would also play - it seems to have something to do with the amount or total size) I am not sure how to extract the chapterInfo. I can see it in the developer console, but when I try to copy it, it only shows: {} I tested so far (mostly the same issue) * original chromecast device from chrome * chromecast group from chrome * chromecast compatible device from chrome * chromecast compatible device from mobile chrome * chromecast compatible device from PWA then: * chromecast compatible device from android app (could not get to play any file) * original chromecast device from android app (worked once!!) * chromecast group from android app (worked once!!) especially the last two tests, which for heaven's sake I can't reproduce - make me think, there is something wrong on my network :\ any idea is appreciated
Author
Owner

@phaked commented on GitHub (Dec 18, 2025):

I'm experiencing the same behavior. @h4de5 could you resolve the issue?

@phaked commented on GitHub (Dec 18, 2025): I'm experiencing the same behavior. @h4de5 could you resolve the issue?
Author
Owner

@h4de5 commented on GitHub (Dec 18, 2025):

i switched to the android app and there it worked so far. it sometimes takes a while until its really connected but it plays eventually

@h4de5 commented on GitHub (Dec 18, 2025): i switched to the android app and there it worked so far. it sometimes takes a while until its really connected but it plays eventually
Author
Owner

@4wincode commented on GitHub (Feb 14, 2026):

This appears to actually be a track count issue rather than a chapter info issue. Converting the audiobook to M4B through the interface makes casting from web work perfectly for me.

@4wincode commented on GitHub (Feb 14, 2026): This appears to actually be a track count issue rather than a chapter info issue. Converting the audiobook to M4B through the interface makes casting from web work perfectly for me.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/audiobookshelf-advplyr#2712
No description provided.