LeoKlaus / plappa

An Audiobook client for Jellyfin and AudioBookShelf, written in Swift/SwiftUI.
https://plappa.me
237 stars 1 forks source link

[BUG] [AudioBookShelfAPIHandler] Tried to init ABS APIHandler without server url or username #182

Closed glottisfaun0000 closed 2 months ago

glottisfaun0000 commented 2 months ago

Unable to login to Audiobookshelf

Audiobookshelf: v2.13.3 Docker

[9/3/2024, 9:11 AM] [AudioBookShelfAPIHandler] Tried to init ABS APIHandler without server url or username
[9/3/2024, 9:11 AM] [JellyfinAPIHandler] Couldn't connect to server: Could not connect to the server.
[9/3/2024, 9:11 AM] [JellyfinAPIHandler] Couldn't connect to server: Could not connect to the server.
[9/3/2024, 9:11 AM] [JellyfinAPIHandler] Couldn't connect to server: Could not connect to the server.
[9/3/2024, 9:12 AM] [plappa] Encountered an error while decoding auth response: The data couldn’t be read because it is missing.
valueNotFound(Swift.Float, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "user", intValue: nil), CodingKeys(stringValue: "mediaProgress", intValue: nil), _JSONKey(stringValue: "Index 23", intValue: 23), CodingKeys(stringValue: "duration", intValue: nil)], debugDescription: "Cannot get unkeyed decoding container -- found null value instead", underlyingError: nil))
[9/3/2024, 9:12 AM] [plappa] Encountered an error while decoding auth response: The data couldn’t be read because it is missing.
valueNotFound(Swift.Float, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "user", intValue: nil), CodingKeys(stringValue: "mediaProgress", intValue: nil), _JSONKey(stringValue: "Index 23", intValue: 23), CodingKeys(stringValue: "duration", intValue: nil)], debugDescription: "Cannot get unkeyed decoding container -- found null value instead", underlyingError: nil))

Meanwhile in ABS logs: [2024-09-03 09:16:06.335] INFO: [Auth] User "admin" logged in from ip xxx.xx.xx.xxx

plappa stays on login screen. This is after things were working fine and I logged out to move to a different reverse proxy domain, but now can't log in even with the LAN IP.

bkeifer commented 2 months ago

Seeing similar behavior here. ABS 2.13.3 docker and Plappa downloaded fresh from the iOS App Store. I'm authenticating via OpenID with Authentik. When I connect, I'm routed through the Authentik process successfully and ABS registers a valid login as in the OP.

For what it's worth, I'm on the iOS 18 dev beta. Another iPhone on my network on iOS 17 is unaffected and able to log in with the same authentication flow successfully.

Plappa debug logs below, happy to do any troubleshooting that may help.

[9/3/2024, 2:56 PM] [AudioBookShelfAPIHandler] Tried to init ABS APIHandler without server url or username
[9/3/2024, 2:56 PM] [JellyfinAPIHandler] Couldn't connect to server: Could not connect to the server.
[9/3/2024, 2:56 PM] [JellyfinAPIHandler] Couldn't connect to server: Could not connect to the server.
[9/3/2024, 2:56 PM] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[9/3/2024, 2:56 PM] [AudioBookShelfAPIHandler] Couldn't connect to server: A server with the specified hostname could not be found.
[9/3/2024, 2:57 PM] [AudioBookShelfAPIHandler] Couldn't connect to server: A server with the specified hostname could not be found.
[9/3/2024, 2:57 PM] [AudioBookShelfAPIHandler] Couldn't connect to server: A server with the specified hostname could not be found.
[9/3/2024, 2:57 PM] [plappa] Encountered an error while decoding auth response: The data couldn’t be read because it is missing.
valueNotFound(Swift.Float, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "user", intValue: nil), CodingKeys(stringValue: "mediaProgress", intValue: nil), _CodingKey(stringValue: "Index 18", intValue: 18), CodingKeys(stringValue: "duration", intValue: nil)], debugDescription: "Cannot get value of type Float -- found null value instead", underlyingError: nil))
LeoKlaus commented 2 months ago

Thank you both for your reports. This issue should be resolved in the latest TestFlight release, you can try it here: https://testflight.apple.com/join/oSAekRD5

@bkeifer did you use a different user with the other iPhone by chance? Some context: The iOS version shouldn’t matter here as the error is caused by plappa expecting a value for the “duration“ field of a media progress for the user you‘re trying to log in as.

bkeifer commented 2 months ago

@LeoKlaus Updated to the TestFlight build and I'm working again. Thanks!

Yes, it was a different user on the other phone.

glottisfaun0000 commented 2 months ago

Testflight version works for me as well, fix is good. Thanks for the quick work @LeoKlaus

LeoKlaus commented 2 months ago

Thank you for your feedback, glad it works now! I'll reopen this to keep it visible until the fix is available in the AppStore as well.

lyossius commented 2 months ago

Hello everyone, I'm on the newest Testflight release (1.4.2 (47) ) and can still reproduce this error. ABS is on 12.13.3 and iOS is on Version 17.6.1. I also use Authentik (2024.6.3) to authenticate.

[4.9.2024, 7:27] [AudioBookShelfAPIHandler] Tried to init ABS APIHandler without server url or username
[4.9.2024, 7:27] [JellyfinAPIHandler] Couldn't connect to server: Verbindung zum Server konnte nicht hergestellt werden.
[4.9.2024, 7:27] [JellyfinAPIHandler] Couldn't connect to server: Verbindung zum Server konnte nicht hergestellt werden.
[4.9.2024, 7:27] [AudioBookShelfAPIHandler] Couldn't connect to server: Verbindung zum Server konnte nicht hergestellt werden.
[4.9.2024, 7:27] [plappa] Encountered an error while decoding auth response: Die Daten konnten nicht gelesen werden, da sie fehlen.
valueNotFound(Swift.Float, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "user", intValue: nil), CodingKeys(stringValue: "mediaProgress", intValue: nil), _JSONKey(stringValue: "Index 194", intValue: 194), CodingKeys(stringValue: "duration", intValue: nil)], debugDescription: "Cannot get unkeyed decoding container -- found null value instead", underlyingError: nil))

EDIT:

I could login with plappa and authentik after discarding the progress of two books in the original ABS App and remove the Audiobooks from my "Continue Listenting" Stack.

LeoKlaus commented 2 months ago

Hello everyone, I'm on the newest Testflight release (1.4.2 (47) ) and can still reproduce this error.

Build 47 was actually before the fix, I had only released later versions to the "experimental" branch on TestFlight for now.

LeoKlaus commented 2 months ago

Update 1.4.2 of plappa just got approved for the AppStore, so I'm closing this. Should the issue still pop up, please reopen. Thank you very much for your feedback!