[Bug]: Server crash not valid JSON #2444

Closed
opened 2026-04-25 00:07:12 +02:00 by adam · 8 comments
Owner

Originally created by @Abateman121 on GitHub (Dec 30, 2024).

2025-01-02.txt

What happened?

So I have an issue that has occured when using the IOS app through testflight or through sidestore. The issue is I will do a listening session for a book lets say for example it starts at timestamp 1:00:00, I will listen for 30 minutes. Then I will pause/stop playback or change Bluetooth devices (headset to car or vice versa). When I go to resume the playback the app will not respond/crash and then switch to playing Apple Music instead. When I go into the app I see a websocket error and it acts like my most recent playback session did not happen it will start back at the 1:00:00 timestamp and I have to fast-forward back to where I was. I have enabled websocket support through my nginx proxy manager setup. The book can be downloaded or streamed does not seem to make a difference.

What did you expect to happen?

I would expect it to start playback from where I last left off.

Steps to reproduce the issue

  1. Listen to book for awhile on IOS app
  2. Pause playback
  3. Resume playback

Audiobookshelf version

2.17.5

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?

None

Logs

I think this is the correct stuff from the logs

2024-12-30 09:46:07.055

DEBUG

[PlaybackSessionManager] startSessionRequest for device iPhone13,2 / v0.9.77

2024-12-30 09:46:07.056

DEBUG

[PlaybackSessionManager] "abateman" starting direct play session for item "bb299510-3e83-4f27-9437-19c917a24ea5" with id 9c0bde32-e499-4450-8ca9-88a979f432f9 (Device: iPhone13,2 / v0.9.77)

2024-12-30 09:46:10.863

DEBUG

[PlaybackSessionManager] syncSession "9c0bde32-e499-4450-8ca9-88a979f432f9" (Device: iPhone13,2 / v0.9.77) | Total Time Listened: 0

2024-12-30 09:46:37.105

DEBUG

[PlaybackSessionManager] syncSession "9c0bde32-e499-4450-8ca9-88a979f432f9" (Device: iPhone13,2 / v0.9.77) | Total Time Listened: 26.23524498939514

2024-12-30 09:47:07.073

DEBUG

[PlaybackSessionManager] syncSession "9c0bde32-e499-4450-8ca9-88a979f432f9" (Device: iPhone13,2 / v0.9.77) | Total Time Listened: 56.21263098716736

2024-12-30 09:47:22.065

DEBUG

[PlaybackSessionManager] syncSession "9c0bde32-e499-4450-8ca9-88a979f432f9" (Device: iPhone13,2 / v0.9.77) | Total Time Listened: 71.21701383590698

2024-12-30 09:47:52.082

DEBUG

[PlaybackSessionManager] syncSession "9c0bde32-e499-4450-8ca9-88a979f432f9" (Device: iPhone13,2 / v0.9.77) | Total Time Listened: 101.22532081604004

2024-12-30 09:48:07.070

DEBUG

[PlaybackSessionManager] syncSession "9c0bde32-e499-4450-8ca9-88a979f432f9" (Device: iPhone13,2 / v0.9.77) | Total Time Listened: 116.23482894897461

2024-12-30 09:48:22.103

DEBUG

[PlaybackSessionManager] syncSession "9c0bde32-e499-4450-8ca9-88a979f432f9" (Device: iPhone13,2 / v0.9.77) | Total Time Listened: 131.23537588119507

2024-12-30 09:48:52.103

DEBUG

[PlaybackSessionManager] syncSession "9c0bde32-e499-4450-8ca9-88a979f432f9" (Device: iPhone13,2 / v0.9.77) | Total Time Listened: 161.2343168258667

2024-12-30 09:49:22.093

DEBUG

[PlaybackSessionManager] syncSession "9c0bde32-e499-4450-8ca9-88a979f432f9" (Device: iPhone13,2 / v0.9.77) | Total Time Listened: 191.23461484909058

2024-12-30 09:49:47.604

DEBUG

[PlaybackSessionManager] syncSession "9c0bde32-e499-4450-8ca9-88a979f432f9" (Device: iPhone13,2 / v0.9.77) | Total Time Listened: 206.23501110076904

2024-12-30 09:59:49.390

INFO

[PlaybackSessionManager] Syncing local session "The Swarm" (0178AD96-86B0-4F6E-9152-4945CEE2CC8B)

2024-12-30 09:59:49.427

DEBUG

[PlaybackSessionManager] Updated session for "The Swarm" (0178AD96-86B0-4F6E-9152-4945CEE2CC8B)

2024-12-30 09:59:49.465

DEBUG

[PlaybackSessionManager] Not updating progress for "The Swarm" because it has been updated more recently

Additional Notes

My setup for accessing it remotely is using my FQDN setup with Nginx proxy manager. I have websocket support, cache assets, block common exploits enabled in NGPM
crash_logs.txt

2025-01-02.txt

So just experienced the issue again while on my home network. The playback went back about 20 minutes or so from where I stopped the playback. Pulled the daily and crash logs and uploaded them here

Originally created by @Abateman121 on GitHub (Dec 30, 2024). [2025-01-02.txt](https://github.com/user-attachments/files/18294064/2025-01-02.txt) ### What happened? So I have an issue that has occured when using the IOS app through testflight or through sidestore. The issue is I will do a listening session for a book lets say for example it starts at timestamp 1:00:00, I will listen for 30 minutes. Then I will pause/stop playback or change Bluetooth devices (headset to car or vice versa). When I go to resume the playback the app will not respond/crash and then switch to playing Apple Music instead. When I go into the app I see a websocket error and it acts like my most recent playback session did not happen it will start back at the 1:00:00 timestamp and I have to fast-forward back to where I was. I have enabled websocket support through my nginx proxy manager setup. The book can be downloaded or streamed does not seem to make a difference. ### What did you expect to happen? I would expect it to start playback from where I last left off. ### Steps to reproduce the issue 1. Listen to book for awhile on IOS app 2. Pause playback 3. Resume playback 4. ### Audiobookshelf version 2.17.5 ### 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? None ### Logs ```shell I think this is the correct stuff from the logs 2024-12-30 09:46:07.055 DEBUG [PlaybackSessionManager] startSessionRequest for device iPhone13,2 / v0.9.77 2024-12-30 09:46:07.056 DEBUG [PlaybackSessionManager] "abateman" starting direct play session for item "bb299510-3e83-4f27-9437-19c917a24ea5" with id 9c0bde32-e499-4450-8ca9-88a979f432f9 (Device: iPhone13,2 / v0.9.77) 2024-12-30 09:46:10.863 DEBUG [PlaybackSessionManager] syncSession "9c0bde32-e499-4450-8ca9-88a979f432f9" (Device: iPhone13,2 / v0.9.77) | Total Time Listened: 0 2024-12-30 09:46:37.105 DEBUG [PlaybackSessionManager] syncSession "9c0bde32-e499-4450-8ca9-88a979f432f9" (Device: iPhone13,2 / v0.9.77) | Total Time Listened: 26.23524498939514 2024-12-30 09:47:07.073 DEBUG [PlaybackSessionManager] syncSession "9c0bde32-e499-4450-8ca9-88a979f432f9" (Device: iPhone13,2 / v0.9.77) | Total Time Listened: 56.21263098716736 2024-12-30 09:47:22.065 DEBUG [PlaybackSessionManager] syncSession "9c0bde32-e499-4450-8ca9-88a979f432f9" (Device: iPhone13,2 / v0.9.77) | Total Time Listened: 71.21701383590698 2024-12-30 09:47:52.082 DEBUG [PlaybackSessionManager] syncSession "9c0bde32-e499-4450-8ca9-88a979f432f9" (Device: iPhone13,2 / v0.9.77) | Total Time Listened: 101.22532081604004 2024-12-30 09:48:07.070 DEBUG [PlaybackSessionManager] syncSession "9c0bde32-e499-4450-8ca9-88a979f432f9" (Device: iPhone13,2 / v0.9.77) | Total Time Listened: 116.23482894897461 2024-12-30 09:48:22.103 DEBUG [PlaybackSessionManager] syncSession "9c0bde32-e499-4450-8ca9-88a979f432f9" (Device: iPhone13,2 / v0.9.77) | Total Time Listened: 131.23537588119507 2024-12-30 09:48:52.103 DEBUG [PlaybackSessionManager] syncSession "9c0bde32-e499-4450-8ca9-88a979f432f9" (Device: iPhone13,2 / v0.9.77) | Total Time Listened: 161.2343168258667 2024-12-30 09:49:22.093 DEBUG [PlaybackSessionManager] syncSession "9c0bde32-e499-4450-8ca9-88a979f432f9" (Device: iPhone13,2 / v0.9.77) | Total Time Listened: 191.23461484909058 2024-12-30 09:49:47.604 DEBUG [PlaybackSessionManager] syncSession "9c0bde32-e499-4450-8ca9-88a979f432f9" (Device: iPhone13,2 / v0.9.77) | Total Time Listened: 206.23501110076904 2024-12-30 09:59:49.390 INFO [PlaybackSessionManager] Syncing local session "The Swarm" (0178AD96-86B0-4F6E-9152-4945CEE2CC8B) 2024-12-30 09:59:49.427 DEBUG [PlaybackSessionManager] Updated session for "The Swarm" (0178AD96-86B0-4F6E-9152-4945CEE2CC8B) 2024-12-30 09:59:49.465 DEBUG [PlaybackSessionManager] Not updating progress for "The Swarm" because it has been updated more recently ``` ### Additional Notes My setup for accessing it remotely is using my FQDN setup with Nginx proxy manager. I have websocket support, cache assets, block common exploits enabled in NGPM [crash_logs.txt](https://github.com/user-attachments/files/18294065/crash_logs.txt) [2025-01-02.txt](https://github.com/user-attachments/files/18294069/2025-01-02.txt) So just experienced the issue again while on my home network. The playback went back about 20 minutes or so from where I stopped the playback. Pulled the daily and crash logs and uploaded them here
adam added the bug label 2026-04-25 00:07:12 +02:00
adam closed this issue 2026-04-25 00:07:12 +02:00
Author
Owner

@Abateman121 commented on GitHub (Dec 30, 2024):

I will also try to remember to grab logs and record timestamps when it happens again. This issue is not 100% reproducible. I would say it happens like one out of every 5 or so playback sessions

@Abateman121 commented on GitHub (Dec 30, 2024): I will also try to remember to grab logs and record timestamps when it happens again. This issue is not 100% reproducible. I would say it happens like one out of every 5 or so playback sessions
Author
Owner

@Shades228 commented on GitHub (Jan 28, 2025):

I can reproduce this issue almost every time.

@Shades228 commented on GitHub (Jan 28, 2025): I can reproduce this issue almost every time.
Author
Owner

@advplyr commented on GitHub (Jan 28, 2025):

There is something wrong with your database. This has never come up before so I would have to see the database file

Here is the crash

{"timestamp":"2024-10-01 11:40:56.083","source":"Server.js:185","message":"[Server] Unhandled rejection: SyntaxError: Unexpected token ']', ...\"'s Creed\",]\" is not valid JSON, promise: Promise {\n  <rejected> SyntaxError: Unexpected token ']', ...\"'s Creed\",]\" is not valid JSON\n      at JSON.parse (<anonymous>)\n      at parse (/node_modules/sequelize/lib/dialects/sqlite/data-types.js:34:19)\n      at Query.applyParsers (/node_modules/sequelize/lib/dialects/sqlite/query.js:289:14)\n      at /node_modules/sequelize/lib/dialects/sqlite/query.js:112:80\n      at /node_modules/lodash/lodash.js:13469:38\n      at /node_modules/lodash/lodash.js:4967:15\n      at baseForOwn (/node_modules/lodash/lodash.js:3032:24)\n      at Function.mapValues (/node_modules/lodash/lodash.js:13468:7)\n      at /node_modules/sequelize/lib/dialects/sqlite/query.js:93:18\n      at Array.map (<anonymous>)\n}","levelName":"FATAL","level":5}
@advplyr commented on GitHub (Jan 28, 2025): There is something wrong with your database. This has never come up before so I would have to see the database file Here is the crash ```json {"timestamp":"2024-10-01 11:40:56.083","source":"Server.js:185","message":"[Server] Unhandled rejection: SyntaxError: Unexpected token ']', ...\"'s Creed\",]\" is not valid JSON, promise: Promise {\n <rejected> SyntaxError: Unexpected token ']', ...\"'s Creed\",]\" is not valid JSON\n at JSON.parse (<anonymous>)\n at parse (/node_modules/sequelize/lib/dialects/sqlite/data-types.js:34:19)\n at Query.applyParsers (/node_modules/sequelize/lib/dialects/sqlite/query.js:289:14)\n at /node_modules/sequelize/lib/dialects/sqlite/query.js:112:80\n at /node_modules/lodash/lodash.js:13469:38\n at /node_modules/lodash/lodash.js:4967:15\n at baseForOwn (/node_modules/lodash/lodash.js:3032:24)\n at Function.mapValues (/node_modules/lodash/lodash.js:13468:7)\n at /node_modules/sequelize/lib/dialects/sqlite/query.js:93:18\n at Array.map (<anonymous>)\n}","levelName":"FATAL","level":5} ```
Author
Owner

@Abateman121 commented on GitHub (Jan 30, 2025):

Do you want me to upload my sqllite db file? Does it contain sensitive data i should strip out first?

There is something wrong with your database. This has never come up before so I would have to see the database file

@Abateman121 commented on GitHub (Jan 30, 2025): Do you want me to upload my sqllite db file? Does it contain sensitive data i should strip out first? > There is something wrong with your database. This has never come up before so I would have to see the database file >
Author
Owner

@Abateman121 commented on GitHub (Feb 13, 2025):

DB file

@Abateman121 commented on GitHub (Feb 13, 2025): DB file <Removed>
Author
Owner

@advplyr commented on GitHub (Feb 14, 2025):

I got the db and don't see anything stand out.
Can you update to the latest version 2.19.2 and test again until there is a crash and share the full daily log file?

In 2.19.0 a bug was fixed where the fatal crash log wasn't getting written, so I don't think we see the actual cause of the crash here.

On an unrelated note, I noticed you have both the folder watcher enabled and hourly library scans. If your file system can use the watcher then you shouldn't need to have library scans scheduled because the watcher detects updates automatically.

A note was added recently to that tab:

Image

@advplyr commented on GitHub (Feb 14, 2025): I got the db and don't see anything stand out. Can you update to the latest version 2.19.2 and test again until there is a crash and share the full daily log file? In 2.19.0 a bug was fixed where the fatal crash log wasn't getting written, so I don't think we see the actual cause of the crash here. On an unrelated note, I noticed you have both the folder watcher enabled and hourly library scans. If your file system can use the watcher then you shouldn't need to have library scans scheduled because the watcher detects updates automatically. A note was added recently to that tab: ![Image](https://github.com/user-attachments/assets/4259a4b8-d640-4d3f-a47a-6b62230d5d15)
Author
Owner

@Abateman121 commented on GitHub (Feb 14, 2025):

Thanks for checking I just updated to the new version so i will keep an eye out for the crash and reupload logs then. Also I will turn off scheduled scans sicne th watcher works great

@Abateman121 commented on GitHub (Feb 14, 2025): Thanks for checking I just updated to the new version so i will keep an eye out for the crash and reupload logs then. Also I will turn off scheduled scans sicne th watcher works great
Author
Owner

@advplyr commented on GitHub (Feb 22, 2025):

Any update?

@advplyr commented on GitHub (Feb 22, 2025): Any update?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2444