Yatse can't connect to Jellyfin Nightly (built from source)

Issue description: I sent you an email concerning this and till this day I got no response, so I’m trying to get one here. When trying to connect to Jellyfin built from source Yatse says: “Unable to get server version”. I’m using Jellyfin version 10.6.0 unknown (that’s what the Dashboard says) on Windows 10 x64. I’m using Yatse 10.2.5/3110804-arm64-v8a with license.

Additional information: I have found one (I think) similar problem happening with jellyfin-mpv-shim, see: #63

I’m using direct LAN IP: 192.168.100.xxx

Is this something that can be solved?

Without the mandatory logs there’s nothing I can tell :wink:

And no sorry I never received any logs or mail regarding your issue.

Oh, damn, sorry. Here is the log: debug-20200531_022953.zip (2.6 KB)

To add more info: I can enter the server from Firefox (on the phone, of course).

Well yes they broke their internals :frowning:

[228] GET
2020-05-31 02:29:45.000 Verbose/JellyfinLogger: <-- [228] 500 Internal Server Error (19ms, unknown-length body)
2020-05-31 02:29:45.001 Verbose/JellyfinLogger: <-- [228] Access token is required. 

@anthonylavado is this a known error? Returning error 500 for auth issues is wrong as it’s a generic error and no one can renew tokens from that.

Passing this around internally. Is there a reason for the double slash here?

Probably because you now normalize the path and return “/” as a sub directory in the discovery packet :slight_smile:

Will look and try to remove on my side but this never have generated issues before.

Passing thru to say that this problem doesn’t happen with Jellyfin 10.5.5.

Yes it’s an bug or wrong internal change they made on Jellyfin side.

The error should be 401 so that Yatse or any other remote renew token. No one on error 500 will parse the message to try to see if it talks about token and renew or add the token at that time.

@1024mb how old was your build ?

Wonder if https://github.com/jellyfin/jellyfin/commit/3bc07e7c56880de8b75cbd36c79deff6decf8e77 did fix your issue, else @anthonylavado there’s some other place where the same kind of fix will be necessary.

@Tolriq If I remember correctly when I tested and created this topic my build didn’t have more than 2 days old and according to that commit date it would have been already included.

I have built Jellyfin today and tested Yatse with it and it could connect to the server, but I suppose that is happening because I have been previously authenticated to the server already, right? I should delete the server from Yatse and add it again?

Yes starting fresh is a better way to know.

I deleted all data on Yatse and started the app. I got the same error as before. This time I’ve checked the Jellyfin logs and found this:

[2020-06-09 16:03:03.082 -05:00] [ERR] [12] Emby.Server.Implementations.HttpServer.HttpListenerHost: Could not find handler for "/emby"
[2020-06-09 16:03:03.083 -05:00] [ERR] [12] Emby.Server.Implementations.HttpServer.HttpListenerHost: Error processing request: "Unable to find the specified file". URL: ""
[2020-06-09 16:03:03.152 -05:00] [ERR] [38] Emby.Server.Implementations.HttpServer.HttpListenerHost: Error processing request. URL: ""
System.Security.Authentication.AuthenticationException: Access token is required.
   at Emby.Server.Implementations.HttpServer.Security.AuthService.ValidateSecurityToken(IRequest request, String token) in C:\Users\angel\jellyfin\Emby.Server.Implementations\HttpServer\Security\AuthService.cs:line 219
   at Emby.Server.Implementations.HttpServer.Security.AuthService.ValidateUser(IRequest request, IAuthenticationAttributes authAttribtues) in C:\Users\angel\jellyfin\Emby.Server.Implementations\HttpServer\Security\AuthService.cs:line 60
   at Emby.Server.Implementations.HttpServer.Security.AuthService.Authenticate(IRequest request, IAuthenticationAttributes authAttribtues) in C:\Users\angel\jellyfin\Emby.Server.Implementations\HttpServer\Security\AuthService.cs:line 43
   at MediaBrowser.Controller.Net.AuthenticatedAttribute.RequestFilter(IRequest request, HttpResponse response, Object requestDto) in C:\Users\angel\jellyfin\MediaBrowser.Controller\Net\AuthenticatedAttribute.cs:line 39
   at Emby.Server.Implementations.HttpServer.HttpListenerHost.ApplyRequestFilters(IRequest req, HttpResponse res, Object requestDto) in C:\Users\angel\jellyfin\Emby.Server.Implementations\HttpServer\HttpListenerHost.cs:line 146
   at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost httpHost, IRequest httpReq, HttpResponse httpRes, ILogger logger, CancellationToken cancellationToken) in C:\Users\angel\jellyfin\Emby.Server.Implementations\Services\ServiceHandler.cs:line 80
   at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IHttpRequest httpReq, String urlString, String host, String localPath, CancellationToken cancellationToken) in C:\Users\angel\jellyfin\Emby.Server.Implementations\HttpServer\HttpListenerHost.cs:line 488

Yes same as before @anthonylavado needs to find the one who made the change and fix to the proper missing place on Jellyfin.

AuthenticationException must return error 401 not 500.

I have not found a public issue on Jellyfin tracker so no idea what is going on their side. Nothing actionable on Yatse side.

We’ll look at it. 10.6 isn’t releasing yet as it is.

I can’t really comment because I’m not close to the server code, but I’m getting those who are to look into it. Looks like 500 was an old Emby fallback. We formatted it nicer, but it’s still there: https://github.com/jellyfin/jellyfin/blame/998d5674a2bf82c6f83b566a2acfd8aadad59ab9/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs#L198-L212


There was a change in auth error to be more precise and AuthException now.

Some part of the code do not know about it and so do not properly handle it now :frowning:

https://github.com/jellyfin/jellyfin/commit/3bc07e7c56880de8b75cbd36c79deff6decf8e77 have fixed one case for example. I’m pretty sure it’s just a matter of finding the other places that catches SecurityException but not AuthenticationException

@1024mb does this fix your issue so I can close here?

Sorry for the late response, I’ve built Jellyfin right now and tested it. That fixed the authentication problem, I can now use Yatse with Jellyfin 10.6.0.