Skip to content

Blocking call to load_verify_locations in event loop #66

@Pronoid2001

Description

@Pronoid2001

I am experiencing a "blocking call" issue with the Greenely custom integration on Home Assistant. This is causing stability issues and performance degradation in my system (specifically affecting my Bluetooth/Plejd mesh due to the event loop being blocked).

Environment:
• Home Assistant Version: 2026.1.2
• Python Version: 3.13
• Hardware: Raspberry Pi 3 Model B

Description:
The integration is performing a synchronous httpx.get call inside the async event loop during check_auth. According to the Home Assistant developer guidelines, this should be offloaded to an executor or replaced with an asynchronous request (e.g., using httpx.AsyncClient or aiohttp).
Thank you!

Log:
Loggare: homeassistant.util.loop
Källa: util/loop.py:137
Inträffade först: 22:18:28 (1 förekomst)
Senast loggade: 22:18:28

Detected blocking call to load_verify_locations with args (<ssl.SSLContext object at 0x7f897dd3b0>, '/usr/local/lib/python3.13/site-packages/certifi/cacert.pem', None, None) inside the event loop by custom integration 'greenely' at custom_components/greenely/api.py, line 196: result = httpx.get(self._url_check_auth, headers=self._headers) (offender: /usr/local/lib/python3.13/ssl.py, line 717: context.load_verify_locations(cafile, capath, cadata)), please create a bug report at https://github.com/linsvensson/sensor.greenely/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#load_verify_locations 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 229, in sys.exit(main()) File "/usr/src/homeassistant/homeassistant/main.py", line 215, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 289, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.13/asyncio/base_events.py", line 712, in run_until_complete self.run_forever() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 683, in run_forever self._run_once() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 2050, in _run_once handle._run() File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run self._context.run(self._callback, *self._args) File "/usr/src/homeassistant/homeassistant/setup.py", line 170, in async_setup_component result = await _async_setup_component(hass, domain, config) File "/usr/src/homeassistant/homeassistant/setup.py", line 470, in async_setup_component await asyncio.gather( File "/usr/src/homeassistant/homeassistant/setup.py", line 472, in create_eager_task( File "/usr/src/homeassistant/homeassistant/util/async.py", line 44, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 928, in async_setup_locked await self.async_setup(hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 672, in async_setup await self.__async_setup_with_context(hass, integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 762, in __async_setup_with_context result = await component.async_setup_entry(hass, self) File "/config/custom_components/greenely/init.py", line 39, in async_setup_entry if api.check_auth(): File "/config/custom_components/greenely/api.py", line 196, in check_auth result = httpx.get(self._url_check_auth, headers=self._headers)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions