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

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

Closed
2 tasks done
siw1973 opened this issue Jun 20, 2024 · 5 comments · Fixed by #434
Closed
2 tasks done

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

siw1973 opened this issue Jun 20, 2024 · 5 comments · Fixed by #434
Labels
Bug: Confirmed! Something isn't working Bug Version 2

Comments

@siw1973
Copy link

siw1973 commented Jun 20, 2024

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 siw1973 added Bug Version 2 wait in examination labels Jun 20, 2024
Copy link
Contributor

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

@github-actions github-actions bot added the check for Bug it is checked whether there is an Bug label Jun 20, 2024
Copy link
Contributor

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.

@Ludy87
Copy link
Owner

Ludy87 commented Jun 20, 2024

Please set in your configuration.yaml and try again

homeassistant:
  allowlist_external_dirs:
    - "/config"

@siw1973
Copy link
Author

siw1973 commented Jun 20, 2024

See this for other Integration where fix is being tested :

LaggAt/hacs-govee#167

@Ludy87 Ludy87 added the Bug: Confirmed! Something isn't working label Jun 20, 2024
Copy link
Contributor

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

@github-actions github-actions bot added in progress and removed check for Bug it is checked whether there is an Bug labels Jun 20, 2024
@Ludy87 Ludy87 removed wait in examination in progress labels Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Confirmed! Something isn't working Bug Version 2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants