home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.67k stars 30.81k forks source link

Home-Assistant freeze/pause during startup/initialisation #32256

Closed grewhit25 closed 4 years ago

grewhit25 commented 4 years ago

The problem

Home-Assistant (core) will freeze/pause during startup/initialisation under certain conditions.

I raised #30759 to investigate because I was of the opinion the issue was related to my TPLink smartplug being powered off during HA startup but the dev there believe that the underlying issue is not caused by TPLink integration..

The issue manifests itself, in my case, if a previously online TPLink smartplug is then powered off  followed by stopping, removing and restarting the docker container running HA.

During the frozen state, one option is to do a docker restart of the ha-container which causes HA to not freeze at the same point. However, in my case that broke SmartThings integration #30760

I have since discovered that while HA is in the frozen state you can simply power-up the smartplug; once it's back online HA continue its initialisation automatically.

An unusual situation to be in I know. The background is; during the xmas period one smartplug was used to manage some extra lights. Once that was all over the offending smartplug was powered off and left powered off.

I am on HA's Dev channel with auto updates through docker watchtower so this issue was a daily occurrence at one point.

The problem is still evident as of release 106.0 and can easily be recreated using the steps above.

Environment

System Health
arch    armv7l
dev true
docker  true
hassio  false
os_name Linux
python_version  3.7.6
timezone    Europe/London
version 0.107.0.dev20200227
virtualenv  false

Problem-relevant configuration.yaml

Traceback/Error logs

Log snippet. Full log available if required.

(ONE of two SMARTPLUGS IS POWERED OFF)

2020-02-27 08:04:55 INFO (MainThread) [homeassistant.setup] Setting up tplink
2020-02-27 08:04:55 INFO (MainThread) [homeassistant.setup] Setup of domain tplink took 0.0 seconds.
2020-02-27 08:05:03 INFO (MainThread) [homeassistant.components.switch] Setting up switch.tplink
2020-02-27 08:05:13 WARNING (MainThread) [homeassistant.components.switch] Setup of switch platform tplink is taking over 10 seconds.
2020-02-27 08:06:03 ERROR (MainThread) [homeassistant.components.switch] Setup of platform tplink is taking longer than 60 seconds. Startup will proceed without waiting any longer.
2020-02-27 08:06:28 INFO (SyncWorker_15) [homeassistant.components.tts] Create cache dir /tmp/tts.
2020-02-27 08:06:29 INFO (MainThread) [homeassistant.setup] Setup of domain tts took 0.8 seconds.

(2020-02-27 08:06:29 - FROZEN HERE)
(2020-02-27 08:16:40 - SMARTPLUG POWERED UP AND ONLINE 10 minutes later)

2020-02-27 08:16:40 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 708.99s
2020-02-27 08:16:40 INFO (SyncWorker_11) [homeassistant.components.zeroconf] Starting Zeroconf broadcast

Additional information

probot-home-assistant[bot] commented 4 years ago

Hey there @rytilahti, mind taking a look at this issue as its been labeled with a integration (tplink) you are listed as a codeowner for? Thanks!

stale[bot] commented 4 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.