jens-maus / RaspberryMatic

:house: A feature-rich but lightweight, buildroot-based Linux operating system alternative for your CloudFree CCU3/ELV-Charly 'homematicIP CCU' IoT smarthome central. Running as a pure virtual appliance (ProxmoxVE, Home Assistant, LXC, Docker/OCI, Kubernetes/K8s, etc.) on a dedicated embedded device (RaspberryPi, etc.) or generic x86/ARM hardware.
https://raspberrymatic.de
Apache License 2.0
1.52k stars 186 forks source link

Error in Log: ERROR (XmlRpcServer on port 49883) [hahomematic.central] FIRE_HA_EVENT_CALLBACK #2849

Closed MSoegtropIMC closed 5 days ago

MSoegtropIMC commented 5 days ago

Describe the issue you are experiencing

I am using RaspberryMatic under Homeassistant. I see the following error messages in the log:

2024-09-12 21:21:35.194 ERROR (XmlRpcServer on port 49883) [hahomematic.central] FIRE_HA_EVENT_CALLBACK: Unable to call handler: Detected that custom integration 'homematicip_local' calls issue_registry.async_delete 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/#issue_registryasync_delete at custom_components/homematicip_local/control_unit.py, line 354: async_delete_issue(. Please report it to the author of the 'homematicip_local' custom integration.

and the following warnings:

2024-09-12 21:21:35.183 WARNING (XmlRpcServer on port 49883) [homeassistant.helpers.frame] Detected that custom integration 'homematicip_local' calls issue_registry.async_delete 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/#issue_registryasync_delete at custom_components/homematicip_local/control_unit.py, line 354: async_delete_issue(, please report it to the author of the 'homematicip_local' custom integration

2024-09-12 21:21:14.907 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to read_text with args (PosixPath('/usr/local/lib/python3.12/site-packages/hahomematic/client/../rega_scripts/get_serial.fn'),) inside the event loop by custom integration 'homematicip_local' at custom_components/homematicip_local/control_unit.py, line 123: await self._central.start() (offender: /usr/local/lib/python3.12/site-packages/hahomematic/client/json_rpc.py, line 270: if script := Path(script_file).read_text(encoding=DEFAULT_ENCODING):), please create a bug report at https://github.com/danielperna84/hahomematic/issues
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#read_text
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 752, in async_setup_locked
    await self.async_setup(hass, integration=integration)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/homematicip_local/__init__.py", line 55, in async_setup_entry
    await control.start_central()
  File "/config/custom_components/homematicip_local/control_unit.py", line 218, in start_central
    await super().start_central()
  File "/config/custom_components/homematicip_local/control_unit.py", line 123, in start_central
    await self._central.start()

2024-09-12 21:21:14.937 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open with args (PosixPath('/usr/local/lib/python3.12/site-packages/hahomematic/client/../rega_scripts/get_serial.fn'),) inside the event loop by custom integration 'homematicip_local' at custom_components/homematicip_local/control_unit.py, line 123: await self._central.start() (offender: /usr/local/lib/python3.12/pathlib.py, line 1027: with self.open(mode='r', encoding=encoding, errors=errors) as f:), please create a bug report at https://github.com/danielperna84/hahomematic/issues
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 752, in async_setup_locked
    await self.async_setup(hass, integration=integration)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/homematicip_local/__init__.py", line 55, in async_setup_entry
    await control.start_central()
  File "/config/custom_components/homematicip_local/control_unit.py", line 218, in start_central
    await super().start_central()
  File "/config/custom_components/homematicip_local/control_unit.py", line 123, in start_central
    await self._central.start()

Describe the behavior you expected

No warnings / errors in log

Steps to reproduce the issue

What is the version this bug report is based on?

3.77.7.20240826

Which base platform are you running?

rpi3 (RaspberryPi3, ARM64/aarch64)

Which HomeMatic/homematicIP radio module are you using?

RPI-RF-MOD

Anything in the logs that might be useful for us?

See above

Additional information

I don't know if this is a regression or not - I inspected the logs cause of a different issue.

github-actions[bot] commented 5 days ago

@MSoegtropIMC, the issue you reported cannot be solved within this project or should be better directly solved in a third-party project RaspberryMatic just uses. So please consider creating an additional issue ticket in this third-party project. If still relevant we can keep this issue ticket open here for the time being so that you can use it as a reference in issue tickets for the third-party report.

jens-maus commented 5 days ago

Sorry, but I think the message in the error is quite clear:

...
 please report it to the author of the 'homematicip_local' custom integration
...

So please go ahead and report this to the authors of the homematicip_local integration and not RaspberryMatic.

MSoegtropIMC commented 5 days ago

@jens-maus : it is a bit confusing that there are 3 parties involved: RaspberryMatic, homematicip_local and home assistant. I can't say this is 100% clear to me how this is all connected. Is it so that the mechanisms to run RaspberryMatic under home assistant are maintained by you and that this additional plugin is just needed to allow to read/write values from RaspberryMatic in Home assistant?

jens-maus commented 5 days ago

That's the right place for your issue: https://github.com/danielperna84/hahomematic