home-assistant / android

:iphone: Home Assistant Companion for Android
https://companion.home-assistant.io/
Apache License 2.0
2.32k stars 648 forks source link

Login attempt failed for old Android 7.1 device #3549

Open felipecrs opened 1 year ago

felipecrs commented 1 year ago

Home Assistant Android app version(s): 2023.3.0-3260

Android version(s): API 25 Android 7.1

Device model(s): LG X100S Flip Phone acquired from AliExpress, manufactured for Korea

Home Assistant version: 2023.5.3

Last working Home Assistant release (if known): N/A

Description of problem, include YAML if issue is related to notifications:

I have several Companion apps connected to my HA instance. But around 6 times by day this specific device keeps throwing Login attempt failed notifications in my Home Assistant, no matter if it's coming from the internal network or external. Everything else works fine, I can open the dashboard, I use the settings tiles, and so on.

Companion App Logs:

To be added.

Screenshot or video of problem:

I don't think it's applicable.

Additional information:

Logger: homeassistant.components.http.ban
Source: components/http/ban.py:82
Integration: HTTP (documentation, issues)
First occurred: 19 de maio de 2023 às 21:48:24 (10 occurrences)
Last logged: 09:33:38

Login attempt or request with invalid authentication from 192.168.1.111 (192.168.1.111). Requested URL: '/api/states/cover.portao_da_garagem_de_baixo'. (Home Assistant/2023.3.0-3260 (Android 7.1.2; LGM-X100S))
Login attempt or request with invalid authentication from 192.168.1.111 (192.168.1.111). Requested URL: '/api/states/cover.portaozinho_da_rua'. (Home Assistant/2023.3.0-3260 (Android 7.1.2; LGM-X100S))
Login attempt or request with invalid authentication from 152-255-107-238.user.vivozap.com.br (152.255.107.238). Requested URL: '/api/states/cover.portaozinho_do_terreiro'. (Home Assistant/2023.3.0-3260 (Android 7.1.2; LGM-X100S))
Login attempt or request with invalid authentication from 152-255-107-238.user.vivozap.com.br (152.255.107.238). Requested URL: '/api/states/cover.portaozinho_da_rua'. (Home Assistant/2023.3.0-3260 (Android 7.1.2; LGM-X100S))
Login attempt or request with invalid authentication from 2804:18:4032:f735:f0d6:1192:963e:f179 (2804:18:4032:f735:f0d6:1192:963e:f179). Requested URL: '/api/states/cover.portao_da_agua'. (Home Assistant/2023.3.0-3260 (Android 7.1.2; LGM-X100S))
jpelgrom commented 1 year ago

Can you get logs from the app? They might provide more details on what is failing.

This error is caused by getting states, probably for a widget or tile, so open the app, get those to update, then get the logs.

felipecrs commented 1 year ago

Will surely do. Thank you!

I'm pretty sure they are caused by the quick settings tiles.

felipecrs commented 1 year ago

In fact I just realized this is the only device in my home which uses quick settings tiles. I'm going to add some quick settings tiles to another phone, just to check if it's indeed only caused by that phone.

felipecrs commented 1 year ago

I was just trying to reproduce the issue here, and I could not. The issue is intermittent: the tiles works and updates correctly most of the times.

For this reason, I was not able to capture any meaningful logs. But when the issue happens again, I'll check the logs and cross check with the time.

felipecrs commented 1 year ago

This problem was happening for the past 2 months, and now it's not happening anymore. I don't know what changed (except that I allowed Home Assitant to ignore battery optimization).

I'm going to close it for now and reopen if necessary.

felipecrs commented 5 months ago

This started happening again. I believe there must be some broken logic on the app for such old Android devices. Maybe it's not renewing the token correctly before trying to authenticate?

Logger: homeassistant.components.http.ban
Source: components/http/ban.py:138
integration: HTTP (documentation, issues)
First occurred: May 20, 2024 at 12:22:38 PM (300 occurrences)
Last logged: May 21, 2024 at 3:09:43 PM

Login attempt or request with invalid authentication from android-5c571107667a6b75.lan (192.168.1.148). Requested URL: '/api/websocket'. (Home Assistant/2024.4.1-12576 (Android 7.1.2; LGM-X100S))