[Bug]: M4B files are said to have a JSON syntax error #3142

Open
opened 2026-04-25 00:13:54 +02:00 by adam · 4 comments
Owner

Originally created by @nrth3rnlb on GitHub (Dec 10, 2025).

What happened?

The error occurs with every single one of my M4B audio books:

SyntaxError: Expected property name or '}' in JSON at position 2

What did you expect to happen?

No JSON errors and the book is added to the library.

Steps to reproduce the issue

  1. Import the file or add it to the directory manually

Audiobookshelf version

v2.31.0

How are you running audiobookshelf?

Debian/PPA

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

2025-12-10 10:15:47.159 DEBUG [LibraryScanner] Folder scan results { 'Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2': 0 }
2025-12-10 10:16:04.480 DEBUG [Watcher] File Added /home/me/Audiobooks/Standard/Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2/Drachenzähmen leicht gemacht 1 [B0052E5K0O].m4b
2025-12-10 10:16:04.480 DEBUG [Watcher] Modified file in library "Standard" and folder "fa144cc4-d265-406b-95d8-e1c5384bab0f" with relPath "/Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2/Drachenzähmen leicht gemacht 1 [B0052E5K0O].m4b"
2025-12-10 10:16:04.481 DEBUG [Watcher] Waiting to add file at "/home/me/Audiobooks/Standard/Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2/Drachenzähmen leicht gemacht 1 [B0052E5K0O].m4b". mtimeMs=1765357999000 lastMTimeMs=0 (loop 0)
2025-12-10 10:16:07.482 DEBUG [Watcher] File finished adding at "/home/me/Audiobooks/Standard/Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2/Drachenzähmen leicht gemacht 1 [B0052E5K0O].m4b"
2025-12-10 10:16:14.483 DEBUG [Scanner] Scanning file update groups in folder "fa144cc4-d265-406b-95d8-e1c5384bab0f" of library "Standard"
2025-12-10 10:16:14.483 DEBUG [Scanner] scanFolderUpdates fileUpdateGroup { 'Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2': [ 'Drachenzähmen leicht gemacht 1 [B0052E5K0O].m4b' ] }
2025-12-10 10:16:14.486 DEBUG [LibraryScanner] Folder update group must be a new item "Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2" in library "Standard"
2025-12-10 10:16:14.500
ERROR [AudioFileScanner] SyntaxError: Expected property name or '}' in JSON at position 2 : "/home/me/Audiobooks/Standard/Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2/Drachenzähmen leicht gemacht 1 [B0052E5K0O].m4b"
2025-12-10 10:16:14.501 DEBUG [Scan] "Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2": Library item at path "Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2" has no audio files and no ebook file - ignoring
2025-12-10 10:16:14.501 DEBUG [LibraryScanner] Folder scan results { 'Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2': 0 }

Additional Notes

No response

Originally created by @nrth3rnlb on GitHub (Dec 10, 2025). ### What happened? The error occurs with _every single one_ of my M4B audio books: ``` SyntaxError: Expected property name or '}' in JSON at position 2 ``` ### What did you expect to happen? No JSON errors and the book is added to the library. ### Steps to reproduce the issue 1. Import the file or add it to the directory manually ### Audiobookshelf version v2.31.0 ### How are you running audiobookshelf? Debian/PPA ### 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 2025-12-10 10:15:47.159 DEBUG [LibraryScanner] Folder scan results { 'Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2': 0 } 2025-12-10 10:16:04.480 DEBUG [Watcher] File Added /home/me/Audiobooks/Standard/Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2/Drachenzähmen leicht gemacht 1 [B0052E5K0O].m4b 2025-12-10 10:16:04.480 DEBUG [Watcher] Modified file in library "Standard" and folder "fa144cc4-d265-406b-95d8-e1c5384bab0f" with relPath "/Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2/Drachenzähmen leicht gemacht 1 [B0052E5K0O].m4b" 2025-12-10 10:16:04.481 DEBUG [Watcher] Waiting to add file at "/home/me/Audiobooks/Standard/Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2/Drachenzähmen leicht gemacht 1 [B0052E5K0O].m4b". mtimeMs=1765357999000 lastMTimeMs=0 (loop 0) 2025-12-10 10:16:07.482 DEBUG [Watcher] File finished adding at "/home/me/Audiobooks/Standard/Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2/Drachenzähmen leicht gemacht 1 [B0052E5K0O].m4b" 2025-12-10 10:16:14.483 DEBUG [Scanner] Scanning file update groups in folder "fa144cc4-d265-406b-95d8-e1c5384bab0f" of library "Standard" 2025-12-10 10:16:14.483 DEBUG [Scanner] scanFolderUpdates fileUpdateGroup { 'Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2': [ 'Drachenzähmen leicht gemacht 1 [B0052E5K0O].m4b' ] } 2025-12-10 10:16:14.486 DEBUG [LibraryScanner] Folder update group must be a new item "Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2" in library "Standard" 2025-12-10 10:16:14.500 ERROR [AudioFileScanner] SyntaxError: Expected property name or '}' in JSON at position 2 : "/home/me/Audiobooks/Standard/Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2/Drachenzähmen leicht gemacht 1 [B0052E5K0O].m4b" 2025-12-10 10:16:14.501 DEBUG [Scan] "Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2": Library item at path "Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2" has no audio files and no ebook file - ignoring 2025-12-10 10:16:14.501 DEBUG [LibraryScanner] Folder scan results { 'Thomas Karallus/Drachenzähmen leicht gemacht/Drachenzähmen leicht gemacht 2': 0 } ``` ### Additional Notes _No response_
adam added the bug label 2026-04-25 00:13:54 +02:00
Author
Owner

@Vito0912 commented on GitHub (Dec 10, 2025):

Duplicate of https://github.com/advplyr/audiobookshelf/issues/4236 (assuming you used Libation)

@Vito0912 commented on GitHub (Dec 10, 2025): Duplicate of https://github.com/advplyr/audiobookshelf/issues/4236 (assuming you used Libation)
Author
Owner

@gudstrand commented on GitHub (Dec 11, 2025):

what is the "fix"? I read through the entire thread and it seems like all there are is workarounds. Are there any plans to issue a patch for this anytime soon? If not, what settings should I be using in Libaton to

a) get the best quality
b) retain both atmos and spatial info

I am new to both Libation and Audiobookshelf and so far it has been a rather bumpy road

@gudstrand commented on GitHub (Dec 11, 2025): what is the "fix"? I read through the entire thread and it seems like all there are is workarounds. Are there any plans to issue a patch for this anytime soon? If not, what settings should I be using in Libaton to a) get the best quality b) retain both atmos and spatial info I am new to both Libation and Audiobookshelf and so far it has been a rather bumpy road
Author
Owner

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

There is no real fixable fix. This is due to licensing.

You can follow the tutorial in the linked issue for an unofficial workaround.

If you want it to work with ABS without that workaround, you have to disable the widevine option.
This will give you lower quality audiobooks though.
If you do not want to use the workaround and want the highest quality audio, you need to transcode the files before adding them to abs (e.g. to aac)

There is nothing ABS can do about that. That's an issue of ffmpeg

@Vito0912 commented on GitHub (Dec 11, 2025): There is no real fixable fix. This is due to licensing. You can follow the tutorial in the linked issue for an unofficial workaround. If you want it to work with ABS without that workaround, you have to disable the widevine option. This will give you lower quality audiobooks though. If you do not want to use the workaround and want the highest quality audio, you need to transcode the files before adding them to abs (e.g. to aac) There is nothing ABS can do about that. That's an issue of ffmpeg
Author
Owner

@gudstrand commented on GitHub (Dec 11, 2025):

I added the build step to my audiobookshelf image and can now import the books. I listened to a few via the web player and they seem fine so far.

@gudstrand commented on GitHub (Dec 11, 2025): I added the build step to my audiobookshelf image and can now import the books. I listened to a few via the web player and they seem fine so far.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3142