giejay / Immich-Android-TV

An Android TV app for the self hosted photos and videos backup solution.
GNU General Public License v3.0
208 stars 9 forks source link

[BUG] Cannot login to my Immich server #4

Closed andrzej-r closed 8 months ago

andrzej-r commented 8 months ago

Describe the bug "Please enter a valid host name and API key." after providing both. I tried both external https reverse proxy and http://ip:3001 addresses. Triple checked the API key, although entering it by hand is not ideal.

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

My setup (please complete the following information):

giejay commented 8 months ago

The demo mode does work for you? The only check thats being done, is the hostname, whether it's a valid url. I will release a new version which specifies which part of the input is invalid.

orsa86 commented 8 months ago

I've same issue. Double checked API key and tried different formats for hostname, but nothing worked. What should be valid format for hostname? I presume http://ip_address:port. The demo mode is working OK for me.

andrzej-r commented 8 months ago

Demo mode works fine here.

Host names I tried were: https://public.domain.name (served via a Caddy reverse proxy) http://192.168.1.2:3001

Both are accessible via a browser or the Android Immich app.

OGTK423 commented 8 months ago

I am currently experiencing a similar issue on a Shield TV Pro (2019). I have correctly entered my host URL (including HTTP and port) as well as the API key (which I have confirmed to be entered accurately) and get presented with a "Could not fetch items! Status code: 401" error.

I am able to access the library without issue on both web and Android and able to access the test instance on the Android TV app.

giejay commented 8 months ago

It might be an issue with the API key not being saved in the description/input field correctly. I was able to reproduce it, highlighting the field again and pressing enter/ok will save it. I will try to fix it properly but for now, I adjusted the error message to reflect these steps.

OGTK423 commented 8 months ago

It might be an issue with the API key not being saved in the description/input field correctly. I was able to reproduce it, highlighting the field again and pressing enter/ok will save it. I will try to fix it properly but for now, I adjusted the error message to reflect these steps.

I'm thinking that's the issue as I was able to get it to work shortly after posting but before any update was pushed.

andrzej-r commented 8 months ago

I've upgraded the app to version 1.18.1 - it was indeed complaining about the hostname. I was able to "fix" it by selecting the field with my remote and pressing a "back" button on it.

So, the problem was with entering the hostname via an attached keyboard. Pressing "enter" does not register the text typed into the field. However, I am unable to use just the remote itself - I can navigate the field with left/right/back buttons but there is no way to enter the text with the remote (no virtual keyboard available).

I tried following the same method for typing the API key (first with the attached keyboard, then register it with the remote) but the result is always the same: 401 error when accessing photos or albums and no content visible. I used a freshly generated API key of a new user added to Immich.

giejay commented 8 months ago

If you don't see a message: enter an API key, that means your API key is valid or at least saved correctly.

I suggest to use the Google TV or Android TV app on your phone to enter the API key, then you can copy it, instead of typing it.

On Tue, Jan 30, 2024, 11:57 Andrzej @.***> wrote:

I've upgraded the app to version 1.18.1 - it was indeed complaining about the hostname. I was able to "fix" it by selecting the field with my remote and pressing a "back" button on it.

So, the problem was with entering the hostname via an attached keyboard. Pressing "enter" does not register the text typed into the field. However, I am unable to use just the remote itself - I can navigate the field with left/right/back buttons but there is no way to enter the text with the remote (no virtual keyboard available).

I tried following the same method for typing the API key (first with the attached keyboard, then register it with the remote) but the result is always the same: 401 error when accessing photos or albums and no content visible. I used a freshly generated API key of a new user added to Immich.

— Reply to this email directly, view it on GitHub https://github.com/giejay/Immich-Android-TV/issues/4#issuecomment-1916589735, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPLZJLOI2TG5EB7YMOAKMTYRDG2LAVCNFSM6AAAAABCP4L5NCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJWGU4DSNZTGU . You are receiving this because you commented.Message ID: @.***>

andrzej-r commented 8 months ago

Copying a newly generated API key from a browser worked, so it was either a typo (very likely, despite me checking it several times) or, like with the hostname, it had something to do with me using an attached physical keyboard.

The overall experience of logging in could be improved.

Closing this ticket as the issue I reported is now solved.

giejay commented 8 months ago

Nice! FYI, I found a way to always save the input succesfully, also when hardware keyboards are used. Will be available in the next release.