2024.4.3 upgrade, constantly crashing

I upgraded yesterday and my install is constantly crashing now, it seems to be automation related and I found this t hread, Home Assistant crashing on 2024.4.x but it is a little lite on the details

 home-assistant  | 2024-04-16 04:58:28.942 ERROR (Recorder) [homeassistant] Error doing job: Task was destroyed but it is pending!
 home-assistant  | 2024-04-16 04:58:28.949 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback <_asyncio.TaskStepMethWrapper object at 0x7f54fbdeb1c0>()
 home-assistant  | Traceback (most recent call last):
 home-assistant  |   File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
home-assistant  |     self._context.run(self._callback, *self._args)
home-assistant  | RuntimeError: Cannot enter into task <Task pending name='Task-231270' coro=<BaseSelectorEventLoop._accept_connection2() running at /usr/local/lib/python3.12/asyncio/selector_events.py:213>> while another task <Task pending name='Ping 192.168.1.102 - Terry - refresh' coro=<DataUpdateCoordinator._handle_refresh_interval() running at /usr/src/homeassistant/homeassistant/helpers/update_coordinator.py:258> wait_for=<Future finished result=None> cb=[set.remove(), set.remove()]> is being executed.
home-assistant  | 2024-04-16 04:58:29.060 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback <_asyncio.TaskStepMethWrapper object at 0x7f54fbd6a7a0>()

2024-04-15 16:15:56.752 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback Task.task_wakeup()
Traceback (most recent call last):
File “/usr/local/lib/python3.12/asyncio/events.py”, line 88, in _run
self._context.run(self._callback, *self._args)
RuntimeError: Leaving task <Task pending name=‘Task-17488’ coro=<WebSocketHandler._writer() running at /usr/src/homeassistant/homeassistant/components/websocket_api/http.py:138> wait_for=> does not match the current task .
2024-04-15 16:15:56.759 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback <_asyncio.TaskStepMethWrapper object at 0x7f169e913d90>()

Often it will mention a specific automation, like it tried to run it and then it goes crazy and I have been disabling those automations but, what is wrong with them?

an example of one;

- alias: when outside temp is lower than the aircon setting while cooling
  id: whenoutsidetempislowerthantheairconsettingwhilecooling
  trigger:
    - platform: state
      entity_id: sensor.aarlo_temperature_babymonitor
    - platform: state
      entity_id: sensor.gosford_temp
  condition:
    - condition: state
      entity_id: input_boolean.house_status
      state: 'on'
    - condition: template
      value_template: "{{ states('climate.daikinap20019') == 'cool' }}"
    - condition: template
      value_template: "{{ state_attr('climate.daikinap20019', 'temperature') | float(0) > states('sensor.gosford_temp') | int(0) }}"
    - condition: template
      value_template: "{% if states('sensor.aarlo_temperature_babymonitor') | float(0) >= states('input_number.matthias_max_temp') | float(0) - 3 %}False{%else%}True{% endif %}"
  action:
    - continue_on_error: True
      data:
        message: |-
          It is colder outsider, air con off
        title: "The AirCon"
      service: notify.jurgen
    - service: climate.turn_off
      entity_id: climate.daikinap20019

any thoughts?

RuntimeError: Cannot enter into task usually indicates you have an integration doing non-threadsafe operations on asyncio objects which is corrupting the internal asyncio state.

When an integration modifies the event loop internals from another thread the behavior is undefined and will usually eventually lead to a crash.

If you put asyncio in debug mode, it will be able to detect some of these bad calls and maybe even block them. You can use the profiler service to do that:
https://www.home-assistant.io/integrations/profiler/#service-profilerset_asyncio_debug

If you can’t get far enough along you can also enable debugpy: in configuration.yaml instead (but its much slower)
https://www.home-assistant.io/integrations/debugpy/

Assuming you are using the aarlo custom integration. Checkout:

1 Like

Yeah, I am… I am upgrading to that and will report back.

it also explains the automations they were triggering it, all related to the arlo