'Login attempt or request with invalid authentication from 127.0.0.1' with Nabu Casa

So from time to time, when launching HA from my phone through the mobile app configured with Nabu Casa, I get a

Login attempt or request with invalid authentication from 127.0.0.1

Although I never get an access denied when accessing HA so I know it’s not a bad password and always seems to happen at the same time as I launch the app.

Anyway I can prevent these? If they were just in the log it wouldn’t bother me but it’s the persistent notification that annoys me.

Thanks.

3 Likes

I’m getting these as well.

I’m seeing these as well every other day.

1 Like

This is a known issue. Please read the Cavaets paragraph chapter here: https://www.nabucasa.com/config/remote/

Thanks for the reply. I have not however configured 127.0.0.1 or ::1 as trusted networks or proxies. Well, not personally at least. Not sure if it’s done by the hassio docker installation. Anyway to check that? Is it a a requirement when running in a docker environment?

Regards,

Sylvain

I’m also getting this and have yet to find a solution:

Here’s the log:

2021-10-28 13:52:55 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from localhost (127.0.0.1). (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36)

Has there been any movement on this?

I got the error today on my desktop (through Nabu Casa remote-connect) but not on the Android app (remote-connect).

The logs say it’s related to ip_ban. I haven’t manually configured “http” in configuration.yaml, and I don’t know how to find what’s overriding the ip_ban default settings. Maybe its related to my AdGuard add-on.

I suspect the root cause is from my phone trying to connect from external networks and my router not forwarding the ip address. I don’t know how many attempts are allowed, but the threshold was probably exceeded.

Rebooting home assistant seems to help sometimes, but not other times. Interestingly, the first time I was able to connect from my PC, most add-ons were not working, including HACS, AdGuard, etc. Everything worked fine on Android but continued to have issues on PC.

I am getting this as well now…

There are many threads in regard to this, and no real solution. This has happened for me from time to time over the last couple of years.

2 Likes

I struggled for ages to work out the solution to the endless “Login attempt or request with invalid authentication from localhost” messages. They seemed to mostly occur when signed into NC, particularly if using a mixture of local and remote access (for example one browser tab accessing via NC and others locally)

I tried rebooting and deleting tokens, reinstalling apps, deleting browser history, site data and cache, logging out of nabu casa, then back in without luck

For a while I fudged it with an automation to dismiss the notifications, but although it worked I was still left with a badge until each browser was refreshed.

The culprit which finally stopped most of them was getting rid of trusted_networks altogether. I removed this from my configuration.yaml:

homeassistant:
  auth_providers:
    - type: trusted_networks
      trusted_networks:
        - 192.168.0.0/24

That solved it for me, in case it helps someone else!