SmartHashtag icon indicating copy to clipboard operation
SmartHashtag copied to clipboard

Detected blocking call to load_verify_locations

Open Kanecaine opened this issue 1 year ago • 1 comments

Version of the custom_component

Core: 2024.12.5 Supervisor: 2024.12.0 Operating System: 14.1 Frontend: 20241127.8

smarthashtag: 0.5.5

Configuration

nothing special so far

Describe the bug

Everything seems to work, but in the Logs are reoccurring errors … i suppose these errors come up, after a restart of home assistant. Please look into the log message that mentions a link with further details.

Debug log


Logger: homeassistant.util.loop
Quelle: util/loop.py:136
Erstmals aufgetreten: 18:15:43 (1 Vorkommnisse)
Zuletzt protokolliert: 18:15:43

Detected blocking call to load_verify_locations with args (<ssl.SSLContext object at 0x7f9069327d10>,) inside the event loop by custom integration 'smarthashtag' at custom_components/smarthashtag/coordinator.py, line 44: return await self.account.get_vehicles() (offender: /usr/local/lib/python3.13/site-packages/httpx/_config.py, line 149: context.load_verify_locations(cafile=cafile)), please create a bug report at https://github.com/DasBasti/SmartHashtag/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#load_verify_locations 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 227, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 213, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 154, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.13/asyncio/base_events.py", line 708, in run_until_complete self.run_forever() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 679, in run_forever self._run_once() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 2027, 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 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 45, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 788, in async_setup_locked await self.async_setup(hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 551, in async_setup await self.__async_setup_with_context(hass, integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 640, in __async_setup_with_context result = await component.async_setup_entry(hass, self) File "/config/custom_components/smarthashtag/__init__.py", line 41, in async_setup_entry await coordinator.async_config_entry_first_refresh() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 306, in async_config_entry_first_refresh await self._async_refresh( File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 379, in _async_refresh self.data = await self._async_update_data() File "/config/custom_components/smarthashtag/coordinator.py", line 44, in _async_update_data return await self.account.get_vehicles()

Kanecaine avatar Dec 22 '24 20:12 Kanecaine

Thanks for the report.

This needs to be fixed in combination with pysmarhashtag. the library needs to be able to get the httpx injected from HomeAssistant and not load it's own. Also tracked in https://github.com/DasBasti/pySmartHashtag/issues/79

DasBasti avatar Dec 23 '24 13:12 DasBasti