Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSO issues after server crash #211

Open
nebb00 opened this issue Nov 2, 2024 · 6 comments
Open

SSO issues after server crash #211

nebb00 opened this issue Nov 2, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@nebb00
Copy link

nebb00 commented Nov 2, 2024

When my ABS crashes for a random reason. Even after resolving the server issue, plappa does not reconnect automatically. When I sign out to re-sign back in. Plappa does not start my OIDC login via Authelia again. I have to uninstall the app and reinstall to have it work again.

[02/11/2024, 18:13] [AudioBookShelfAPIHandler] Keychain error: plappa.KeychainError.credentialsNotFound
[02/11/2024, 18:13] [CoreDataHandler] Initializing core data store...
[02/11/2024, 18:13] [CoreDataHandler] CoreData store initialized
[02/11/2024, 18:13] [JellyfinAPIHandler] Couldn't connect to server: Could not connect to the server.
[02/11/2024, 18:13] [JellyfinAPIHandler] Couldn't connect to server: Could not connect to the server.
[02/11/2024, 18:13] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[02/11/2024, 18:14] [AudioBookShelfAPIHandler] Couldn't connect to server: A server with the specified hostname could not be found.
[02/11/2024, 18:14] [AudioBookShelfAPIHandler] Couldn't connect to server: A server with the specified hostname could not be found.
[02/11/2024, 18:14] [plappa] Encountered an error while decoding status response: The data couldn’t be read because it isn’t in the correct format.
dataCorrupted(Swift.DecodingError.Context(codingPath: [], debugDescription: "The given data was not valid JSON.", underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840 "Unexpected character '<' around line 1, column 1." UserInfo={NSDebugDescription=Unexpected character '<' around line 1, column 1., NSJSONSerializationErrorIndex=0})))
[02/11/2024, 18:14] [AudioBookShelfAPIHandler] Server returned unexpected response:
<private>
[02/11/2024, 18:14] [plappa] Encountered an error while decoding status response: The data couldn’t be read because it isn’t in the correct format.
dataCorrupted(Swift.DecodingError.Context(codingPath: [], debugDescription: "The given data was not valid JSON.", underlyingError: Optional(Error Domai=NSCocoaErrorDomain Code=3840 "Unexpected character '<' around line 1, column 1." UserInfo={NSJSONSerializationErrorIndex=0, NSDebugDescription=Unexpected character '<' around line 1, column 1.})))
[02/11/2024, 18:14] [AudioBookShelfAPIHandler] Server returned unexpected response:
<private>
@nebb00 nebb00 added the bug Something isn't working label Nov 2, 2024
@LeoKlaus
Copy link
Owner

LeoKlaus commented Nov 2, 2024

What exactly are you doing when the server crashes? Are you restarting plappa?

The logs indicate that the server is returning HTML instead of JSON, which usually indicates that the request is not sent to the correct endpoint (i.e. wrong port or protocol.

@nebb00
Copy link
Author

nebb00 commented Nov 2, 2024

I believe the crashes are related to advplyr/audiobookshelf#3565

And no, I don't do anything in plappa after ABS has been restarted. I get an error saying it's unable to connect to the server (sorry didn't take screenshot) even after restarting the app. So I sign out, type in the url. And normally it prompts to sign in with OpenID. But it don't. Unless I uninstall and reinstall. I have had two other users experience this over the last couple months. But I've only just moved to IOS and this is my first instance of this problem

@LeoKlaus
Copy link
Owner

LeoKlaus commented Nov 2, 2024

I believe the crashes are related to advplyr/audiobookshelf#3565

Those should be fixed with ABS 2.16.2. How do the logs look before trying to log out and back in again?

This didn't happen on any of my devices when experimenting with 2.16.1 even after tens of server crashes, so I'm assuming it's something about your specific setup that causes this.

@nebb00
Copy link
Author

nebb00 commented Nov 2, 2024

That's a good point. As it's been happening for a couple months whenever I have noticed the docker container has stopped

Here are the logs after reinstalling and logging in


[02/11/2024, 18:18] [AudioBookShelfAPIHandler] Tried to init ABS APIHandler without server url or username
[02/11/2024, 18:18] [JellyfinAPIHandler] Couldn't connect to server: Could not connect to the server.
[02/11/2024, 18:18] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[02/11/2024, 18:18] [AudioBookShelfAPIHandler] Couldn't connect to server: A server with the specified hostname could not be found.
[02/11/2024, 18:18] [AudioBookShelfAPIHandler] Couldn't connect to server: A server with the specified hostname could not be found.
[02/11/2024, 18:18] [PlaybackStateHandler] Found no saved playback states in iCloud.
[02/11/2024, 18:18] [PlaybackSessionHandler] Found no local playback sessions.
[02/11/2024, 18:18] [PlaybackSessionHandler] Found no local playback sessions.
[02/11/2024, 18:18] [SoundHandler] Tried to save playback state with invalid audiobook.
[02/11/2024, 18:30] [plappa] Encountered an error while decoding server info: The data couldn’t be read because it isn’t in the correct format.
dataCorrupted(Swift.DecodingError.Context(codingPath: [], debugDescription: "The given data was not valid JSON.", underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840 "Unexpected character '<' around line 1, column 1." UserInfo={NSJSONSerializationErrorIndex=0, NSDebugDescription=Unexpected character '<' around line 1, column 1.})))
[02/11/2024, 18:30] [JellyfinAPIHandler] Connected to server but received unexpected response: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /System/Info/Public</pre>
</body>
</html>
[02/11/2024, 18:31] [SoundHandler] Tried to save playback state with invalid audiobook.
[02/11/2024, 18:48] [AudioBookShelfAPIHandler] Successfully posted sessions

@LeoKlaus
Copy link
Owner

LeoKlaus commented Nov 2, 2024

That is before the server crashed?

@nebb00
Copy link
Author

nebb00 commented Nov 2, 2024

The previous logs are after a successful login after a reinstall right now

@nebb00 nebb00 changed the title [BUG] SSO issues sfter server crash Nov 2, 2024
@nebb00 nebb00 changed the title SSO issues sfter server crash SSO issues after server crash Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants