HA. 2021.11.2 crash on raspbery pi 4

My Home Assistant is installed on raspberry Pi 4 (64bit) and since the last update 2021.11.2 I have problems crashing overnight. And forces me to do a power reset in the morning to keep running. That way the .log file is lost and I can’t understand what the problem is. Can anyone help me or have you had this problem?

System information:
System Health

version: core-2021.11.2
installation_type: Home Assistant OS
dev: false
hassio: true
docker: true
user: root
virtualenv: false
python_version: 3.9.7
os_name: Linux
os_version: 5.10.17-v8
arch: aarch64
timezone: Europe/Lisbon

GitHub API: ok
Github API Calls Remaining: 4934
Installed Version: 1.16.0
Stage: running
Available Repositories: 900
Installed Repositories: 11

logged_in: false
can_reach_cert_server: ok
can_reach_cloud_auth: ok
can_reach_cloud: ok

host_os: Home Assistant OS 6.6
update_channel: stable
supervisor_version: supervisor-2021.10.8
docker_version: 20.10.8
disk_total: 57.8 GB
disk_used: 9.6 GB
healthy: true
supported: true
board: rpi4-64
supervisor_api: ok
version_api: ok
installed_addons: Samba share (9.5.1), Mosquitto broker (6.0.1), IDE (2.2.0), WireGuard (0.5.1), Node-RED (10.0.0), File editor (5.3.3), Terminal & SSH (9.2.1), Duck DNS (1.14.0), Z-Wave JS (0.1.47), TasmoAdmin (0.15.0), ESPHome (2021.10.3)

dashboards: 2
resources: 8
views: 17
mode: storage

Configuration file:

default_config:

config:

hassio:

http:
    ssl_certificate: /ssl/fullchain.pem
    ssl_key: /ssl/privkey.pem

hacs:
  token: !secret hacs_token
  theme: true

tts:
  - platform: google_translate
    service_name: google_say
  
sun:

system_health:
  
mobile_app:

mqtt:
  broker: 192.168.1.225
  client_id: home-assistant-server
  username: !secret mqtt_username
  password: !secret mqtt_password


group: !include_dir_merge_named groups_
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
input_number: !include_dir_merge_named input_numbers
input_select: !include_dir_merge_named input_selects/
binary_sensor: !include_dir_merge_list binary_sensor
sensor: !include_dir_merge_list sensors/
light: !include_dir_merge_list dimmer_light/
switch: !include switches.yaml
input_boolean: !include_dir_merge_named boolean_sensors/
cover: !include_dir_merge_list covers/
plant: !include plant.yaml
frontend:
  themes: !include_dir_merge_named themes


input_datetime:

input_text:

notify:
  - name: EMAIL_NOTIFIER
    platform: smtp
    server: smtp.gmail.com
    port: 587
    timeout: 15
    sender: !secret master_email
    encryption: starttls
    username: !secret master_email
    password: !secret email_password
    recipient:
      - !secret email_client_1
      - !secret email_client_2
      - !secret email_client_3
    sender_name: My Home Assistant
    
logbook:

history:

'# Example configuration.yaml entry with exclude
recorder:
  purge_keep_days: 30
  include:
    entities:
      - input_datetime.light_time_on
      - input_datetime.light_time_off
      - input_datetime.alarme_time_clock
      - input_datetime.start_time_zone_1
      - input_datetime.start_time_zone_2
      - input_datetime.start_time_zone_3
      - input_datetime.start_time_zone_4
      
      - input_boolean.automatic_light_turn_on
      - input_boolean.go_on_holidays
      - input_boolean.scene_go_sleeping
      - input_boolean.scene_relaxing
      - input_boolean.scene_show
      - input_boolean.scene_arriving_home
      - input_boolean.scene_go_away
      - input_boolean.scene_wake_up
      - input_boolean.covers_to_0
      - input_boolean.covers_to_30
      - input_boolean.covers_to_50
      - input_boolean.covers_to_80
      - input_boolean.covers_to_100
      - input_boolean.r3a_fan_knx_relay
      - input_boolean.r4a_fan_knx_relay
      - input_boolean.r2a_heat_knx_relay
      - input_boolean.r5b_light_knx_relay
      - input_boolean.r6b_heat_knx_relay
      - input_boolean.r2b_heat_knx_relay_ch1
      - input_boolean.r2b_light_knx_relay_ch2
      - input_boolean.r4b_light_knx_relay
      - input_boolean.r1a_light_knx_relay
      - input_boolean.r1b_light_knx_relay
      - input_boolean.r7b_light_knx_relay
      - input_boolean.zone_1_clock_mon
      - input_boolean.zone_1_clock_tue
      - input_boolean.zone_1_clock_wed
      - input_boolean.zone_1_clock_thu
      - input_boolean.zone_1_clock_fri
      - input_boolean.zone_1_clock_sat
      - input_boolean.zone_1_clock_sun
      - input_boolean.zone_2_clock_mon
      - input_boolean.zone_2_clock_tue
      - input_boolean.zone_2_clock_wed
      - input_boolean.zone_2_clock_thu
      - input_boolean.zone_2_clock_fri
      - input_boolean.zone_2_clock_sat
      - input_boolean.zone_2_clock_sun
      - input_boolean.zone_3_clock_mon
      - input_boolean.zone_3_clock_tue
      - input_boolean.zone_3_clock_wed
      - input_boolean.zone_3_clock_thu
      - input_boolean.zone_3_clock_fri
      - input_boolean.zone_3_clock_sat
      - input_boolean.zone_3_clock_sun
      - input_boolean.zone_4_clock_mon
      - input_boolean.zone_4_clock_tue
      - input_boolean.zone_4_clock_wed
      - input_boolean.zone_4_clock_thu
      - input_boolean.zone_4_clock_fri
      - input_boolean.zone_4_clock_sat
      - input_boolean.zone_4_clock_sun
      - input_boolean.light_clock_mon
      - input_boolean.light_clock_tue
      - input_boolean.light_clock_wed
      - input_boolean.light_clock_thu
      - input_boolean.light_clock_fri
      - input_boolean.light_clock_sat
      - input_boolean.light_clock_sun
      - input_boolean.auto_close_shutter_by_sun
    
      - input_select.light_type_control
      - input_select.light_type_of_control
    
      - group.lights_time
      - group.alarme_time
      - group.zone_1
      - group.zone_2
      - group.zone_3
      - group.zone_4
      
      - input_number.d6b_light_knx_dimmer
      - input_number.d14b_light_knx_dimmer
      - input_number.d18b_light_knx_dimmer
      - input_number.d24b_light_knx_dimmer
      - input_number.d9a_light_knx_dimmer
      - input_number.d3a_light_knx_dimmer
      - input_number.d20a_light_knx_dimmer
      - input_number.d23b_light_knx_dimmer
      - input_number.d13a_light_knx_dimmer
      - input_number.d19a_light_knx_dimmer
      - input_number.d22b_light_knx_dimmer
      - input_number.d10b_light_knx_dimmer
      - input_number.d20b_light_knx_dimmer
      - input_number.d21b_light_knx_dimmer
      - input_number.d8b_light_knx_dimmer
      - input_number.d9b_light_knx_dimmer
      - input_number.d1a_light_knx_dimmer
      - input_number.d17a_light_knx_dimmer
      - input_number.d1b_light_knx_dimmer
      - input_number.d19b_light_knx_dimmer
      - input_number.d7b_light_knx_dimmer
      - input_number.duration_zone_1
      - input_number.duration_zone_2
      - input_number.duration_zone_3
      - input_number.duration_zone_4
      - input_number.auto_close_shutter_percentage
      
      - sensor.average_light_sensor_up
      - sensor.average_light_sensor_down
      - sensor.light_detection_sensor_up_light_level
      - sensor.light_detection_sensor_down_light_level_2
      - sensor.diferenca
      
      - sensor.door_sensor_closet_battery_level
      - sensor.door_sensor_tv_room_battery_level
      - sensor.door_sesnsor_living_room_battery_level
      - sensor.door_sensor_entry_4b_battery_level
      - sensor.door_sensor_entry_4a_battery_level
      
      - sensor.movment_sensor_entry_4a
      - sensor.movment_sensor_entry_4b
      - sensor.history_z1
      - sensor.history_z2
      - sensor.history_z3
      - sensor.history_z4
      - sensor.moisture_1
      - sensor.moisture_2
      - sensor.moisture_3
      - sensor.moisture_4
      - sensor.miflora_moisture_1
      - sensor.miflora_moisture_2
      - sensor.miflora_moisture_3
      - sensor.miflora_moisture_4
      - sensor.living_humidity
      - sensor.dining_humidity
      - sensor.kitchen_humidity
      - sensor.tv_room_humidity
      - sensor.office_humidity
      - sensor.closet_humidity
      - sensor.thermostat_master_bathroom_humidity
      - sensor.thermostat_master_humidity
      - sensor.thermostat_office_bathroom_humidity
      - sensor.thermostat_laundry_humidity
      - sensor.thermostat_wc_4b_humidity
      - sensor.thermostat_wc_4a_humidity
      - sensor.thermostat_guest_humidity
      - sensor.node_43_humidity
      - sensor.thermostat_entry_hall_4b_humidity
      
      - sensor.sonoff_temperature
      
      - binary_sensor.rpi_power_status
      - binary_sensor.flood_sensor_guest_wc_4b_home_security_tampering_product_cover_removed
      - binary_sensor.flood_sensor_office_bathroom_home_security_tampering_product_cover_removed
      - binary_sensor.flood_sensor_guest_wc_4b_home_security_tampering_product_cover_removed
      - binary_sensor.flood_sensor_wc_4a_home_security_tampering_product_cover_removed
      - binary_sensor.flood_sensor_wc_4b_home_security_tampering_product_cover_removed
      - binary_sensor.door_sensor_entry_4b_access_control_window_door_is_open
      - binary_sensor.node_20_access_control_window_door_is_closed
      - binary_sensor.door_sesnsor_living_room_access_control_window_door_is_open
      - binary_sensor.door_sensor_tv_room_access_control_window_door_is_open
      - binary_sensor.door_sensor_closet_access_control_window_door_is_open

  exclude:
    domains:
      - updater
      - sun
      - automation
      - zwave
      - alarm_control_panel
      - remote 
      - script
      - binary_sensor
      - input_select
      - input_boolean
      - input_datetime
      - binary_sensor
      - input_number
      - device_tracker
      - fan
      - lock
      - media_player
      - sensor
      - group
      - plant
      - zone
      - camera
      - weather
      - media_player
    entity_globs:
      - sensor.weather_*
    entities:
      - sun.sun
      - sensor.last_boot
      - sensor.date
    event_types:
      - call_service

I suspect it’s the recorder crashing the system. any ideas?
thanks

Not a lot without logs. Look in /config for home-assistant.log.1 that’s the log before the last restart.

Though this should be set up in the UI and removed from your config unless you have a specific reason for it:

mqtt:
  broker: 192.168.1.225
  client_id: home-assistant-server
  username: !secret mqtt_username
  password: !secret mqtt_password

It probably isn’t the reason for your crash.

are u running microSD or SSD? HA usually crashing due to data corruptions.

I have the same issue, my HA installation is not accessable anymore:

2021-11-10 12:15:06 ERROR (MainThread) [root] Uncaught exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 331, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 318, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 121, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/usr/src/homeassistant/homeassistant/runner.py", line 103, in setup_and_run_hass
    hass = await bootstrap.async_setup_hass(runtime_config)
  File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 120, in async_setup_hass
    config_dict = await conf_util.async_hass_config_yaml(hass)
  File "/usr/src/homeassistant/homeassistant/config.py", line 357, in async_hass_config_yaml
    config = await hass.loop.run_in_executor(
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/config.py", line 377, in load_yaml_config_file
    conf_dict = load_yaml(config_path, secrets)
  File "/usr/src/homeassistant/homeassistant/util/yaml/loader.py", line 111, in load_yaml
    return parse_yaml(conf_file, secrets)
  File "/usr/src/homeassistant/homeassistant/util/yaml/loader.py", line 123, in parse_yaml
    yaml.load(content, Loader=lambda stream: SafeLineLoader(stream, secrets))
  File "/usr/local/lib/python3.9/site-packages/yaml/__init__.py", line 81, in load
    return loader.get_single_data()
  File "/usr/local/lib/python3.9/site-packages/yaml/constructor.py", line 51, in get_single_data
    return self.construct_document(node)
  File "/usr/local/lib/python3.9/site-packages/yaml/constructor.py", line 55, in construct_document
    data = self.construct_object(node)
  File "/usr/local/lib/python3.9/site-packages/yaml/constructor.py", line 100, in construct_object
    data = constructor(self, node)
  File "/usr/src/homeassistant/homeassistant/util/yaml/loader.py", line 253, in _ordered_dict
    nodes = loader.construct_pairs(node)
  File "/usr/local/lib/python3.9/site-packages/yaml/constructor.py", line 155, in construct_pairs
    value = self.construct_object(value_node, deep=deep)
  File "/usr/local/lib/python3.9/site-packages/yaml/constructor.py", line 100, in construct_object
    data = constructor(self, node)
  File "/usr/src/homeassistant/homeassistant/util/yaml/loader.py", line 253, in _ordered_dict
    nodes = loader.construct_pairs(node)
  File "/usr/local/lib/python3.9/site-packages/yaml/constructor.py", line 155, in construct_pairs
    value = self.construct_object(value_node, deep=deep)
  File "/usr/local/lib/python3.9/site-packages/yaml/constructor.py", line 100, in construct_object
    data = constructor(self, node)
  File "/usr/src/homeassistant/homeassistant/util/yaml/loader.py", line 217, in _include_dir_merge_named_yaml
    loaded_yaml = load_yaml(fname, loader.secrets)
  File "/usr/src/homeassistant/homeassistant/util/yaml/loader.py", line 111, in load_yaml
    return parse_yaml(conf_file, secrets)
  File "/usr/src/homeassistant/homeassistant/util/yaml/loader.py", line 123, in parse_yaml
    yaml.load(content, Loader=lambda stream: SafeLineLoader(stream, secrets))
  File "/usr/local/lib/python3.9/site-packages/yaml/__init__.py", line 81, in load
    return loader.get_single_data()
  File "/usr/local/lib/python3.9/site-packages/yaml/constructor.py", line 51, in get_single_data
    return self.construct_document(node)
  File "/usr/local/lib/python3.9/site-packages/yaml/constructor.py", line 55, in construct_document
    data = self.construct_object(node)
  File "/usr/local/lib/python3.9/site-packages/yaml/constructor.py", line 100, in construct_object
    data = constructor(self, node)
  File "/usr/src/homeassistant/homeassistant/util/yaml/loader.py", line 253, in _ordered_dict
    nodes = loader.construct_pairs(node)
  File "/usr/local/lib/python3.9/site-packages/yaml/constructor.py", line 155, in construct_pairs
    value = self.construct_object(value_node, deep=deep)

need more info…

the complete log?

What version HA? What is your device? Then the logs. Explain what happen to it, so at least people will be able to get some understanding

you are saying should be set up via the Mosquitto broker add-on?

is running on microSD, the card is working because after doing a power reset it works :S

I don’t see anything very strange on home-assistant.log.1 :confused:

I can share the file home-assistant.log.1 with you but I don’t know how because there are so many lines

It’s running again after recreating a broken configuration.yaml - thanks!

No this is the integration (client) not the addon (broker). It should be set up via Configuration / Integrations.

Use a file sharing site like https://hatebin.com/ Make sure you remove any sensitive information before sharing the link here.

1 Like

HA problem specifically crashing over the day is because of MicroSD is corrupted or broken. Its recommend that you replace it with SSD which will have a better protection for read/write access.

Log file after performing a power reset:
home-assistant.log.1

from the logs you need to check on breaking changes. Many error messages

I had the exact same thing after going from 32bit on SD card to 64bit on SSD (same version of HA). Culprit unknown, probably some kind of overheating issue. See here. I went back to 32bit HA on the SD card, perfectly stable.

Not necessarily, I had the exact same thing happen (dying in the morning hours) exactly after upgrading to SSD. Didn’t happen once with SD.

1 Like

well you can check… many have used SSD without any problem. I my self have been running SSD no problem

Well, I and the OP haven’t, so… I have sent logs, did the entire troubleshooting dance, nobody has any idea why it happened every morning. Doesn’t happen on the SD card, ever. Case closed for me.

when HA crashing meaning your SSD corrupted and you will experience the same thing when your microSD get the similar state