home-assistant / supervisor

:house_with_garden: Home Assistant Supervisor
https://home-assistant.io/hassio/
Apache License 2.0
1.68k stars 610 forks source link

auth failing #1694

Closed tsvi closed 4 years ago

tsvi commented 4 years ago

Home Assistant release with the issue:

arch | aarch64
-- | --
dev | false
docker | true
hassio | true
os_name | Linux
os_version | 4.19.114-v8
python_version | 3.7.7
timezone | Asia/Jerusalem
version | 0.109.2
virtualenv | false

Operating environment (HassOS/Generic):

Supervisor logs:

Description of problem:

  1. In the system log I get the following error once every 5 minutes:

20-05-03 09:23:39 ERROR (MainThread) [supervisor.auth] Can't request auth on Home Assistant!

  1. Every time I login I get the following notification:

Login attempt or request with invalid authentication from 172.30.32.2 (that's the reverse proxy

I have a reverse proxy setup with Nginx Proxy Manager and have the following in my config:

http:
  base_url: !secret hass_uri
  use_x_forwarded_for: true
  trusted_proxies:
  - 172.16.0.0/24
frenck commented 4 years ago

172.16.0.0/24 does not include 172.30.32.2... So the source IP is not visible...

tsvi commented 4 years ago

🤦‍♂️ changed it to 172.16.0.0/12 (the private ip range), but still failing.

frenck commented 4 years ago

Well, the real source IP should now be revealed...? (as in the actual client that the proxy, proxies for).

tsvi commented 4 years ago

It looks according to the timing of the error that it is the supervisor that's trying to access it (error 1 I mentioned in the issue). How is the supervisor supposed to access home assisstant? Is it supposed to have a token that maybe is missing/was deleted? Or maybe I'm supposed to whitelist its IP?

tsvi commented 4 years ago

With the latest release of the supervisor, I managed to discover the culprit as the log now had the following message as well:

20-05-10 05:25:55 INFO (MainThread) [supervisor.auth] Auth request from core_mosquitto for my_user

Took me a few minutes, as MQTT seemed to work fine and my camera which I hooked up via MQTT was passing the data fine. Until o figured it was the zigbee2mqtt add-on I installed, started but never configured.

Once I setup username and password for the core_mosquitto broker, all is fine now.

Thanks,

Tsvi

texanerinbayern commented 3 years ago

Thank you, this was exactly my problem! I had installed zigbee2mqtt and hadn't set it up yet but it seems I had chosen start at reboot and had rebooted. Thank you!