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
70.48k stars 29.41k forks source link

Detected blocking call in freebox #120094

Open totoantibes opened 1 month ago

totoantibes commented 1 month ago

The problem

extract from core 2024.6.33 Logger: homeassistant.util.loop Source: util/loop.py:84 First occurred: 2:21:23 PM (4 occurrences) Last logged: 2:21:30 PM

Detected blocking call to open inside the event loop by integration 'freebox' at homeassistant/components/freebox/__init__.py, line 26: await api.open(entry.data[CONF_HOST], entry.data[CONF_PORT]) (offender: /usr/local/lib/python3.12/site-packages/freebox_api/aiofreepybox.py, line 255: with open(file, "r") as f:), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+freebox%22 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/setup.py", line 165, in async_setup_component result = await _async_setup_component(hass, domain, config) File "/usr/src/homeassistant/homeassistant/setup.py", line 447, in _async_setup_component await asyncio.gather( File "/usr/src/homeassistant/homeassistant/setup.py", line 449, in <genexpr> 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/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 "/usr/src/homeassistant/homeassistant/components/freebox/__init__.py", line 26, in async_setup_entry await api.open(entry.data[CONF_HOST], entry.data[CONF_PORT])

What version of Home Assistant Core has the issue?

core-2024.6.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

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

home-assistant[bot] commented 1 month ago

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

Code owner commands Code owners of `freebox` 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 freebox` 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)


freebox documentation freebox source (message by IssueLinks)

ALaDoffe commented 1 month ago

Same Issue with freebox mini 4K

cchristofr commented 1 month ago

The same with freebox pop

` i.open(entry.data[CONF_HOST], entry.data[CONF_PORT]) (offender: /usr/local/lib/python3.12/site-packages/freebox_api/aiofreepybox.py, line 255: with open(file, "r") as f:), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+freebox%22

For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open

Traceback (most recent call last):

File "", line 198, in _run_module_as_main

File "", line 88, in _run_code

File "/usr/src/homeassistant/homeassistant/main.py", line 223, in

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/src/homeassistant/homeassistant/setup.py", line 167, in async_setup_component

result = await _async_setup_component(hass, domain, config)

File "/usr/src/homeassistant/homeassistant/setup.py", line 449, in _async_setup_component

await asyncio.gather(

File "/usr/src/homeassistant/homeassistant/setup.py", line 451, in

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/config_entries.py", line 734, 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 "/usr/src/homeassistant/homeassistant/components/freebox/init.py", line 26, in async_setup_entry

await api.open(entry.data[CONF_HOST], entry.data[CONF_PORT])

2024-07-14 19:43:01.352 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' calls hass.http.register_static_path which is deprecated because it does blocking I/O in the event loop, instead call await hass.http.async_register_static_paths([StaticPathConfig("/hacsfiles/frontend", "/config/custom_components/hacs/hacs_frontend", False)]); This function will be removed in 2025.7 at custom_components/hacs/frontend.py, line 54: hass.http.register_static_path(f"{URL_BASE}/frontend", locate_dir(), cache_headers=False), please create a bug report at https://github.com/hacs/integration/issues

2024-07-14 19:43:01.359 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' calls hass.http.register_static_path which is deprecated because it does blocking I/O in the event loop, instead call await hass.http.async_register_static_paths([StaticPathConfig("/hacsfiles/iconset.js", "/config/custom_components/hacs/iconset.js", True)]); This function will be removed in 2025.7 at custom_components/hacs/frontend.py, line 57: hass.http.register_static_path(, please create a bug report at https://github.com/hacs/integration/issues

2024-07-14 19:43:01.367 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.components.frontend. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to import functions used from frontend directly at custom_components/hacs/frontend.py, line 68: hass.components.frontend.async_register_built_in_panel(, please create a bug report at https://github.com/hacs/integration/issues

2024-07-14 19:43:01.381 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' calls hass.http.register_static_path which is deprecated because it does blocking I/O in the event loop, instead call await hass.http.async_register_static_paths([StaticPathConfig("/hacsfiles", "/config/www/community", True)]); This function will be removed in 2025.7 at custom_components/hacs/base.py, line 1162: self.hass.http.register_static_path(, please create a bug report at https://github.com/hacs/integration/issues

2024-07-14 19:43:01.753 WARNING (MainThread) [homeassistant.components.freebox.router] Home access is not granted

2024-07-14 19:43:03.056 WARNING (zeroconf-ServiceBrowser-_googlecast._tcp-110) [pychromecast.dial] Failed to determine cast type for host (<urlopen error [Errno -2] Name does not resolve>) (services:{MDNSServiceInfo(name='Freebox-Player-POP-830a7c7ba34f4c4a98c9d1155838c2cf._googlecast._tcp.local.')}) `

zen2 commented 3 weeks ago

Same issue with freebox ultra.

RemiG26 commented 15 hours ago

Also on Delta with HA 2024.8.2:

Enregistreur: homeassistant.util.loop
Source: util/loop.py:136
S'est produit pour la première fois: 18:17:16 (1 occurrences)
Dernier enregistrement: 18:17:16

Detected blocking call to open with args (PosixPath('/config/.storage/freebox/2dsralcq_fbxos_fr.conf'), 'r') inside the event loop by integration 'freebox' at homeassistant/components/freebox/__init__.py, line 26: await api.open(entry.data[CONF_HOST], entry.data[CONF_PORT]) (offender: /usr/local/lib/python3.12/site-packages/freebox_api/aiofreepybox.py, line 255: with open(file, "r") as f:), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+freebox%22 For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open 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/src/homeassistant/homeassistant/setup.py", line 165, in async_setup_component result = await _async_setup_component(hass, domain, config) File "/usr/src/homeassistant/homeassistant/setup.py", line 461, in _async_setup_component await asyncio.gather( File "/usr/src/homeassistant/homeassistant/setup.py", line 463, in <genexpr> 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/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 604, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/freebox/__init__.py", line 26, in async_setup_entry await api.open(entry.data[CONF_HOST], entry.data[CONF_PORT])