hacs / integration

HACS gives you a powerful UI to handle downloads of all your custom needs.
https://hacs.xyz
MIT License
4.87k stars 1.22k forks source link

Blocking stat call in async_setup_frontend_endpoint_plugin #3802

Closed bdraco closed 1 week ago

bdraco commented 1 week ago

System Health details

n/a

Checklist

Describe the issue

2024-06-21 11:35:49.141 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to stat with args ('/config/www/community',) inside the event loop by custom integration 'hacs' at custom_components/hacs/base.py, line 1149: if self.status.active_frontend_endpoint_plugin or not os.path.exists( (offender: <frozen genericpath>, line 19: ?), please create a bug report at https://github.com/hacs/integration/issues
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#stat
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 752, in async_setup_locked
    await self.async_setup(hass, integration=integration)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 586, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/hacs/__init__.py", line 246, in async_setup_entry
    setup_result = await async_initialize_integration(hass=hass, config_entry=config_entry)
  File "/config/custom_components/hacs/__init__.py", line 214, in async_initialize_integration
    await async_try_startup()
  File "/config/custom_components/hacs/__init__.py", line 201, in async_try_startup
    startup_result = await async_startup()
  File "/config/custom_components/hacs/__init__.py", line 170, in async_startup
    async_register_frontend(hass, hacs)
  File "/config/custom_components/hacs/frontend.py", line 85, in async_register_frontend
    hacs.async_setup_frontend_endpoint_plugin()
  File "/config/custom_components/hacs/base.py", line 1149, in async_setup_frontend_endpoint_plugin
    if self.status.active_frontend_endpoint_plugin or not os.path.exists(

Reproduction steps

startup

Debug logs

2024-06-21 11:35:49.141 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to stat with args ('/config/www/community',) inside the event loop by custom integration 'hacs' at custom_components/hacs/base.py, line 1149: if self.status.active_frontend_endpoint_plugin or not os.path.exists( (offender: <frozen genericpath>, line 19: ?), please create a bug report at https://github.com/hacs/integration/issues
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#stat
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 752, in async_setup_locked
    await self.async_setup(hass, integration=integration)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 586, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/hacs/__init__.py", line 246, in async_setup_entry
    setup_result = await async_initialize_integration(hass=hass, config_entry=config_entry)
  File "/config/custom_components/hacs/__init__.py", line 214, in async_initialize_integration
    await async_try_startup()
  File "/config/custom_components/hacs/__init__.py", line 201, in async_try_startup
    startup_result = await async_startup()
  File "/config/custom_components/hacs/__init__.py", line 170, in async_startup
    async_register_frontend(hass, hacs)
  File "/config/custom_components/hacs/frontend.py", line 85, in async_register_frontend
    hacs.async_setup_frontend_endpoint_plugin()
  File "/config/custom_components/hacs/base.py", line 1149, in async_setup_frontend_endpoint_plugin
    if self.status.active_frontend_endpoint_plugin or not os.path.exists(


### Diagnostics dump

_No response_
hacs-bot[bot] commented 1 week ago

Make sure you have read the issue guidelines and that you filled out the entire template.

If you have an issue identical to this, do not add comments like "same here", "i have this too", instead add a :+1: reaction to the issue description. Thanks! :+1:

bdraco commented 1 week ago

nevermind, its already fixed but not yet released

sorry for the noise.

thanks for fixing the one with registering static paths