LeoKlaus / plappa

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

[BUG] Couldn't reach your server. Tap to Retry... #34

Open purple-emily opened 2 months ago

purple-emily commented 2 months ago

I'm connecting to Audiobookshelf over Tailscale. I can see my library but have a very persistant error: Couldn't reach your server. Tap to Retry...

To Reproduce Steps to reproduce the behavior:

  1. Own a domain.
  2. Set domain to point to a Tailscale IP.
  3. Audiobookshelf
  4. Login takes lots of presses of the login button and persistant error as above.

Expected behavior Connection is stable.

Screenshots If applicable, add screenshots to help explain your problem.

Logs

[06/04/2024, 8:05 AM] [AudioBookShelfAPIHandler] Tried to init ABS APIHandler with no valid token in keychain
[06/04/2024, 8:05 AM] [AudioBookShelfAPIHandler] Keychain error: Error Domain=plappa.KeychainError Code=2
[06/04/2024, 8:05 AM] [JellyfinAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:05 AM] [AudioBookShelfAPIHandler] Tried to init ABS APIHandler with no valid token in keychain
[06/04/2024, 8:05 AM] [AudioBookShelfAPIHandler] Keychain error: Error Domain=plappa.KeychainError Code=2
[06/04/2024, 8:05 AM] [JellyfinAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:05 AM] [AudioBookShelfAPIHandler] Tried to init ABS APIHandler with no valid token in keychain
[06/04/2024, 8:05 AM] [AudioBookShelfAPIHandler] Keychain error: Error Domain=plappa.KeychainError Code=2
[06/04/2024, 8:05 AM] [JellyfinAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:05 AM] [JellyfinAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:05 AM] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:05 AM] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:05 AM] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:05 AM] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:05 AM] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:05 AM] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:05 AM] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:05 AM] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:06 AM] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:06 AM] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:06 AM] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:06 AM] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:06 AM] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:06 AM] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:06 AM] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:07 AM] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:07 AM] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:07 AM] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:07 AM] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[06/04/2024, 8:07 AM] [PlaybackStateHandler] Syncing playback states through server
[06/04/2024, 8:07 AM] [PlaybackStateHandler] Syncing playback states through server
[06/04/2024, 8:07 AM] [ReadingListHandler] Found no objects in reading list
[06/04/2024, 8:07 AM] [SoundHandler] Tried to save playback state with invalid audiobook.
[06/04/2024, 8:07 AM] [AudioBookShelfAPIHandler] Successfully pushed playbackstates

Environment(please complete the following information):

Additional context https://audiobookshelf.internal.my.domain which points to: 100.64.0.2 and fd7a:115c:a1e0::72f1:600b

I am using a DNS server over Tailscale with no issues. Tailscale connection is very stable.

I can use the Testflight version of ABS with no connectivity issues.

LeoKlaus commented 2 months ago

Hey Emily, thanks for reporting this.

I just spun up Tailscale myself to see if I can reproduce this but was able to connect just fine.

What really confuses me is that it seems to work intermittently, so it can't be related to transport security or something like that.

Other people have also reported needing multiple attempts to make the connection work or plappa being entirely unable to connect, I assume the underlying issue is the same.

Can you think of anything in your configuration that might cause this? Maybe rate-limiting through a proxy or something like that?

LeoKlaus commented 2 months ago

I've added much more in-depth debug logging for such errors with update 1.1.1.

Most users affected by this have reported that retrying to log in multiple times "helped".

Tharic99 commented 2 months ago

I'm seeing this as well but I'm not running Tailscale. I'm able to connect with ABS over the web externally or through the ABS Android app, but my wife is unable to connect with Plappa to the same ABS server.

Even trying the log in multiple times doesn't work unfortunately.

LeoKlaus commented 2 months ago

Hey Tharic99,

Thanks for reaching out! Can you send me the debug logs after trying to sign in? There's a button to export them in the top right of the log in page.

jcsomerville commented 2 months ago

I'm having similar issues as well. Not using Tailscale but can't reach sever at all. Using correct URL and credentials.


[4/17/2024, 9:09 PM] [JellyfinAPIHandler] Couldn't connect to server: Could not connect to the server.
[4/17/2024, 9:09 PM] [JellyfinAPIHandler] Couldn't connect to server: Could not connect to the server.
[4/17/2024, 9:09 PM] [AudioBookShelfAPIHandler] Tried to init ABS APIHandler without server url or username
[4/17/2024, 9:09 PM] [JellyfinAPIHandler] Couldn't connect to server: Could not connect to the server.
[4/17/2024, 9:09 PM] [JellyfinAPIHandler] Couldn't connect to server: A server with the specified hostname could not be found.
[4/17/2024, 9:09 PM] [plappa] Encountered an error while decoding server info: <private>
<private>
[4/17/2024, 9:09 PM] [plappa] Encountered an error while decoding server info: <private>
<private>
[4/17/2024, 9:09 PM] [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>
jcsomerville commented 2 months ago

Turns out the it was because I was using Authentik and Authentik does not create a password when creating a new user.

I had to manually set a password for the user that was having these log in issues.

LeoKlaus commented 2 months ago

Turns out the it was because I was using Authentik and Authentik does not create a password when creating a new user.

I had to manually set a password for the user that was having these log in issues.

That's interesting. Were you able to log in to your instance behind Authentik that way? As of now, plappa doesn't support third party auth providers.

For the regular AudioBookShelf auth, login with no password is possible (ABS only allows this for root users though).

t18n commented 2 months ago

I am also facing the same issue with Audiobookshelf. This is my log:

[21/4/2024, 21.05] [AudioBookShelfAPIHandler] Couldn't get token [21/4/2024, 21.05] [AudioBookShelfAPIHandler] Couldn't get token

I have tried logging out and login again, reinstalling the app with no luck. I initially tried the app with Jellyfin, the logout Jellyfin and login with Audiobookshelf.

Edit: To add more context, I use Synology DDNS. The Jellyfin connection never gave me any problem, but Audiobookshelf does.

LeoKlaus commented 1 month ago

Sorry for the late reply. Do you guys still face these issues?

[21/4/2024, 21.05] [AudioBookShelfAPIHandler] Couldn't get token [21/4/2024, 21.05] [AudioBookShelfAPIHandler] Couldn't get token

This should be a different issue. The "Couldn't get token" message indicates that the auth token couldn't be read from the keychain of your device (while loading metadata). It's really weird that reinstalling the app didn't help in that case. Did the first login work?

t18n commented 1 month ago

Hey @LeoKlaus, I installed 1.1.5 via Testflight and the issue seems to be resolved.

Btw, thanks a lot for a bunch of updates recently 🔥

LeoKlaus commented 1 month ago

Hey @LeoKlaus, I installed 1.1.5 via Testflight and the issue seems to be resolved.

Btw, thanks a lot for a bunch of updates recently 🔥

Great to hear! If you notice anything else, feel free to let me know :)