Ludy87 / xplora_watch

Xplora® Watch Home Assistant Integration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[homeassistant.util.loop] Detected blocking call to open inside the event loop

siw1973 opened this issue · comments

What version of Integration has the issue?

v2.13.10

System Health details

System information
Version core-2024.6.3
Installation Type Home Assistant OS
Development false
Supervisor true
Docker true
User root
Virtual Environment false
Python Version 3.12.2
Operating System Family Linux
Operating System Version 6.6.29-haos
CPU Architecture x86_64
Timezone Europe/London
Configuration Directory /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 5000
Installed Version 1.34.0
Stage running
Available Repositories 1402
Downloaded Repositories 25
HACS Data ok
AccuWeather
Reach AccuWeather server ok
Remaining allowed requests 19
Home Assistant Cloud
Logged In false
Reach Certificate Server ok
Reach Authentication Server ok
Reach Home Assistant Cloud ok
Home Assistant Supervisor
Host Operating System Home Assistant OS 12.3
Update Channel stable
Supervisor Version supervisor-2024.06.0
Agent Version 1.6.0
Docker Version 25.0.5
Disk Total 30.8 GB
Disk Used 24.4 GB
Healthy true
Supported true
host_connectivity true
supervisor_connectivity true
ntp_synchronized true
virtualization vmware
Board ova
Supervisor API ok
Version API ok
Installed Add-ons Z-Wave JS (0.6.0), Studio Code Server (5.15.0), Node-RED (17.0.13), SharpTools.io (1.0.9), RTSP Simple Server Add-on (v0.17.6), Grafana (10.0.0), Simple Scheduler (2.5), Terminal & SSH (9.14.0), eufy-security-ws (1.8.0-2), InfluxDB (5.0.0), Z-Wave JS UI (3.8.0), Portainer (2.20.1), Whatsapper (2024.1.30), Mosquitto broker (6.4.1)
Dashboards
Dashboards 6
Resources 11
Views 23
Mode storage
Recorder
Oldest Run Start Time June 13, 2024 at 1:12 PM
Current Run Start Time June 20, 2024 at 10:45 AM
Estimated Database Size (MiB) 1374.04 MiB
Database Engine sqlite
Database Version 3.44.2
Spotify
Spotify API endpoint reachable ok
Core metrics
Processor usage
2.6 %
Memory usage
19.7 %
Supervisor metrics
Processor usage
0.1 %
Memory usage
3.3 %

Checklist

  • I have enabled debug logging for my installation.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).

Describe the issue

Log files show following error (as do a number of other custom integrations) :

2024-06-20 10:45:34.758 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open inside the event loop by custom integration 'xplora_watch' at custom_components/xplora_watch/helper.py, line 125: yaml_service = load_yaml(path) (offender: /usr/src/homeassistant/homeassistant/util/yaml/loader.py, line 226: with open(fname, encoding="utf-8") as conf_file:), please create a bug report at https://github.com/Ludy87/xplora_watch/issues
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 190, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, 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 742, in async_setup_locked
    await self.async_setup(hass, integration=integration)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/xplora_watch/__init__.py", line 63, in async_setup_entry
    await create_service_yaml_file(hass, entry, watches)
  File "/config/custom_components/xplora_watch/helper.py", line 125, in create_service_yaml_file
    yaml_service = load_yaml(path)
2024-06-20 10:45:34.758 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open inside the event loop by custom integration 'xplora_watch' at custom_components/xplora_watch/helper.py, line 125: yaml_service = load_yaml(path) (offender: /usr/src/homeassistant/homeassistant/util/yaml/loader.py, line 226: with open(fname, encoding="utf-8") as conf_file:), please create a bug report at https://github.com/Ludy87/xplora_watch/issues
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 190, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, 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 742, in async_setup_locked
    await self.async_setup(hass, integration=integration)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/xplora_watch/__init__.py", line 63, in async_setup_entry
    await create_service_yaml_file(hass, entry, watches)
  File "/config/custom_components/xplora_watch/helper.py", line 125, in create_service_yaml_file
    yaml_service = load_yaml(path)

Reproduction steps

Start Home Assistant

Debug logs

2024-06-20 10:45:34.758 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open inside the event loop by custom integration 'xplora_watch' at custom_components/xplora_watch/helper.py, line 125: yaml_service = load_yaml(path) (offender: /usr/src/homeassistant/homeassistant/util/yaml/loader.py, line 226: with open(fname, encoding="utf-8") as conf_file:), please create a bug report at https://github.com/Ludy87/xplora_watch/issues
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 190, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, 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 742, in async_setup_locked
    await self.async_setup(hass, integration=integration)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/xplora_watch/__init__.py", line 63, in async_setup_entry
    await create_service_yaml_file(hass, entry, watches)
  File "/config/custom_components/xplora_watch/helper.py", line 125, in create_service_yaml_file
    yaml_service = load_yaml(path)
2024-06-20 10:45:34.758 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open inside the event loop by custom integration 'xplora_watch' at custom_components/xplora_watch/helper.py, line 125: yaml_service = load_yaml(path) (offender: /usr/src/homeassistant/homeassistant/util/yaml/loader.py, line 226: with open(fname, encoding="utf-8") as conf_file:), please create a bug report at https://github.com/Ludy87/xplora_watch/issues
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 190, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, 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 742, in async_setup_locked
    await self.async_setup(hass, integration=integration)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/xplora_watch/__init__.py", line 63, in async_setup_entry
    await create_service_yaml_file(hass, entry, watches)
  File "/config/custom_components/xplora_watch/helper.py", line 125, in create_service_yaml_file
    yaml_service = load_yaml(path)

👋 @siw1973, it is checked whether there is a bug. Please have some patience.
This action was performed automatically.

Thanks for opening this issue!
I have applied any labels matching special text in your title and description.

@Ludy87: Please review the labels and make any necessary changes.

commented

Please set in your configuration.yaml and try again

homeassistant:
  allowlist_external_dirs:
    - "/config"

See this for other Integration where fix is being tested :

LaggAt/hacs-govee#167

👋 @siw1973, we found the bug, it will be fixed shortly.
This action was performed automatically.