home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.63k stars 30.78k forks source link

Detected blocking call to listdir with args #120590

Closed philipp-frank closed 4 months ago

philipp-frank commented 4 months ago

The problem

Logger: homeassistant.util.loop Quelle: util/loop.py:51 Erstmals aufgetreten: 19:00:29 (2 Vorkommnisse) Zuletzt protokolliert: 19:00:29

Detected blocking call to listdir with args ('/config/deps/lib/python3.12/site-packages',) in /usr/local/lib/python3.12/importlib/metadata/__init__.py, line 680: return os.listdir(self.root or '.') inside the event loop; This is causing stability issues. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#listdir 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 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/local/lib/python3.12/site-packages/zigpy/backups.py", line 220, in _backup_loop await self.create_backup() File "/usr/local/lib/python3.12/site-packages/zigpy/backups.py", line 143, in create_backup await self.app.load_network_info(load_devices=load_devices) File "/usr/local/lib/python3.12/site-packages/zigpy_deconz/zigbee/application.py", line 323, in load_network_info f"zigpy-deconz@{importlib.metadata.version('zigpy-deconz')}" File "/usr/local/lib/python3.12/importlib/metadata/__init__.py", line 889, in version return distribution(distribution_name).version File "/usr/local/lib/python3.12/importlib/metadata/__init__.py", line 862, in distribution return Distribution.from_name(distribution_name) File "/usr/local/lib/python3.12/importlib/metadata/__init__.py", line 397, in from_name return next(cls.discover(name=name)) File "/usr/local/lib/python3.12/importlib/metadata/__init__.py", line 795, in <genexpr> path.search(prepared) for path in map(FastPath, paths) File "/usr/local/lib/python3.12/importlib/metadata/__init__.py", line 693, in search return self.lookup(self.mtime).search(name) File "/usr/local/lib/python3.12/importlib/metadata/__init__.py", line 703, in lookup return Lookup(self) File "/usr/local/lib/python3.12/importlib/metadata/__init__.py", line 713, in __init__ for child in path.children(): File "/usr/local/lib/python3.12/importlib/metadata/__init__.py", line 680, in children return os.listdir(self.root or '.')
Detected blocking call to listdir with args ('/usr/local/lib/python312.zip',) in /usr/local/lib/python3.12/importlib/metadata/__init__.py, line 680: return os.listdir(self.root or '.') inside the event loop; This is causing stability issues. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#listdir 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 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/local/lib/python3.12/site-packages/zigpy/backups.py", line 220, in _backup_loop await self.create_backup() File "/usr/local/lib/python3.12/site-packages/zigpy/backups.py", line 143, in create_backup await self.app.load_network_info(load_devices=load_devices) File "/usr/local/lib/python3.12/site-packages/zigpy_deconz/zigbee/application.py", line 323, in load_network_info f"zigpy-deconz@{importlib.metadata.version('zigpy-deconz')}" File "/usr/local/lib/python3.12/importlib/metadata/__init__.py", line 889, in version return distribution(distribution_name).version File "/usr/local/lib/python3.12/importlib/metadata/__init__.py", line 862, in distribution return Distribution.from_name(distribution_name) File "/usr/local/lib/python3.12/importlib/metadata/__init__.py", line 397, in from_name return next(cls.discover(name=name)) File "/usr/local/lib/python3.12/importlib/metadata/__init__.py", line 795, in <genexpr> path.search(prepared) for path in map(FastPath, paths) File "/usr/local/lib/python3.12/importlib/metadata/__init__.py", line 693, in search return self.lookup(self.mtime).search(name) File "/usr/local/lib/python3.12/importlib/metadata/__init__.py", line 703, in lookup return Lookup(self) File "/usr/local/lib/python3.12/importlib/metadata/__init__.py", line 713, in __init__ for child in path.children(): File "/usr/local/lib/python3.12/importlib/metadata/__init__.py", line 680, in children return os.listdir(self.root or '.')

What version of Home Assistant Core has the issue?

2024.7.0b0

What was the last working version of Home Assistant Core?

2024.6.4

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

mib1185 commented 4 months ago

is this a duplicate of #120589?

TheJulianJES commented 4 months ago

Possibly. Likely already fixed with https://github.com/home-assistant/core/pull/120581. Please test 2024.7.0b1 when it's out.

home-assistant[bot] commented 4 months ago

Hey there @dmulcahey, @adminiuga, @puddly, mind taking a look at this issue as it has been labeled with an integration (zha) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `zha` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign zha` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


zha documentation zha source (message by IssueLinks)

puddly commented 4 months ago

https://github.com/home-assistant/core/pull/120581 resolves this issue.

philipp-frank commented 4 months ago

Fixed. Thank you.