Fallenbagel / jellyseerr

Fork of overseerr for jellyfin support.
https://docs.jellyseerr.dev/
MIT License
3.75k stars 231 forks source link

Library sync fails with 401 #618

Closed pilipovicn closed 2 months ago

pilipovicn commented 9 months ago

Description

Being logged in to Jellyseerr for some time causes something to expire internally, and I can no longer Scan or Sync jellyfin libraries, with the following error in the logs: 2024-01-09T02:30:34.835Z [error][Jellyfin API]: Something went wrong while getting libraries from the Jellyfin server: Request failed with status code 401 Jellyfin logs show CustomAuthentication Invalid Token error. Logging out and logging back in solves this. I am using a jellyfin user.

Version

1.7.0

Steps to Reproduce

  1. Log in to Jellyseerr with Jellyfin account.
  2. Observe normal function
  3. Close the app/tab and go about your day. Some time later (Maybe a day? Have not measured this) come back. You're still logged in to the same session.
  4. Trying to Scan or Sync libraries no longer works now. 401 error above is seen in the logs upon attempted sync. This causes further problems like not being able to see the progress of requested titles and anything that depends on library scans.
  5. To fix, log out and back in.

Screenshots

No response

Logs

2024-01-09T02:30:34.835Z [error][Jellyfin API]: Something went wrong while getting libraries from the Jellyfin server: Request failed with status code 401

On Jellyfin side:

[INF] [92] Jellyfin.Api.Auth.CustomAuthenticationHandler: "CustomAuthentication" was not authenticated. Failure message: "Invalid token."

Platform

desktop

Device

Desktop and phone alike

Operating System

Arch linux and Android 13

Browser

Chrome

Additional Context

No response

Code of Conduct

Fallenbagel commented 9 months ago

So whats the issue? Your auth token will get refreshed when you log out and log back in.

pilipovicn commented 9 months ago

As you stated on discord, yes this does sound like an issue on Jellyfin side. I will try to see why it's so in the meantime.

However, the problem is that even though the JF token is expired, Jellyseerr session is not.

This way I do not know if I'm on a healthy session, or the internal JF token is expired. Perhaps Jellyseerr should log out on JF token expiration/revocation?

Fallenbagel commented 2 months ago

This is not an issue anymore as auth tokens are not used anymore