Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HEADS UP - Manage Temps Recipe V2 Potentially Causing HA 2024.4 Crashes #464

Open
jbeardon opened this issue Apr 6, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@jbeardon
Copy link

jbeardon commented Apr 6, 2024

Just a heads up for anyone using recipes/manage_temps_v2.md

I attempted to update to HA 2024.4.1 this morning and although everything seemed to go well, HA became unavailable within a matter of minutes. Tried the upgrade a few times after rolling back but experienced the same issue - removed a few HACS integrations that were documented as causing issues - no joy.

Looking at the logs, the trigger automation for manage_temps_v2 was referenced in multiple, repeated errors until losing connection to HA - example at the bottom of this issue.

I'm no expert but after eventually managing to get HA running long enough, I disabled the automations relating to Manage Temps V2 and HA has been stable since.

I've been using Manage Temps for at least 6 months - this problem was not present with HA 2024.3 but there is a definite corrolation.

2024-04-06 13:26:58.522 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback <_asyncio.TaskStepMethWrapper object at 0x7f960c8acc70>()
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: Cannot enter into task <Task pending name='Task-10256' coro=<BaseSelectorEventLoop._accept_connection2() running at /usr/local/lib/python3.12/asyncio/selector_events.py:213>> while another task <Task finished name="event trigger {'domain': 'automation', 'name': 'Wiser External Sensor Event - ESPHome', 'home_assistant_start': True, 'variables': {'temp_sensor_integration': 'esphome', 'temp_sensor_prefix': 'sensor.ths', 'temp_sensor_suffix': 'temperature', 'this': {'entity_id': 'automation.wiser_fire_external_sensor_event_esphome', 'state': 'on', 'attributes': {'id': '1704796737667', 'last_triggered': datetime.datetime(2024, 4, 6, 12, 15, 40, 761858, tzinfo=datetime.timezone.utc), 'mode': 'queued', 'current': 0, 'max': 25, 'friendly_name': 'Wiser External Sensor Event - ESPHome'}, 'last_changed': '2024-04-06T12:16:50.536050+00:00', 'last_reported': '2024-04-06T12:16:50.536050+00:00', 'last_updated': '2024-04-06T12:16:50.536050+00:00', 'context': {'id': '01HTSNE3B8NVKSN2DQJR91ZA2V', 'parent_id': None, 'user_id': None}}}, 'trigger_data': {'id': '0', 'idx': '0', 'alias': None}}" result=None> is being executed.
2024-04-06 13:26:59.056 ERROR (MainThread) [homeassistant] Error doing job: Task was destroyed but it is pending!
2024-04-06 13:26:59.057 ERROR (MainThread) [homeassistant] Error doing job: Task was destroyed but it is pending!
2024-04-06 13:27:01.064 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback <_asyncio.TaskStepMethWrapper object at 0x7f9600b47850>()
@msp1974
Copy link
Collaborator

msp1974 commented Apr 7, 2024

Wierd an automation is causing this error. I have seen some similar errors logged on HA Core repo but they seem to be caused by integrations performing non thread safe operations.

I will have a look at this myself but what HACs integrations do you have loaded?

@jbeardon
Copy link
Author

jbeardon commented Apr 7, 2024

Hi Mark - I thought it odd as well but I have always had concerns about this setup (particularly the external sensor event automation). It literally gets triggered with every sensor state change and then has to evaluate whether the sensor is using a defined integration that it starts and ends with certain text - if, like myself, you have a lot of sensors, it's triggering almost continuously. I've been meaning to re-write the even trigger part of it so that it's only triggering from specific sensors and not having to do the whole valuation thing.

In answer to your question, although I do have a number of HACS integrations, the only one that was mentioned in any of the posts I came across was Watchman, which I removed prior to doing further troubleshooting. The only thing in the logs creating errors referenced this automation so didn't really look further.

For reference, I have these HACS integrations installed:
Tapo: Cameras Control
myenergi
Moonraker
Frigate (proxy)
keymaster
Haier hOn
Event Sensor
Holidays
Alarmo
WebRTC Camera
Octopus Energy
HASS.Agent
Alexa Media Player
Bambu Lab
Drayton Wiser

@msp1974 msp1974 added the bug Something isn't working label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants