Mobile phone app (HA Companion) causes: WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from localhost (127.0.0.1) constantly

Setup:

My Home Assistant is a VirtualBox VM that is behind an nginx reverse proxy which can be reached at: https://subdomain.mydomain.com from all my HA mobile apps and web browsers. When logging in for the first time… they automatically switch over to accessing Home Assistant via my Nabu Casa URL (since I’m also subscribed and logged in to Nabu Casa).

Issue:
All my mobile phones with HA Companion and PCs don’t have any issues, except for 1 offending mobile phone/app which triggers the below Log warnings constantly; as well as simultaneously triggering the below Notification and respective abnormal/weird Refresh Token:

Home Assistant log warnings:

2022-07-15 20:57:15 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection] [139966346417440] Disconnected: Did not receive auth message within 10 seconds
2022-07-15 20:57:16 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from localhost (127.0.0.1). (Home Assistant/2022.6.0-2398 (Android 12; SM-G781V))
2022-07-15 20:57:16 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from localhost (127.0.0.1). (Home Assistant/2022.6.0-2398 (Android 12; SM-G781V))
2022-07-15 20:57:16 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from localhost (127.0.0.1). (Home Assistant/2022.6.0-2398 (Android 12; SM-G781V))
2022-07-15 20:57:26 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from localhost (127.0.0.1). (Home Assistant/2022.6.0-2398 (Android 12; SM-G781V))
2022-07-15 20:57:26 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from localhost (127.0.0.1). (Home Assistant/2022.6.0-2398 (Android 12; SM-G781V))

Notification:

Login attempt failed:
Login attempt or request with invalid authentication from localhost (127.0.0.1). See the log for details.

Refresh Token: (abnormal/weird)

Refresh token for https://home-assistant.io/android
Created yesterday
Last used 24 minutes ago from 192.168.1.1

.
All other Refresh tokens: (normal)

Refresh token for https://subdomain.mydomain.com/
Created yesterday
Last used 33 minutes ago from 192.168.1.1

To make things more puzzling. I can actually make this issue move to another perfectly working mobile phone/app by deleting their respective Refresh Tokens (abnormal and normal) and logging out… then… whichever device logs in to HA first will inherit this issue with all the respective symptoms.

How is it possible for the issue to move to a different device app by simply deleting their respective refresh tokens and changing the order in which they first log in? I’m not even sure how to troubleshoot something like this. Does anyone know what’s causing this; and, how to get rid of this issue once in for all?

PS: Is it possible that Nabu Casa is indirectly causing this issue? I know that I don’t even need to log in to Nabu Casa from my HA Companion app if I already have direct remote access to my HA via DDNS + my Nginx reverse proxy. In fact, I wanted to stop using Nabu Casa entirely… however, I’m worried that would break the ability for my Alexa devices to utilize my HA entities and scripts. BTW: I’m not sure if this is relevant… If I use a regular web browser to directly go to my Nabu Casa URL https://xxxxxxxxxxxxxxxxxxxxxxxxxx.ui.nabu.casa, it says “Login aborted: Your computer is not allowed”. Is that normal?

2 Likes

Hey,

Have you managed to sort this? I’m getting the exact same issues.

Jarrod.

2 Likes

Hey Jarrod. Yes I was able to resolve this. However, I never figured out what specifically was causing this issue except that it had to do with Nabu Casa remote access and my mobile devices trying to access my Home Assistant.

Since I already had my Home Assistant Instance remotely accessible via DDNS, I disabled Nabu Casa Remote access in the Nabu Casa settings. Then, switched all my Home Assistant mobile devices (that have Android Home Assistant Companion installed) from using https://xxxxxxxxxxxxxxxxxxxxxxxxxx.ui.nabu.casa to https://hassio.mycustomdomain.com to access Home Assistant.

Anyway, good luck with trying to resolve your issue. Maybe your issue is also related to remotely accessing Home Assistant?

1 Like

Hi mkanet,

No luck, but thanks heaps for the reply. Ive got a feeling it is SSL related, I caught a log on the wife’s iPhone Fail to perform SSL handshake.

Im no networking expert, So I think I’ll write the whole issue up and seek community help…

Thanks again,

Jarrod.

2 Likes

Hello, did you manage to fix the problem? I have the same problem. Same setup on two phones and one throws this error.

Hi Julian,

I did manage to fix this issue, but not the way you may like…
Wife bought a new iPhone 13… fresh install and new device in HA and its worked flawlessly.

Good luck,

Jarrod.

I used to have the issue, then it went away no idea how.

Then I changed phone last month, and it came black.

No idea why :sweat_smile:

I just deleted the private DNS config on my phone just to check.