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.79k stars 30.04k forks source link

Recorder fails to load after upgrade to 114 #38897

Closed pieterzen closed 4 years ago

pieterzen commented 4 years ago

The problem

Cannot start HASS because Recorder fails to load after upgrade to 114 (from 113.3):

2020-08-15 09:38:47 WARNING (MainThread) [homeassistant.setup] Setup of recorder is taking over 10 seconds.
2020-08-15 09:39:36 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-08-15 09:40:37 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-08-15 09:41:37 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-08-15 09:42:37 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-08-15 09:43:37 ERROR (MainThread) [homeassistant.setup] Setup of recorder is taking longer than 300 seconds. Startup will proceed without waiting any longer

Update to 114.1 fails reporting 'Error: Unknown Error, see logs' - Nothing in the logs;

Environment

  Provide details about the versions you are using, which helps us to reproduce
  and find the issue quicker. Version information is found in the
  Home Assistant frontend: Developer tools -> Info.
-->

- Home Assistant Core release with the issue: 114.1
- Last working Home Assistant Core release (if known): 113.3 
- Operating environment (OS/Container/Supervised/Core): 
- Integration causing this issue: Recorder
- Link to integration documentation on our website: https://www.home-assistant.io/integrations/recorder/

## Problem-relevant `configuration.yaml`
<!--
  An example configuration that caused the problem for you. Fill this out even
  if it seems unimportant to you. Please be sure to remove personal information
  like passwords, private URLs and other credentials.
-->
hassio:
logbook:
history:
config:
sun:

frontend:
  themes: !include_dir_merge_named themes
lovelace:
  mode: yaml
  #resources: !include config/resources.yaml

vacuum:
- platform: xiaomi_miio
  host: 192.168.1.5
  token: !secret xiaomi_token

device_tracker:
  - platform: asuswrt
    host: 192.168.1.1
    username: mpietersen
    password: !secret http_password
    #verify_ssl: false
    # ssh_key: /config/ssh/ssh_key
    new_device_defaults:
      track_new_devices: true
  # - platform: tado
  #   username: !secret email
  #   password: !secret tado_password
  #   home_id: 178903

speedtestdotnet:
  server_id: 21103
  scan_interval:
    minutes: 15

# 433Mhz RfxCom stuff
rfxtrx:
  device: /dev/ttyUSB0
  devices:
    # Switches
    # Keuken
    0b11002601a898460a000070:
    # Zolder
    0b110040019554fa0b000060:
    # Voorzolder
    0b1100c8019554fa0c000060:
    # Voorzolder 2
    0b1100e00124430602000070:
    # Remote 1_1
    0b1100de0124430601030070:

    # # Lights
    # 0b110003038a426001010f70:
    #   name: "Kamer 1"
    # 0b11001d038a426009010f70:
    #   name: "Kamer 2"
    # 0b11001e038a426005010f70:
    #   name: "Kamer 3"
    # 0b11001f038a42600d010f70:
    #   name: "Kamer 4"
    # 0b110024038a426003030070:
    #   name: "Kamer 5"

    # Covers
    # Woonkamer voor
    071a000000000100:
    # Woonkamer achter
    071a000000000101:
    # Woonkamer
    071a000000000104:
    # Boven voor
    071a000000000200:
    # Boven achter
    071a000000000202:
    # Alex
    071a000000000203:
    # Boven
    071a000000000204:

switch:       
  - platform: flux # Flux for the LIFX bulbs
    lights:
      - light.woonkamer

light:
  - platform: switch
    name: Keuken
    entity_id: switch.ac_1a89846_10
  - platform: switch
    name: Zolder
    entity_id: switch.ac_19554fa
  - platform: switch
    name: Voorzolder
    entity_id: switch.ac_1a89846_10
  - platform: switch
    name: Kerstboom
    #entity_picture: mdi:string-lights #/local/images/string-lights.png
    entity_id: switch.0b1100de0124430601030070

  - platform: group
    name: Woonkamer
    entities:
      - light.tv
      - light.bank
      - light.sta_lamp

weather:
#  - platform: buienradar
#    name: 'Leusden'
#  - platform: openweathermap
#    api_key: !secret openweathermap_apikey
  - platform: darksky
    api_key: !secret darkskies_apikey
    mode: daily

camera:
  platform: generic
  name: Buienradar
  still_image_url: https://api.buienradar.nl/image/1.0/RadarMapNL?w=480&h=480
  content_type: 'image/gif'

influxdb:
  username: homeassistant
  password: !secret password
  database: homeassistant
  include:
    entities:
      - sensor.cresta_temperature
      - sensor.weer_temperature
      - sensor.woonkamer_temperature
      - sensor.temp_diff
      - sensor.sun_azimuth
      - sensor.sun_elevation
      - sensor.speedtest_download
      - sensor.speedtest_upload
      - sensor.lux_sensor_01
      - media_player.sonos_one
      - media_player.tv_ue40es6900
      - sensor.solax_daily_yield
      - sensor.solax_grid_power
      - sensor.solax_pv_power
      - sensor.solax_total_yield
      - sensor.exchange_rate_1_btc
      - sensor.trade_volume
      - sensor.red_charging_rate_power
      - sensor.power_production_w
      - sensor.power_phase_l1_w      
      - sensor.power_phase_l2_w
      - sensor.power_phase_l3_w

# Text to speech
tts:
  - platform: google_translate

# MQTT platform for binary sensor
mqtt:
  password: 12345

###############################################
# Includes
###############################################

# Automations
automation: !include_dir_merge_list automations/
# Recorder
#recorder: !include configuration/recorder.yaml
# Scripts
script: !include configuration/scripts.yaml
# Scenes
scene: !include configuration/scenes.yaml
# Sensors
sensor: !include configuration/sensors.yaml
binary_sensor: !include configuration/binary_sensors.yaml
# Groups
group: !include configuration/groups.yaml
# Switches
input_boolean: !include configuration/input_booleans.yaml
input_number: !include configuration/input_numbers.yaml
input_datetime: !include configuration/input_datetimes.yaml

Traceback/Error logs

2020-08-15 09:53:08 WARNING (MainThread) [homeassistant.setup] Setup of recorder is taking over 10 seconds.
2020-08-15 09:53:57 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-08-15 09:54:57 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-08-15 09:55:57 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-08-15 09:56:58 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-08-15 09:57:58 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-08-15 09:57:58 ERROR (MainThread) [homeassistant.setup] Setup of recorder is taking longer than 300 seconds. Startup will proceed without waiting any longer
2020-08-15 09:58:03 WARNING (MainThread) [homeassistant.components.lovelace] Resources need to be specified in your configuration.yaml. Please see the docs
2020-08-15 09:58:28 ERROR (Thread-3) [root] Uncaught thread exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.8/site-packages/RFXtrx/__init__.py", line 825, in _connect
    self.transport.reset()
  File "/usr/local/lib/python3.8/site-packages/RFXtrx/__init__.py", line 678, in reset
    self.send(b'\x0D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
  File "/usr/local/lib/python3.8/site-packages/RFXtrx/__init__.py", line 674, in send
    self.serial.write(pkt)
AttributeError: 'NoneType' object has no attribute 'write'
2020-08-15 09:58:30 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of logbook. Setup failed for dependencies: recorder
2020-08-15 09:58:30 ERROR (MainThread) [homeassistant.setup] Setup failed for logbook: Could not set up all dependencies.
2020-08-15 09:58:31 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of history. Setup failed for dependencies: recorder
2020-08-15 09:58:31 ERROR (MainThread) [homeassistant.setup] Setup failed for history: Could not set up all dependencies.
2020-08-15 09:58:35 WARNING (MainThread) [homeassistant.config_entries] Config entry for adguard not ready yet. Retrying in 5 seconds
2020-08-15 09:58:36 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry configuration.yaml for mqtt
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 222, in async_setup
    result = await component.async_setup_entry(  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 526, in async_setup_entry
    await hass.data[DATA_MQTT].async_connect()
  File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 743, in async_connect
    self.conf[CONF_BROKER],
KeyError: 'broker'
2020-08-15 09:58:41 WARNING (MainThread) [homeassistant.config_entries] Config entry for sonarr not ready yet. Retrying in 5 seconds
2020-08-15 09:58:41 WARNING (MainThread) [homeassistant.setup] Setup of input_boolean is taking over 10 seconds.
2020-08-15 09:58:42 WARNING (MainThread) [homeassistant.setup] Setup of input_datetime is taking over 10 seconds.
2020-08-15 09:58:42 WARNING (MainThread) [homeassistant.setup] Setup of input_number is taking over 10 seconds.
2020-08-15 09:58:42 WARNING (MainThread) [homeassistant.components.weather] Setup of weather platform darksky is taking over 10 seconds.
2020-08-15 09:58:47 WARNING (SyncWorker_1) [miio.gateway] Unknown subdevice type SubDeviceInfo(sid='u', type_id='n', unknown='k', unknown2='n', fw_ver='o') discovered, of Xiaomi gateway with ip: 192.168.1.5
2020-08-15 09:58:47 WARNING (SyncWorker_1) [miio.gateway] Unknown subdevice type SubDeviceInfo(sid='w', type_id='n', unknown='_', unknown2='m', fw_ver='e') discovered, of Xiaomi gateway with ip: 192.168.1.5
2020-08-15 09:58:47 WARNING (MainThread) [homeassistant.components.switch] Setup of switch platform flux is taking over 10 seconds.
2020-08-15 09:58:47 WARNING (MainThread) [homeassistant.components.binary_sensor] Setup of binary_sensor platform rfxtrx is taking over 10 seconds.
2020-08-15 09:58:47 WARNING (MainThread) [homeassistant.components.switch] Setup of switch platform rfxtrx is taking over 10 seconds.
2020-08-15 09:58:48 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for sonarr_upcoming_media which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-08-15 09:58:48 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for solaxcloud which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-08-15 09:58:48 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Xiaomi Gateway for xiaomi_miio
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 222, in async_setup
    result = await component.async_setup_entry(  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 28, in async_setup_entry
    if not await async_setup_gateway_entry(hass, entry):
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 49, in async_setup_gateway_entry
    if not await gateway.async_connect_gateway(host, token):
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/gateway.py", line 42, in async_connect_gateway
    await self._hass.async_add_executor_job(
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.8/site-packages/miio/gateway.py", line 288, in discover_devices
    dev_info = SubDeviceInfo(*devices_raw[x : x + 5])
TypeError: __init__() missing 1 required positional argument: 'fw_ver'
2020-08-15 09:58:48 WARNING (MainThread) [homeassistant.config_entries] Config entry for adguard not ready yet. Retrying in 10 seconds
2020-08-15 09:58:48 ERROR (MainThread) [homeassistant.setup] Error during setup of component asuswrt
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 191, in _async_setup_component
    result = await task
  File "/usr/src/homeassistant/homeassistant/components/asuswrt/__init__.py", line 69, in async_setup
    conf = config[DOMAIN]
KeyError: 'asuswrt'
2020-08-15 09:58:48 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform asuswrt.device_tracker: Unable to set up component.
2020-08-15 09:58:48 ERROR (MainThread) [homeassistant.components.tesla] Unable to communicate with Tesla API: UNAUTHORIZED
2020-08-15 09:59:03 WARNING (MainThread) [homeassistant.components.vacuum] Setup of vacuum platform xiaomi_miio is taking over 10 seconds.
2020-08-15 09:59:03 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform openweathermap is taking over 10 seconds.
2020-08-15 09:59:03 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform bitcoin is taking over 10 seconds.
2020-08-15 09:59:03 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform darksky is taking over 10 seconds.
2020-08-15 09:59:03 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform systemmonitor is taking over 10 seconds.
2020-08-15 09:59:03 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform sonarr_upcoming_media is taking over 10 seconds.
2020-08-15 09:59:03 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform solaxcloud is taking over 10 seconds.
2020-08-15 09:59:03 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform rfxtrx is taking over 10 seconds.
2020-08-15 09:59:03 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform speedtestdotnet is taking over 10 seconds.
2020-08-15 09:59:03 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform tado is taking over 10 seconds.
2020-08-15 09:59:03 WARNING (MainThread) [homeassistant.components.climate] Setup of climate platform tado is taking over 10 seconds.
2020-08-15 09:59:03 WARNING (MainThread) [homeassistant.components.water_heater] Setup of water_heater platform tado is taking over 10 seconds.
2020-08-15 09:59:03 WARNING (MainThread) [homeassistant.config_entries] Config entry for sonarr not ready yet. Retrying in 10 seconds
2020-08-15 09:59:03 WARNING (MainThread) [homeassistant.config_entries] Config entry for upnp not ready yet. Retrying in 5 seconds
2020-08-15 09:59:04 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: synology_dsm, plex, hacs, mobile_app
2020-08-15 09:59:04 WARNING (MainThread) [homeassistant.config_entries] Config entry for adguard not ready yet. Retrying in 20 seconds
2020-08-15 09:59:08 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.red_charging_rate_power fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 263, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 454, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/template/sensor.py", line 235, in async_update
    self._state = self._template.async_render()
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 230, in async_render
    return compiled.render(kwargs).strip()
  File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/usr/local/lib/python3.8/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "<template>", line 1, in top-level template code
TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'
2020-08-15 09:59:08 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.red_charging_rate_power fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 263, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 454, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/template/sensor.py", line 235, in async_update
    self._state = self._template.async_render()
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 230, in async_render
    return compiled.render(kwargs).strip()
  File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/usr/local/lib/python3.8/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "<template>", line 1, in top-level template code
TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'
2020-08-15 09:59:08 WARNING (MainThread) [homeassistant.components.frontend] Theme  not found
2020-08-15 09:59:24 WARNING (MainThread) [homeassistant.config_entries] Config entry for adguard not ready yet. Retrying in 40 seconds
2020-08-15 10:00:04 WARNING (MainThread) [homeassistant.config_entries] Config entry for adguard not ready yet. Retrying in 80 seconds
2020-08-15 10:01:24 WARNING (MainThread) [homeassistant.config_entries] Config entry for adguard not ready yet. Retrying in 80 seconds
2020-08-15 10:02:44 WARNING (MainThread) [homeassistant.config_entries] Config entry for adguard not ready yet. Retrying in 80 seconds
2020-08-15 10:02:53 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.139736913878704] Disconnected: Did not receive auth message within 10 seconds
2020-08-15 10:04:04 WARNING (MainThread) [homeassistant.config_entries] Config entry for adguard not ready yet. Retrying in 80 seconds
2020-08-15 10:05:24 WARNING (MainThread) [homeassistant.config_entries] Config entry for adguard not ready yet. Retrying in 80 seconds

Additional information

Running Hassio Supervisor on Synology (w. Intel proc)

pieterzen commented 4 years ago

Simplifying the config by having it contain only this one line:

default_config:

Did not resolve the issue

DHoefakker commented 4 years ago

I'm having the exact same issue, after upgrade to 0.114 the starting up of home assistant takes ages, and it notifies me it cannot setup the integrations:

I only have the "default_config" element in my config.yaml. When i check the logs the "recorder" doesn't seem to be starting

note: Just upgraded to 0.114.1 but problem is still present.

Before 0.114 there was no issue

pi-ter commented 4 years ago

Same here. Happened after my update from 114.0 to 114.1. lucky enough I just made a backup last night.

Cheers, Pieter

pieterzen commented 4 years ago

I've deleted the database; This resolved my issue. Cause was probably related to me getting impatient during this update and rebooting the damn thing.

pieterzen commented 4 years ago

@frenck If this is not related to my own behavior, you can reopen this issue. For now, I'm happy with a workaround