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

EasyEnergy: Detected blocking call to listdir #120745

Closed
Mariusthvdb opened this issue Jun 28, 2024 · 1 comment · Fixed by #120753
Closed

EasyEnergy: Detected blocking call to listdir #120745

Mariusthvdb opened this issue Jun 28, 2024 · 1 comment · Fixed by #120753

Comments

@Mariusthvdb
Copy link
Contributor

Mariusthvdb commented Jun 28, 2024

The problem

see logs

What version of Home Assistant Core has the issue?

2024.6.0b03

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

EasyEnergy

Link to integration documentation on our website

https://www.home-assistant.io/integrations/easyenergy/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-06-28 12:10:13.546 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to listdir with args ('/config/deps/lib/python3.12/site-packages',) inside the event loop by integration 'easyenergy' at homeassistant/components/easyenergy/coordinator.py, line 60: gas_today = await self.easyenergy.gas_prices( (offender: /usr/local/lib/python3.12/importlib/metadata/__init__.py, line 680: return os.listdir(self.root or '.')), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+easyenergy%22

and from Dashboard log:

Logger: homeassistant.util.loop
Bron: util/loop.py:86
Eerst voorgekomen: 12:00:52 (987 gebeurtenissen)
Laatst gelogd: 13:10:13

Detected blocking call to listdir with args ('/usr/local/lib/python312.zip',) inside the event loop by integration 'easyenergy' at homeassistant/components/easyenergy/services.py, line 142: data = await coordinator.easyenergy.energy_prices( (offender: /usr/local/lib/python3.12/importlib/metadata/__init__.py, line 680: return os.listdir(self.root or '.')), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+easyenergy%22 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 1982, 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/helpers/event.py", line 1495, in __call__ self.hass.async_run_hass_job(self.job, self.utc_point_in_time) File "/usr/src/homeassistant/homeassistant/core.py", line 938, in async_run_hass_job hassjob.target(*args) File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1808, in _pattern_time_change_listener hass.async_run_hass_job(self.job, localized_now, background=True) File "/usr/src/homeassistant/homeassistant/core.py", line 938, in async_run_hass_job hassjob.target(*args) File "/usr/src/homeassistant/homeassistant/components/homeassistant/triggers/time_pattern.py", line 86, in time_automation_listener hass.async_run_hass_job( File "/usr/src/homeassistant/homeassistant/core.py", line 941, in async_run_hass_job return self._async_add_hass_job(hassjob, *args, background=background) File "/usr/src/homeassistant/homeassistant/core.py", line 756, in _async_add_hass_job task = create_eager_task( File "/usr/src/homeassistant/homeassistant/util/async_.py", line 37, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/components/template/coordinator.py", line 98, in _handle_triggered_with_script if script_result := await self._script.async_run(run_variables, script_context): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1770, in async_run return await asyncio.shield(create_eager_task(run.async_run())) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 37, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 465, in async_run await self._async_step(log_exceptions=False) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 527, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 765, in _async_call_service_step self._hass.async_create_task_internal( File "/usr/src/homeassistant/homeassistant/core.py", line 830, in async_create_task_internal task = create_eager_task(target, name=name, loop=self.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 37, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/core.py", line 2731, in async_call response_data = await coro File "/usr/src/homeassistant/homeassistant/core.py", line 2774, in _execute_service return await target(service_call) File "/usr/src/homeassistant/homeassistant/components/easyenergy/services.py", line 142, in __get_prices data = await coordinator.easyenergy.energy_prices(
Detected blocking call to listdir with args ('/config/deps/lib/python3.12/site-packages',) inside the event loop by integration 'easyenergy' at homeassistant/components/easyenergy/coordinator.py, line 56: energy_today = await self.easyenergy.energy_prices( (offender: /usr/local/lib/python3.12/importlib/metadata/__init__.py, line 680: return os.listdir(self.root or '.')), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+easyenergy%22 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 1982, 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/helpers/update_coordinator.py", line 239, in __wrap_handle_refresh_interval self.config_entry.async_create_background_task( File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1156, in async_create_background_task task = hass.async_create_background_task(target, name, eager_start) File "/usr/src/homeassistant/homeassistant/core.py", line 862, in async_create_background_task task = create_eager_task(target, name=name, loop=self.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 37, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 255, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/easyenergy/coordinator.py", line 56, in _async_update_data energy_today = await self.easyenergy.energy_prices(
Detected blocking call to listdir with args ('/usr/local/lib/python312.zip',) inside the event loop by integration 'easyenergy' at homeassistant/components/easyenergy/coordinator.py, line 56: energy_today = await self.easyenergy.energy_prices( (offender: /usr/local/lib/python3.12/importlib/metadata/__init__.py, line 680: return os.listdir(self.root or '.')), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+easyenergy%22 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 1982, 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/helpers/update_coordinator.py", line 239, in __wrap_handle_refresh_interval self.config_entry.async_create_background_task( File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1156, in async_create_background_task task = hass.async_create_background_task(target, name, eager_start) File "/usr/src/homeassistant/homeassistant/core.py", line 862, in async_create_background_task task = create_eager_task(target, name=name, loop=self.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 37, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 255, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/easyenergy/coordinator.py", line 56, in _async_update_data energy_today = await self.easyenergy.energy_prices(
Detected blocking call to listdir with args ('/config/deps/lib/python3.12/site-packages',) inside the event loop by integration 'easyenergy' at homeassistant/components/easyenergy/coordinator.py, line 60: gas_today = await self.easyenergy.gas_prices( (offender: /usr/local/lib/python3.12/importlib/metadata/__init__.py, line 680: return os.listdir(self.root or '.')), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+easyenergy%22 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 1982, 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/helpers/update_coordinator.py", line 255, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/easyenergy/coordinator.py", line 60, in _async_update_data gas_today = await self.easyenergy.gas_prices(
Detected blocking call to listdir with args ('/usr/local/lib/python312.zip',) inside the event loop by integration 'easyenergy' at homeassistant/components/easyenergy/coordinator.py, line 60: gas_today = await self.easyenergy.gas_prices( (offender: /usr/local/lib/python3.12/importlib/metadata/__init__.py, line 680: return os.listdir(self.root or '.')), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+easyenergy%22 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 1982, 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/helpers/update_coordinator.py", line 255, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/easyenergy/coordinator.py", line 60, in _async_update_data gas_today = await self.easyenergy.gas_prices(

Additional information

No response

@home-assistant
Copy link

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

Code owner commands

Code owners of easyenergy 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 easyenergy 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)


easyenergy documentation
easyenergy source
(message by IssueLinks)

@Mariusthvdb Mariusthvdb changed the title EWasyEnergy: Detected blocking call to listdir EasyEnergy: Detected blocking call to listdir Jun 28, 2024
@bdraco bdraco added this to the 2024.7.0 milestone Jun 28, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants