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

Detected blocking call to open inside the event loop by custom integration 'hacs' #3774

Closed chemelli74 closed 3 weeks ago

chemelli74 commented 3 weeks ago

System Health details

System Information

version core-2024.7.0.dev202406100220
installation_type Home Assistant Container
dev true
hassio false
docker true
user root
virtualenv false
python_version 3.12.2
os_name Linux
os_version 4.4.302+
arch x86_64
timezone Europe/Rome
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4314 Installed Version | 1.34.0 Stage | running Available Repositories | 1390 Downloaded Repositories | 29
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Dashboards dashboards | 2 -- | -- resources | 17 views | 20 mode | storage
Recorder oldest_recorder_run | June 9, 2024 at 6:12 PM -- | -- current_recorder_run | June 10, 2024 at 9:40 AM estimated_db_size | 45.92 MiB database_engine | sqlite database_version | 3.45.3

Checklist

Describe the issue

Detected blocking call to open inside the event loop by custom integration 'hacs': zip_file.extractall(self.content.path.local)

Reproduction steps

  1. Update HA to latest dev build
  2. Install HACS
  3. Enabled HACS
  4. Check logs

Debug logs

2024-06-10 09:38:06.360 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open inside the event loop by custom integration 'hacs' at custom_components/hacs/repositories/base.py, line 600: zip_file.extractall(self.content.path.local) (offender: /usr/local/lib/python3.12/zipfile/__init__.py, line 1790: open(targetpath, "wb") as target:), please create a bug report at https://github.com/hacs/integration/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/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await func(hass, connection, msg)
  File "/config/custom_components/hacs/websocket/repository.py", line 234, in hacs_repository_download
    await repository.async_install()
  File "/config/custom_components/hacs/repositories/base.py", line 893, in async_install
    await self.async_install_repository(version=version)
  File "/config/custom_components/hacs/repositories/base.py", line 975, in async_install_repository
    await self.download_zip_files(self.validate)
  File "/config/custom_components/hacs/repositories/base.py", line 566, in download_zip_files
  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/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await repository.async_install()
  File "/config/custom_components/hacs/repositories/base.py", line 893, in async_install
    await self.async_install_repository(version=version)
  File "/config/custom_components/hacs/repositories/base.py", line 975, in async_install_repository
    await self.download_zip_files(self.validate)
    await self.async_download_zip_file(
  File "/config/custom_components/hacs/repositories/base.py", line 600, in async_download_zip_file
    zip_file.extractall(self.content.path.local)

Diagnostics dump

No response

hacs-bot[bot] commented 3 weeks 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: