Yatse/Jellyfin - Spamming authentications

Issue description:
Yatse spams Jellyfin with authentication requests (around 2/second) which significantly degrades Jellyfin performance for other devices.

Logs:
Here’s the app log: debug-20210318_103100.zip (38.8 KB)
Here’s some of the logs from Jellyfin: jellyfin.log (3.0 KB)

Screenshots:
This screenshot shows at the bottom the initial authentication request, and then following a number of the subsequent authentication requests sent by Yatse very frequently

I appreciate the work that goes into this. Hope this can be resolved!

There’s an issue with your Jellyfin that actually does not answer back to auth

2021-03-18 10:30:38.484 Error/JellyfinLogger: Error during auth
java.net.SocketTimeoutException: timeout

What version of Jellyfin do you use? Do you use some special reverse proxy / application firewal / ???

I’m on Jellyfin 10.6.4. My connection is proxied since I can’t portforward currently, but there’s no firewall on that (it just tunnels the traffic directly)

On the Yatse app, it doesn’t show as disconnected/unauthorized and it does sync fine despite this

The issue occurs on the download service, you have some automatic downloads that can’t authenticate. And Yatse will probably fails too when your token expires.

HTTP Response 200 to 10.99.0.1. Time (slow): 0:00:20.9622567. http://redacted/Users/AuthenticateByName
HTTP Response 200 to 10.99.0.1. Time (slow): 0:00:16.8764597. http://redacted/Users/AuthenticateByName

Your Jellyfin seems to sometimes takes more than 15 or event 20 seconds to authenticate I can probably increase the timeout value but this is insanely slow and probably means there’s something wrong on Jellyfin to trigger such delays.
Not sure the multiple auth are the slowness issue, but the slowness on your server triggers the auth issue for sure.

Edit missed the first one: HTTP Response 500 to 10.99.0.1. Time (slow): 0:00:35.4396935. http://redacted/Users/AuthenticateByName
35 seconds

It’s not always so slow (towards the end of the log are authentications that are happening quick enough to not raise a warning).

Either way, opening Yatse on my phone causes the Jellyfin web client to grind to a halt somehow, but I appreciate that if I’m the only person having this then it’s certainly something to do with my setup.

This log is from the instance of opening Yatse, with no other clients active and DLNA turned off (since that was creating log spam too):
jellyfin.log (12.1 KB)

The first few go through with no warnings

I would need new logs from Yatse, but from previous logs all the auth calls takes more than 10 sec (current timeout).

Downloads always create new sessions to ensure that Emby/Jellyfin side of simultaneous downloads / transcoding are respected.

But yes I’ve never heard of any issue like that before and can’t reproduce either.

Maybe try 10.7 ?

I’ve upgraded to 10.7 now, but same thing.

Pausing downloads does stop it from happening however, and restarting the download it seems to stay fine.

When I paused the downloads, the queue was empty though and after resuming it is still empty, so not sure what’s happened there.

Thanks!

Checking the code and logs there’s a side effect / feature / bug (undecided yet) about downloads.

Even if you have something that triggers downloads, the files are already present so the downloads is skipped but even in that case Yatse start a process to seek for external subs / lyrics in case some where added later, causing the auth and issue here. (Still something wrong about timeouts)

I’ll probably remove that only do the search on first download.

Would still be nice to know what you have configured that triggers downloads of files already present this should not really happen.

Okay, I get that.

I have quite a few songs (1k+ right now), and it’s only a subset that it seems to requeue for download so I’m not sure. Also, the storage usage doesn’t increase from it so it’s not storing duplicates of any.

I can try and fetch more logs or run some sort of debug build at some point if you need, but so long as I know that I can just pause the downloads to stop the authentication spam that is good enough for me.

I’ll add some changes to improve the situation about auth and checking again external files on downloads in beta 2.

And yes Yatse does not downloads duplicates but it should not even try to download the files so I’d love to know more what / how you have configured Yatse for those songs downloads. Smart playlist / playlist / artist or genre smart downloads, manual actions. Anything so I can see why and try to fix even if in the end it does not downloads it’s still unnecessary works and network calls.

Oh yeah, sure. I’m using a smart playlist of all songs that is set to download with Smart Sync I think (the entire playlist is just set to download)

When you open that smart playlist does all the songs have the checkmark for downloaded content ?

Like Foo Fighters- What If I Do [HD]-MTqN6cdsyYw.opus

Ok actually was able to reproduce :slight_smile:

Will include fix in beta 2, this will reduce a lot the requests on your server when Yatse update the smart sync. This was the probable cause of the server slowness that triggered the auth issue that makes a bad spiral.

Nice! Thank you dude :slight_smile:

Do you have a PayPal/XMR address that I can send a donation to? I don’t like sending money through Google so much…

I do have an old private paypal address if you really insist but don’t worry no need to, Google will reduce it’s commission to 15% in July :slight_smile: