jarnedemeulemeester / findroid

Third-party native Jellyfin Android app
GNU General Public License v3.0
2.61k stars 161 forks source link

Cannot log in when device name is blank #846

Open niravjdn opened 1 month ago

niravjdn commented 1 month ago

Describe the bug I am getting an error while trying to login to jellyfin server 10.9.0 from Findroid on Android 13 Lenovo tablet. It works on my Android 11 Samsung Note 10 but only getting error on Tablet.

To Reproduce Steps to reproduce the behavior:

  1. Enter Server url as 192.168.2.xxx:8096
  2. Enter username and password
  3. Error will be shown

Screenshots https://imgur.com/df0STEg

Device info (please complete the following information):

Logs on Jellyfin Server:

AuthenticateByName.
System.ArgumentException: The value cannot be an empty string. (Parameter 'request.DeviceName')
   at System.ArgumentException.ThrowNullOrEmptyException(String argument, String paramName)
   at System.ArgumentException.ThrowIfNullOrEmpty(String argument, String paramName)
   at Emby.Server.Implementations.Session.SessionManager.AuthenticateNewSessionInternal(AuthenticationRequest request, Boolean enforcePassword)
   at Jellyfin.Api.Controllers.UserController.AuthenticateUserByName(AuthenticateUserByName request)
   at lambda_method1733(Closure, Object)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at
jarnedemeulemeester commented 2 weeks ago

It seems like your device name is an empty string. Please check the name of your device in the settings app and set it to a non empty string.

niravjdn commented 2 weeks ago

image Device name is already set but it does not work. Seems an issue how findroid is reading device name, It might not pick on lenovo tabs.

niravjdn commented 1 week ago

@jarnedemeulemeester Please help

jarnedemeulemeester commented 1 week ago

This is an issue that Lenovo needs to solve. We are using the correct the correct Android API to retrieve the device name. What happens if you change the device name? Do you still get the error?

niravjdn commented 1 week ago

Yes, Even after changing device name I get an error.

niravjdn commented 1 week ago

Can you please tell me where do we try to get device name in code? For my use case, I can compile app locally by hardcoding it or trying to get Bluetooth adapter name.

niravjdn commented 1 week ago

If I use device info app from playstore, It is able to fetch device name.

image

jarnedemeulemeester commented 1 week ago

The device name is read in the Jellyfin Kotlin SDK https://github.com/jellyfin/jellyfin-sdk-kotlin/blob/master/jellyfin-core/src/androidMain/kotlin/org/jellyfin/sdk/android/AndroidDevice.kt#L12

I will try pushing a workaround to the SDK upstream.

niravjdn commented 1 week ago

Thanks. Waiting for fix to be shipped to app 😊

jarnedemeulemeester commented 5 days ago

The fix has been merged upstream! It is expected to ship around the time that Jellyfin 10.10.1 releases