Unexpected crashes: how to find the cause?

I am running Home Assistant on a Raspberry PI4 and it crashes avery few days; I normally realise becuse my homekit accessories stop responding. The only thing I can do is restarting by unplugging and replugging the cable. Sometime I just get a notification that it has restarted itself for no reason.

Things I’ve tried and haven’t solved the problem:

  • new sd card
  • new raspberry
  • tried a virtual machine on my laptop
  • recreate the system and configuration from scratch

I guess the problem others and myself are finding is that there are no logs to look at for at the time when the crash occurs

So, how does one fix this? Can I connect a display to the raspberry so that it displays useful logs that would stay on screen in the event of a crash

3-4 years in this ecosystem and I would like to run it robustly

My Raspberry pi 4 is doing this also. Following.

Rpi 4 (4gb) 128gb SSD
core 2021.11.5
supervisor-2021.10.8
Home Assistant OS 6.6

Are you absolutely sure that there are no logs? Because I think you will find home-assistant.log.1 which is the previous home assistant log right up until you restarted it. It won’t always be useful, be if you are lucky, there might be a stack trace near to the end of the log, or there might be signs of something constantly causing a stack trace right throughout the log. It’s worth checking. It’s in the config directory, along with the main home-assistant.log

3 Likes

Mine crashed again sometime last night when I was sleeping and the only way it recovers is by power cycling my raspberry pi. When it crashes next time I’ll post my log1 file. I hope this gets figured out soon I don’t trust my automations at this point.

I just ran the “check home assistant configuration” and this is the result.

[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[11:33:36] INFO: Don’t worry, this temporary installation is not overwriting your current one.
[11:33:36] INFO: Installing Home Assistant: stable…
[11:33:36] INFO: Please be patient, this might take a few minutes…
[11:35:37] INFO: Installed Home Assistant 2021.11.5
[11:35:37] INFO: Making a copy of your configuration for checking…
[11:35:43] INFO: Checking your configuration against this version…
[11:41:09] ERROR: The configuration check did not pass!
[11:41:09] ERROR: See the output below for more details.
Testing configuration at /tmp/config
Fatal error while loading config: The ‘google-auth<2.0dev,>=1.25.0’ distribution was not found and is required by google-api-core
Failed config
General Errors:
- The ‘google-auth<2.0dev,>=1.25.0’ distribution was not found and is required by google-api-core

Successful config (partial)
[11:41:09] INFO: The full output has been written to /share/check_config.txt
[cont-finish.d] executing container finish scripts…
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

My check config addon often complains about various integrations that don’t actually affect the real core from upgrading. Especially since it’s clearly not the cause of the crash, since in that log it prevented core from loading at all.

I just had a look at my log1 file

Anything useful in here?

however this template will fail to render in Home Assistant core 2022.1
2021-12-08 06:26:16 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2021-12-08 16:53:45 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 314, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 546, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'invalid HTTP method'"
2021-12-08 17:48:42 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2021-12-08 17:48:42 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{{ states("sensor.shelly_ht_temp") | float > states("sensor.soggiorno_temperature") | float  }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2021-12-08 17:48:42 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{{states("sensor.shelly_ht_temp") | float < states("sensor.soggiorno_temperature") | float  }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2021-12-08 17:48:42 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2021-12-08 18:32:49 WARNING (MainThread) [bellows.zigbee.application] Watchdog heartbeat timeout: 
2021-12-08 19:28:08 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2021-12-08 19:28:08 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{{ states("sensor.shelly_ht_temp") | float > states("sensor.soggiorno_temperature") | float  }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2021-12-08 19:28:08 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{{states("sensor.shelly_ht_temp") | float < states("sensor.soggiorno_temperature") | float  }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2021-12-08 19:28:08 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2021-12-08 19:59:04 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 314, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 546, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'invalid HTTP method'"
2021-12-08 20:13:41 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2021-12-08 20:13:41 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{{ states("sensor.shelly_ht_temp") | float > states("sensor.soggiorno_temperature") | float  }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2021-12-08 20:13:41 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{{states("sensor.shelly_ht_temp") | float < states("sensor.soggiorno_temperature") | float  }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2021-12-08 20:13:41 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2021-12-09 06:00:00 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities switch.elettra_charger_switch
2021-12-09 07:05:12 WARNING (Recorder) [homeassistant.components.sensor.recorder] Entity sensor.casa_mensile_f1 from integration utility_meter has state class total_increasing, but its state is not strictly increasing. Triggered by state 87836.078 with last_updated set to 2021-12-09T07:00:00.038296+00:00. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+utility_meter%22
2021-12-09 07:28:14 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 192.168.0.176 (192.168.0.176). (Mozilla/5.0 (iPhone; CPU iPhone OS 15_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Home Assistant/2021.11.1 (io.robbie.HomeAssistant; build:2021.266; iOS 15.1.1) Mobile/HomeAssistant, like Safari)
2021-12-09 07:36:21 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2021-12-09 07:36:21 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{{ states("sensor.shelly_ht_temp") | float > states("sensor.soggiorno_temperature") | float  }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2021-12-09 07:36:21 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{{states("sensor.shelly_ht_temp") | float < states("sensor.soggiorno_temperature") | float  }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2021-12-09 07:36:21 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2021-12-09 09:18:27 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2021-12-09 09:18:27 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{{ states("sensor.shelly_ht_temp") | float > states("sensor.soggiorno_temperature") | float  }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2021-12-09 09:18:27 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{{states("sensor.shelly_ht_temp") | float < states("sensor.soggiorno_temperature") | float  }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2021-12-09 09:18:27 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2021-12-09 10:09:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2021-12-09 10:09:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2021-12-09 10:09:17 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{{ states("sensor.shelly_ht_temp") | float > states("sensor.soggiorno_temperature") | float  }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2021-12-09 10:09:17 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{{states("sensor.shelly_ht_temp") | float < states("sensor.soggiorno_temperature") | float  }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2021-12-09 10:40:17 ERROR (MainThread) [homeassistant.components.hassio.handler] Timeout on /addons/core_duckdns/stats request
2021-12-09 10:40:17 ERROR (MainThread) [homeassistant.components.hassio.handler] Timeout on /addons/core_mosquitto/stats request
2021-12-09 10:40:17 ERROR (MainThread) [homeassistant.components.hassio.handler] Timeout on /addons/core_configurator/stats request
2021-12-09 10:40:17 ERROR (MainThread) [homeassistant.components.hassio.handler] Timeout on /addons/a0d7b954_phpmyadmin/stats request
2021-12-09 10:40:17 WARNING (MainThread) [homeassistant.components.hassio] Can't read Supervisor data: 
2021-12-09 11:06:14 ERROR (MainThread) [homeassistant.components.recorder] The recorder queue reached the maximum size of 30000; Events are no longer being recorded

Hi - I have the same problem ever since installing Nginx Reverse Proxy. I get a stream of messages about Timeout on /addons/<<< Addon name >>>/stats request.
For example Timeout on /addons/core_mosquitto/stats request

If I stop the Nginx plugin I don’t get these issues but I do get issues around external cloud platforms updating - as you would expect.

If I enable I get a re-boot sometimes just after these messages appear. The reboot used to be consistent until I updated to 2021.12 and OS v7. I am on a RPi4.

I really don’t understand the problem. The platform works just great until it re-starts. I typically see a reboot 10 times a day.

1 Like

My system crashed on the 24/12/2021, I restarted it on the 08/01/2022

The last part of the log is (full log too long to attach)

2021-12-23 23:40:26 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  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/components/tado/__init__.py", line 75, in <lambda>
    lambda now: tadoconnector.update(),
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 277, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 160, in update
    self.update_zones()
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 214, in update_zones
    zone_state = TadoZone(zone_states[str(zone_id)], zone_id)
KeyError: '14'
2021-12-23 23:45:26 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  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/components/tado/__init__.py", line 75, in <lambda>
    lambda now: tadoconnector.update(),
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 277, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 160, in update
    self.update_zones()
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 214, in update_zones
    zone_state = TadoZone(zone_states[str(zone_id)], zone_id)
KeyError: '14'
2021-12-23 23:50:26 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  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/components/tado/__init__.py", line 75, in <lambda>
    lambda now: tadoconnector.update(),
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 277, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 160, in update
    self.update_zones()
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 214, in update_zones
    zone_state = TadoZone(zone_states[str(zone_id)], zone_id)
KeyError: '14'
2021-12-23 23:55:26 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  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/components/tado/__init__.py", line 75, in <lambda>
    lambda now: tadoconnector.update(),
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 277, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 160, in update
    self.update_zones()
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 214, in update_zones
    zone_state = TadoZone(zone_states[str(zone_id)], zone_id)
KeyError: '14'
2021-12-24 00:00:26 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  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/components/tado/__init__.py", line 75, in <lambda>
    lambda now: tadoconnector.update(),
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 277, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 160, in update
    self.update_zones()
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 214, in update_zones
    zone_state = TadoZone(zone_states[str(zone_id)], zone_id)
KeyError: '14'
2021-12-24 00:05:26 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  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/components/tado/__init__.py", line 75, in <lambda>
    lambda now: tadoconnector.update(),
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 277, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 160, in update
    self.update_zones()
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 214, in update_zones
    zone_state = TadoZone(zone_states[str(zone_id)], zone_id)
KeyError: '14'
2021-12-24 00:10:26 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  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/components/tado/__init__.py", line 75, in <lambda>
    lambda now: tadoconnector.update(),
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 277, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 160, in update
    self.update_zones()
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 214, in update_zones
    zone_state = TadoZone(zone_states[str(zone_id)], zone_id)
KeyError: '14'
2021-12-24 00:15:27 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  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/components/tado/__init__.py", line 75, in <lambda>
    lambda now: tadoconnector.update(),
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 277, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 160, in update
    self.update_zones()
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 214, in update_zones
    zone_state = TadoZone(zone_states[str(zone_id)], zone_id)
KeyError: '14'
2021-12-24 00:20:26 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  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/components/tado/__init__.py", line 75, in <lambda>
    lambda now: tadoconnector.update(),
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 277, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 160, in update
    self.update_zones()
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 214, in update_zones
    zone_state = TadoZone(zone_states[str(zone_id)], zone_id)
KeyError: '14'
2021-12-24 00:25:26 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  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/components/tado/__init__.py", line 75, in <lambda>
    lambda now: tadoconnector.update(),
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 277, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 160, in update
    self.update_zones()
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 214, in update_zones
    zone_state = TadoZone(zone_states[str(zone_id)], zone_id)
KeyError: '14'
2021-12-24 00:30:26 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  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/components/tado/__init__.py", line 75, in <lambda>
    lambda now: tadoconnector.update(),
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 277, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 160, in update
    self.update_zones()
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 214, in update_zones
    zone_state = TadoZone(zone_states[str(zone_id)], zone_id)
KeyError: '14'
2021-12-24 00:30:33 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 192.168.0.176 (192.168.0.176). (Mozilla/5.0 (iPhone; CPU iPhone OS 15_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Home Assistant/2021.11.1 (io.robbie.HomeAssistant; build:2021.266; iOS 15.1.1) Mobile/HomeAssistant, like Safari)

Still no solution to this?

I have the same problem.

Not really
I haven’t had a crash since I installed a cooling fan last week, but now that I’ve said that it’s probably going to crash tomorrow

Still no crashes, however, my Homekit integration seems to have stopped working as the accessories in the home app show “no response”

I suspect Tado might have something to do with the crashes. I can’t seem to find anything definitive, but I’m having the same issues and usually one of the last things logged was Tado (PyTado.interface to be specific) trying to do something. Curious to know if anyone else has experienced the same.