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
71.35k stars 29.89k forks source link

0.113 stuck "Home Assistant is starting up" #38088

Closed robyevolution closed 4 years ago

robyevolution commented 4 years ago

The problem

After updating to the latest version, home assistant gets stuck in: Home Assistant is starting up, not everything will be available until it has completed booting. I have a NUC so it starts fairly quickly but after waiting half an hour it always remains blocked, the frontend loads but the template sensors and automations do not load, returning to 112.5 everything works correctly. How can I solve it?

Environment Home Assistant Core release with the issue: 0.113 Last working Home Assistant Core release (if known): 0.112.5 Operating environment (OS/Container/Supervised/Core): Core Integration causing this issue: ALL Link to integration documentation on our website: ALL

sagitt commented 4 years ago

same issue. tested anything..... removing custom components removing hue integration creating new 0.113 proxmox vm and restoring backup without restore Hass version but onlu addons\config.... nothing.

Sometime i see "automation" platform can't start.....

restoring vm snapshot all works fine.

goldbe4804 commented 4 years ago

believe i have the same kind of problem with a Rpi4 when i try to log into HA name:8123 it can take over 5min's to load and ones it does load if i switch screen ( to hacs, node-red....so on) it can take 5 or so mins for that page to load

schoenof commented 4 years ago

I had the same problem....I disabled the tensorflow stuff and the upgrade to 0.113 finished now....re-enabling tensorflow after 113.0 upgrade results in some errors and hangs the HA startup again....seems there is some issue with 113 and tensorflow

Scialla commented 4 years ago

same problem here. HA core in venv on Raspian buster and python 3.7.5. On start get stuck and lost possibility to restart or shutdown HA from webgui. Lost all template sensor, announce don't work, some automation don't work. logger, at debug, don't report anything wrong, no error, no warning.

For template sensor, state is unknow but, if i put template in jinjia model, returns correct value

i don't use tensorflow

Rollback to 0.112.5 resolve and all work fine

caimale78 commented 4 years ago

Same problem for me,Nuc

maxcanna commented 4 years ago

same here on HA core on docker

nicx commented 4 years ago

+1

blackscreener commented 4 years ago

Maybe bad config. It was nmap config for me.

sagitt commented 4 years ago

Maybe bad config. It was nmap config for me.

Well, bad config.. how check what config? I have 50 packages, over 200 automations ...

Scialla commented 4 years ago

Maybe bad config. It was nmap config for me.

Config work well with 0.112.5

No error in log (debug) in 0.113

blackscreener commented 4 years ago

Maybe bad config. It was nmap config for me.

Well, bad config.. how check what config? I have 50 packages, over 200 automations ...

How long HA turn on? With my bad nmap config (too much IPs scan) it turns on few minutes on 112.4, with 0.113 it never starts... With proper nmap config it is lightning fast.

robyevolution commented 4 years ago

i removed nmap from my configuration but the problem persists

dshokouhi commented 4 years ago

Are you guys all using tensorflow? I think there is an issue with tensorflow and docker installations including HassOS and core.

maxcanna commented 4 years ago

@dshokouhi no, not at all. I'm not using TF but I got the starting up message

dshokouhi commented 4 years ago

and you guys checked the logs for HA? tried turning on debug logging to see what other issue there might be?

maxcanna commented 4 years ago

I think problem is related to template evaluation since template sensors don't work and template triggers don't start automations

dshokouhi commented 4 years ago

There should be logs suggesting that. Especially if HA is not starting up you should see something.

maxcanna commented 4 years ago

As stated above by other users:

No error in log (debug) in 0.113

robyevolution commented 4 years ago

I have removed all the integrations and now it seems to work, the integrations that I have not reinstalled are: transmission, fritzboxtools, onvif camera

sagitt commented 4 years ago

I have removed all the integrations and now it seems to work, the integrations that I have not reinstalled are: transmission, fritzboxtools, onvif camera

I have onvif and fritz tools. I’ll try

robyevolution commented 4 years ago

i removed fritzbox tool from yaml configuration and added via integration and it works, i think it is an onvif or transmission problem

edit: now i reinstalled transmission and it works, i think the problem is the onvif integration

Scialla commented 4 years ago

i don't have onvif integration... no transmission, no fritz. Tried to reinstall 0.113 and same problem, template sensor don't work, template trigger don't work, restart and shutdown from webgui don't work. Probably there will be some other problem but i'm back to 112.5 again

robyevolution commented 4 years ago

try to uninstall all the integrations and restart HA, if it starts normally try to reinstall the integrations one by one, restarting each time until it crashes, once it crashes try to remove the last integration and restart. I solved it like this

bdraco commented 4 years ago

Since this problem is being caused by specific integrations, it would be helpful to open an issue for each integration that is causing the issue with your specific configuration.

Scialla commented 4 years ago

but there are non problem with the integration, template sensor are not related to them..

dshokouhi commented 4 years ago

Can you post an example of a template sensor that is no longer working?

maxcanna commented 4 years ago

Exactly. I don't think it's caused or related to any integration. Several integrations have been listed here but there's no common subset so it is not an integration. Automation is not an integration, sensors are not integration either.

maxcanna commented 4 years ago

@dshokouhi if you create an automation with a trigger like this

{{ state_attr('sun.sun', 'azimuth') > 250 }}

it won't start. If you evaluate the same condition in the dev tools it gives True. I think this is related to the problem of the template sensors. As if there's something wrong with the template evaluation

Scialla commented 4 years ago

tried to install 0.113.0b0 same problem

all this template sensor don't work anymore in HA 0.113:

  - platform: template
    sensors:
      air_quality:
        friendly_name: "Air Quality"
        value_template: "{{ state_attr('air_quality.air_quality_sensor_3c26cf', 'air_quality_text') }}"

  - platform: template
    sensors:
      temperatura_ingresso:
        friendly_name: "Temperatura Ingresso"
        value_template: "{{ state_attr('climate.netatmo_ingresso', 'current_temperature') }}"
        unit_of_measurement: '°C'
      temperatura_cucina:
        friendly_name: "Temperatura Cucina"
        value_template: "{{ state_attr('climate.netatmo_cucina', 'current_temperature') }}"
        unit_of_measurement: '°C'
      temperatura_esterna:
        friendly_name: "Temperatura Esterna"
        value_template: "{{ state_attr('weather.casa', 'temperature') }}"
        unit_of_measurement: '°C'
      umidita_esterna:
        friendly_name: "Umidità Esterna"
        value_template: "{{ state_attr('weather.casa', 'humidity') }}"      
        unit_of_measurement: '%'

These are some in lovelace: Schermata 2020-07-23 alle 19 34 32

Same template sensor in jinja return correct temperature: Schermata 2020-07-23 alle 19 36 25

Same sensor in State return unknown: Schermata 2020-07-23 alle 19 38 10

Scialla commented 4 years ago

For example, this automation don't work anymore on 0.113: automation:

  - alias: Apertura CONTATTI e reset
    trigger:
    - platform: state
      entity_id: group.contatti_magnetici
      to: 'on'
      for:
        seconds: 3
    condition: []
    action:
      service: mqtt.publish
      data:
        topic: tele/SonoffBridge/RESULT
        payload: '{"RfReceived":{"Data":"key_clean"}}'
        retain: false
contatti_magnetici:
  name: Contatti magnetici
  entities:
    - binary_sensor.pir_ingresso
    - binary_sensor.pir_studio
    - binary_sensor.box_davide
    - binary_sensor.box_giovanna
    - binary_sensor.cantina_grande
    - binary_sensor.cantina_piccola
    - binary_sensor.camera_letto
    - binary_sensor.cucina
    - binary_sensor.ingresso
    - binary_sensor.studio
    - binary_sensor.telecomando_a
    - binary_sensor.telecomando_b
    - binary_sensor.telecomando_c
    - binary_sensor.telecomando_d
    - binary_sensor.porta_casa

Config of first binary sensor (all are similar):

- platform: mqtt
  name: "PIR Ingresso"  
  payload_on: "on"
  payload_off: "off"
  device_class: opening
  state_topic: "tele/SonoffBridge/RESULT"
  value_template: >
    {% if value_json['RfReceived'].Data == 'EC1DEE' %}
      on
    {% elif value_json['RfReceived'].Data == 'key_clean' %}
      off
    {% else %}
      {{ states('binary_sensor.pir_ingresso') }}
    {% endif %} 

i think problems are related to value_template

jspanitz commented 4 years ago

Similar issue here. RP 3B+ HA reports "Home Assistant is starting, not everything will be available yet"

Tried a restart and forcing the upgrade again. Made sure HACS is updated to latest version as well. Have ConBee II removed from PI for other reasons, so safe to ignore those errors. Physically removed and added aotec and conbee ii, with no luck.

Logs: https://pastebin.com/nh2LDPJB 3

https://www.reddit.com/r/homeassistant/comments/hwihb0/0113_upgrade_completed_successfully_ha_fails_to/

AdighaLogic commented 4 years ago

For example, this automation don't work anymore on 0.113: automation:

  - alias: Apertura CONTATTI e reset
    trigger:
    - platform: state
      entity_id: group.contatti_magnetici
      to: 'on'
      for:
        seconds: 3
    condition: []
    action:
      service: mqtt.publish
      data:
        topic: tele/SonoffBridge/RESULT
        payload: '{"RfReceived":{"Data":"key_clean"}}'
        retain: false
contatti_magnetici:
  name: Contatti magnetici
  entities:
    - binary_sensor.pir_ingresso
    - binary_sensor.pir_studio
    - binary_sensor.box_davide
    - binary_sensor.box_giovanna
    - binary_sensor.cantina_grande
    - binary_sensor.cantina_piccola
    - binary_sensor.camera_letto
    - binary_sensor.cucina
    - binary_sensor.ingresso
    - binary_sensor.studio
    - binary_sensor.telecomando_a
    - binary_sensor.telecomando_b
    - binary_sensor.telecomando_c
    - binary_sensor.telecomando_d
    - binary_sensor.porta_casa

Config of first binary sensor (all are similar):

- platform: mqtt
  name: "PIR Ingresso"  
  payload_on: "on"
  payload_off: "off"
  device_class: opening
  state_topic: "tele/SonoffBridge/RESULT"
  value_template: >
    {% if value_json['RfReceived'].Data == 'EC1DEE' %}
      on
    {% elif value_json['RfReceived'].Data == 'key_clean' %}
      off
    {% else %}
      {{ states('binary_sensor.pir_ingresso') }}
    {% endif %} 

i think problem are related to value_template

I believe group is deprecated. I had to get rid of my groups.

maxcanna commented 4 years ago

I don't use any group but I have exactly the same behavior and problems

Scialla commented 4 years ago

I believe group is deprecated. I had to get rid of my groups.

Deprecated but in 112.5 work fine, in 113 was removed?

i don't see this in breaking changes.. i don't have error in log

in any case, sensors with value_template don't work, like automation

bdraco commented 4 years ago

Try setting logger to debug and restarting.

If you see any messages about entity extraction failing, please post

maxcanna commented 4 years ago

He already tried that https://github.com/home-assistant/core/issues/38088#issuecomment-663007452

bdraco commented 4 years ago

@AdighaLogic Did you get past the not starting up issue? Are your sensors changing state ?

I setup a similar automation to test this, and everything is working as expected for me.

automation:

- id: '1595532224502'
  alias: group.family_motion_sensors
  description: ''
  trigger:
  - entity_id: group.family_motion_sensors
    for: 00:00:03
    platform: state
    to: 'on'
  condition: []
  action:
  - data: {}
    entity_id: light.family_room_lights
    service: light.turn_on
  mode: single

group:

Family Motion Sensors:
  name: "Family Motion Sensors"
  entities:
    - binary_sensor.family_room_1_sensor
    - binary_sensor.family_room_2_sensor
Scialla commented 4 years ago

Try setting logger to debug and restarting.

If you see any messages about entity extraction failing, please post

retried, entire log at debug; grep fail, no reply.

For example, for sensor.temperatura_esterna this is log at debug:

Jul 23 21:39:29 raspberrypi hass[5192]: 2020-07-23 21:39:29 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.temperatura_esterna, old_state=None, new_state=<state sensor.temperatura_esterna=unknown; unit_of_measurement=°C, friendly_name=Temperatura Esterna @ 2020-07-23T21:39:29.178996+02:00>>

No error, no failing, temperature is unknown . in 112.5 work fine

divanikus commented 4 years ago

Same problem here. Forever "HA is starting up". Tried to comment out all my template sensors, no luck, still stucks on starting up. No descriptive error in the logs. Template sensors are also in unknown state.

robyevolution commented 4 years ago

I solved it by disabling all the integrations and adding them again, maybe some integration looped some process. I have not modified any other sensor

Stewie3112 commented 4 years ago

same here. Deleting onvif integrations solved the problem. How to solve this issue retaining the integration?

EDIT: adding back the same cameras solved the issue

jspanitz commented 4 years ago

Downgrading back to .112.5 results in everything working again for me

divanikus commented 4 years ago

Gave up and reverted back to .112.4. Tried to remove HACS, all custom_components, ghost entries from registry. Nothing. Simply stucks in starting up, template sensors are in unknown state and automations do not work.

Logs are clueless, even in DEBUG. Everything kind of works, but it's not, no ERRORs, may be a couple of warnings.

bdraco commented 4 years ago

@dshokouhi if you create an automation with a trigger like this

{{ state_attr('sun.sun', 'azimuth') > 250 }}

it won't start. If you evaluate the same condition in the dev tools it gives True. I think this is related to the problem of the template sensors. As if there's something wrong with the template evaluation

When you say it won't start, do you mean that Home Assistant won't startup, or the automation won't run?

As long as home assistant is still in the startup phase, automations don't run. The automation engine only kicks in after the started event fires.

snakuzzo commented 4 years ago

it would be useful to know which integrations all of you have removed to solve the problem

maxcanna commented 4 years ago

When you say it won't start, do you mean that Home Assistant won't startup, or the automation won't run?

As long as home assistant is still in the startup phase, automations don't run. The automation engine only kicks in after the started event fires.

I meant that the automation won't run. BTW I confirm what you said. Automations aren't running at all. Even the ones not based on template trigger.

How can we dig into this and find out what is blocking the startup?

bdraco commented 4 years ago

Also check the log for Waiting on integrations to complete setup

jspanitz commented 4 years ago

I have almond, coronavirus, directv, ecobee, hacs, life360, meterologisk, mobile app, national weather service, roku, speedtest, zwave and zigbee via the integrations gui and camera (dlink), media player (emby), remote (broadlink), switch (broadlink) sensor (broadlink) via configuration file.

After I upgraded to .113, I noticed HACS saying it needed to be upgraded, so I attempted it even though .113 was reporting "Home Assistant is starting, not everything will be available yet". The upgrade completed but HA still had the same issue. I forced a .113 reinstall, no luck. I then removed HACS via the recommended process. Still no love. I then reverted and HA was then good. Can't get HACS to reinstall now but that's a different issue. So for me just HACS but it did not solve problem.

maxcanna commented 4 years ago

Also check the log for Waiting on integrations to complete setup

I just restarted the container but I don't have any entry like that in the log

CrossEyeORG commented 4 years ago

I also have been battling this issue since updating HASS to 0.113.0 with "Home Assistant is starting up". All my automations (most apparent being to set the default midnight dark theme) are not working, integrations not starting and such.

So I flipped logger to debug and also did not see any errors but kept seeing INFO messages from ONVIF. So I decided to delete all my cameras listed in ONVIF and the moment I deleted the last camera and ONVIF disappeared in my Integrations tab, automations started (dark theme restored) and now HASS is starting normally even after repeated restarts.