Logs provided - can anyone see what's causing my HA to lockup/freeze?

Logs here - they’re SUPER long so I’ve cut out repetition but have included the beginning, middle and end.

If anyone has any clue what’s going on I’m all ears because my once reliable HA has become super unreliable :frowning:

Related to this from the other day

It looks like the home-assistant_v2.db is corrupt. Do you have a backup that you can retrieve a good copy from? That is the first problem I see and it could be causing all of your other problems.

1 Like

Thanks, that makes a lot of sense…will try

Sadly not. Have twice stopped HA, deleted the database and then restarted HA. It runs for a while (sometimes only minutes) and then again, freezes.

My debug level is set to ‘warning’. Is there any way to find out what’s going on here?

AssertionError
2024-03-14 07:35:02.257 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 637, in async_trigger
    and not self._cond_func(variables)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 1014, in if_action
    if check(hass, variables) is False:
       ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/condition.py", line 179, in wrapper
    result = condition(hass, variables)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/condition.py", line 787, in template_if
    return async_template(hass, value_template, variables)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/condition.py", line 767, in async_template
    info = value_template.async_render_to_info(variables, parse_result=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 687, in async_render_to_info
    assert self.hass and _render_info.get() is None
AssertionError
2024-03-14 07:35:02.262 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 637, in async_trigger
    and not self._cond_func(variables)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 1014, in if_action
    if check(hass, variables) is False:
       ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/condition.py", line 179, in wrapper
    result = condition(hass, variables)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/condition.py", line 787, in template_if
    return async_template(hass, value_template, variables)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/condition.py", line 767, in async_template
    info = value_template.async_render_to_info(variables, parse_result=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 687, in async_render_to_info
    assert self.hass and _render_info.get() is None
AssertionError
2024-03-14 07:35:02.268 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 637, in async_trigger
    and not self._cond_func(variables)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 1014, in if_action
    if check(hass, variables) is False:
       ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/condition.py", line 179, in wrapper
    result = condition(hass, variables)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/condition.py", line 787, in template_if
    return async_template(hass, value_template, variables)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/condition.py", line 767, in async_template
    info = value_template.async_render_to_info(variables, parse_result=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 687, in async_render_to_info
    assert self.hass and _render_info.get() is None
AssertionError
2024-03-14 07:35:02.274 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 637, in async_trigger
    and not self._cond_func(variables)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 1014, in if_action
    if check(hass, variables) is False:
       ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/condition.py", line 179, in wrapper
    result = condition(hass, variables)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/condition.py", line 787, in template_if
    return async_template(hass, value_template, variables)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/condition.py", line 767, in async_template
    info = value_template.async_render_to_info(variables, parse_result=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 687, in async_render_to_info
    assert self.hass and _render_info.get() is None
AssertionError

At this rate my partner will insist I de-smart the home. :frowning:
Nothing is working reliably anymore.

Thank you all!

More logs, with debug logging set to warning available here if anyone has a minute to look at them.

Thank you

ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ (float(states.sensor.ensuite_temperature.state) + float(states.sensor.bathroom_temperature.state) + float(states.sensor.claire_numberseventy_co_uk_temperature.state)) / 3 | round(2) }}' but no default was specified
 
The above exception was the direct cause of the following exception:

Have you checked the above. I don’t know if it is a sensor or a template. You are not giving the calculation a default if the state is none or unknown. I think it should be something like below but only guessing because I don’t know entities or configuration.

'{{ (states('sensor.ensuite_temperature') | float(0) +   states('sensor.bathroom_temperature') | float(0) + states('sensor.claire_numberseventy_co_uk_temperature') | float(0) ) / 3 | round(2) }}' 

I hope this gives you something to look at. You can go to developer → template and type in and see if it works.

What is the host hardware?
What is the size of home-assistant_v2.db when HA fails?
If you delete home-assistant_v2.db, how long does it run?

It’s a Pi4
Sometimes after deletion of the DB it would run fo 12 hours, sometimes 5 mins.
I think it’s the python script at this point as stopping using it has cleared up all my issues - maybe coincidence but I’m just so relieved at this point

Thanks, I didn’t bother looking into it because I’ve had that error (on bootup, until both sensors are assigned a value) for years.
The problem seems to be gone for now, don’t know for sure what fixed it, but it coincided with stopping using the python script.