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

ha-samsungtv-tizen calls hass.async_create_task from a thread other than the event loop, which may cause Home Assistant to crash or data to corrupt #209

Open
totoantibes opened this issue Jun 20, 2024 · 5 comments

Comments

@totoantibes
Copy link

i found the following log entry in my HA core 2024.6

Detected that custom integration 'samsungtv_tizen' calls hass.async_create_task from a thread other than the event loop, which may cause Home Assistant to crash or data to corrupt. For more information, see https://developers.home-assistant.io/docs/asyncio_thread_safety/#hassasync_create_task at custom_components/samsungtv_tizen/media_player.py, line 339: self.hass.async_create_task(self._gen_installed_app_list()), please report it to the author of the 'samsungtv_tizen' custom integration

@RobGri001
Copy link

I have exactly the same problem. It's pretty annoying that an add-on causes the entire Home Assistant to crash

@yellowonblack
Copy link

The same issue here on 2024.7.1

@E4est
Copy link

E4est commented Aug 4, 2024

Today I updated my Home Assistant to 2024.7.4 and my container didn't boot because of this error message.
I have now removed this component from my instance and migrated my automations and scripts to use the official integration again.
It's a shame, because the key chaining in this one worked much faster. But the maintainer has been quiet for too long and I'm not certain this will be fixed anytime soon.

@m-l
Copy link

m-l commented Aug 13, 2024

I'm having this issue too...
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 942, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1302, in async_device_update await hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 184, in wrapper result = method(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 184, in wrapper result = method(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/samsungtv_tizen/media_player.py", line 420, in update self._ping_device() File "/config/custom_components/samsungtv_tizen/media_player.py", line 352, in _ping_device self.hass.async_create_task(self._gen_installed_app_list()) File "/usr/src/homeassistant/homeassistant/core.py", line 807, in async_create_task frame.report_non_thread_safe_operation("hass.async_create_task") File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 225, in report_non_thread_safe_operation report( File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 159, in report _report_integration(what, integration_frame, level, error_if_integration) File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 197, in _report_integration raise RuntimeError( RuntimeError: Detected that custom integration 'samsungtv_tizen' calls hass.async_create_task from a thread other than the event loop, which may cause Home Assistant to crash or data to corrupt. For more information, see https://developers.home-assistant.io/docs/asyncio_thread_safety/#hassasync_create_task at custom_components/samsungtv_tizen/media_player.py, line 352: self.hass.async_create_task(self._gen_installed_app_list()). Please report it to the author of the 'samsungtv_tizen' custom integration.

@m-l
Copy link

m-l commented Aug 13, 2024

Never mind, I've removed this integration and went for https://github.com/ollo69/ha-samsungtv-smart which seems working fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants