Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homeassistant bans ip and API config missmatch: 401 #15595

Closed
ebudalen opened this issue Jul 21, 2018 · 15 comments
Closed

Homeassistant bans ip and API config missmatch: 401 #15595

ebudalen opened this issue Jul 21, 2018 · 15 comments

Comments

@ebudalen
Copy link

Home Assistant release with the issue:

0.74 (also 0.73 and maybe more)

Last working Home Assistant release (if known):

n/a

Operating environment (Hass.io/Docker/Windows/etc.):

HassIO
Component/platform:

Description of problem:

Today suddenly my homeassistant restartet itself all the time, with just some minutes apart.
I also got an ip-ban from 172.30.32.2. (This is from hassio internally?)
When looking at the system log under hass.io tab I see some errors (listed below).

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

http:
  api_password: !secret http_password
  ip_ban_enabled: True
  login_attempts_threshold: 3

Traceback (if applicable):

System log under hass.io tab --> system:

18-07-21 17:43:35 INFO (SyncWorker_4) [hassio.docker.homeassistant] Start homeassistant homeassistant/raspberrypi3-homeassistant with version 0.74.0
18-07-21 17:45:36 INFO (MainThread) [hassio.homeassistant] Detect a running HomeAssistant instance
18-07-21 17:48:25 WARNING (MainThread) [hassio.homeassistant] Home-Assistant API config missmatch: 401
18-07-21 17:48:25 WARNING (MainThread) [hassio.tasks] Watchdog miss API response from Home-Assistant
18-07-21 17:51:41 INFO (SyncWorker_0) [hassio.docker.addon] Start docker addon homeassistant/armhf-addon-samba with version 4.1
18-07-21 17:53:25 WARNING (MainThread) [hassio.homeassistant] Home-Assistant API config missmatch: 401
18-07-21 17:53:25 ERROR (MainThread) [hassio.tasks] Watchdog found a problem with Home-Assistant API!
18-07-21 17:53:25 INFO (SyncWorker_7) [hassio.docker.interface] Stop homeassistant/raspberrypi3-homeassistant docker application
18-07-21 17:53:40 INFO (SyncWorker_7) [hassio.docker.interface] Clean homeassistant/raspberrypi3-homeassistant docker application
18-07-21 17:53:42 INFO (SyncWorker_5) [hassio.docker.homeassistant] Start homeassistant homeassistant/raspberrypi3-homeassistant with version 0.74.0
18-07-21 17:55:43 INFO (MainThread) [hassio.homeassistant] Detect a running HomeAssistant instance

Additional information:
Hope there is an easy solution, since as of now, hassio restart itself every 5 or 10 minutes. Also tried with version 0.73, with the same problem.

@djmixman
Copy link

My system has just started doing this as well...


Jul 21 19:05:54 hassio start-resin-supervisor[1180]: 18-07-21 19:05:54 WARNING (MainThread) [hassio.homeassistant] Home-Assistant API config missmatch: 401
Jul 21 19:05:54 hassio start-resin-supervisor[1180]: 18-07-21 19:05:54 WARNING (MainThread) [hassio.tasks] Watchdog miss API response from Home-Assistant
Jul 21 19:10:54 hassio start-resin-supervisor[1180]: 18-07-21 19:10:54 WARNING (MainThread) [hassio.homeassistant] Home-Assistant API config missmatch: 401
Jul 21 19:10:54 hassio start-resin-supervisor[1180]: 18-07-21 19:10:54 ERROR (MainThread) [hassio.tasks] Watchdog found a problem with Home-Assistant API!
Jul 21 19:10:54 hassio start-resin-supervisor[1180]: 18-07-21 19:10:54 INFO (SyncWorker_10) [hassio.docker.interface] Stop homeassistant/raspberrypi3-homeassistant docker application
Jul 21 19:11:00 hassio start-resin-supervisor[1180]: 18-07-21 19:11:00 INFO (SyncWorker_10) [hassio.docker.interface] Clean homeassistant/raspberrypi3-homeassistant docker application
Jul 21 19:11:03 hassio start-resin-supervisor[1180]: 18-07-21 19:11:03 INFO (SyncWorker_7) [hassio.docker.homeassistant] Start homeassistant homeassistant/raspberrypi3-homeassistant with version 0.74.0
Jul 21 19:13:15 hassio start-resin-supervisor[1180]: 18-07-21 19:13:15 INFO (MainThread) [hassio.homeassistant] Detect a running HomeAssistant instance
Jul 21 19:15:54 hassio start-resin-supervisor[1180]: 18-07-21 19:15:54 WARNING (MainThread) [hassio.homeassistant] Home-Assistant API config missmatch: 401
Jul 21 19:15:54 hassio start-resin-supervisor[1180]: 18-07-21 19:15:54 WARNING (MainThread) [hassio.tasks] Watchdog miss API response from Home-Assistant

@gary-reyes
Copy link

I'm running with hassos. Seeing exact same problem with reboots, invalid login ip and messages. I thought it was a problem with 0.74 but also seeing with 0.73

@tyborall
Copy link

I can confirm. I have the same issues on HassOS 1.7 with Supervisor 117 and Home Assistant 0.74.0.

@gary-reyes
Copy link

This is interesting https://community.home-assistant.io/t/after-update-to-0-60-1-home-assistant-gets-stuck/38377

Might explain the restart.

Also all my addons for hassio are stopped and not set to start at boot. The only one that runs still is duckdns

@ebudalen
Copy link
Author

Seems like adding the ip to config trusted networks solves the problem. So seems like hassio banned itself, so the watchdog signal got banned and the system restartet since the signal didn't get through.

@tyborall
Copy link

I can confirm this. Either setting ip_ban_enabled to false or, if enabled, setting trusted networks to 172.16.0.0/12 fixed it.

My http config now looks this:

api_password: !secret api_password
trusted_proxies: 172.16.0.0/12
trusted_networks: 172.16.0.0/12
use_x_forwarded_for: true
ip_ban_enabled: true
login_attempts_threshold: 3

But is this really safe or will this give access to unauthorized users?

@gary-reyes
Copy link

Adding to truered networks stops the reboot. Thank you fir figuring it out.

The explanation seems like it makes sense.

What is true troubling is why this was a problem in the first case.

Things we know:

  • 4 people have issue. Not a one time thing
  • All had hassio
  • Affects hassos and resinos variants
  • Not version specific. 0.73 was working until just recently

All this points to something dealing with time. What did all people have in common that changed that didn't necessarily require an update to ha? The ip was an internal one. Does this mean there was a recent update to an addon, the hypervisor, etc?

@jojoro1
Copy link

jojoro1 commented Jul 22, 2018

I can confirm the same issue.
Also I get some errors in system.log:

18-07-22 05:20:02 WARNING (MainThread) [hassio.homeassistant] Home-Assistant API config missmatch: 403
18-07-22 05:20:02 WARNING (MainThread) [hassio.tasks] Watchdog miss API response from Home-Assistant
18-07-22 05:25:02 WARNING (MainThread) [hassio.homeassistant] Home-Assistant API config missmatch: 403
18-07-22 05:25:02 ERROR (MainThread) [hassio.tasks] Watchdog found a problem with Home-Assistant API!
18-07-22 05:25:02 INFO (SyncWorker_16) [hassio.docker.interface] Stop homeassistant/raspberrypi3-homeassistant docker application
18-07-22 05:25:08 INFO (SyncWorker_16) [hassio.docker.interface] Clean homeassistant/raspberrypi3-homeassistant docker application
18-07-22 05:25:10 INFO (SyncWorker_0) [hassio.docker.homeassistant] Start homeassistant homeassistant/raspberrypi3-homeassistant with version 0.74.0

@gary-reyes
Copy link

This is a hassio issue that has been fixed and looks like it will go in version 119
See
home-assistant/supervisor@5db798b

https://github.com/home-assistant/hassio/commits/dev

Found this via https://community.home-assistant.io/t/community-hass-io-add-on-node-red/55023/73

@gary-reyes
Copy link

More info: the bug fixed was introduced with 117 which was released on July 20, 2018, Friday. This might explain the sudden timing.

@JesseWebDotCom
Copy link
Contributor

I have the same issue using HA 0.75.1, Hassio 123, HassOS 1.8

@awarecan
Copy link
Contributor

awarecan commented Aug 5, 2018

@JesseWebDotCom could you please open a new issue? This issue has been fixed, yours may be unrelated although the error message may be similar.

@awarecan awarecan closed this as completed Aug 5, 2018
@digidude
Copy link

digidude commented Aug 7, 2018

I was having this problem in 0.75.2

I had left my MQTT config settings in my configuration.yaml but had not yet reinstalled the mqtt add-on. Commenting out the config settings cleared up my 401 errors.

WARNING (MainThread) [hassio.homeassistant] Home-Assistant API config missmatch: 401
WARNING (MainThread) [hassio.tasks] Watchdog miss API response from Home-Assistant

@Mongjohn
Copy link

Mongjohn commented Aug 7, 2018

Trying to set up Hass.io properly, I am still seeing this exact issue on 0.75.2 / 123 / 1.7 + 1.9.

My configuration.yaml is a copy of an existing Home Assistant instance, so, like digidude, I had MQTT enabled among a lot of other things. However, commenting out MQTT has not resolved the issue.

I am currently commenting out components one by one to see what's causing the issue...

@awarecan
Copy link
Contributor

awarecan commented Aug 7, 2018

Please either open a new issue, or follow up with #15873 (it is similar issue on 0.75.2 hassio).

Again, issue reported in this thread already been fixed, What ever issue 0.75.2 may have is different one.

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Aug 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants