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.97k stars 31.01k forks source link

Detected blocking call to load_verify_locations with args (<ssl.SSLContext object at 0x7f83c1faf250>,) inside the event loop by integration 'anthropic' #128368

Open allenporter opened 1 month ago

allenporter commented 1 month ago

The problem

When creating the integration get the error message: 2024-10-14 07:09:57.426 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to load_verify_locations with args (<ssl.SSLContext object at 0x7f83c1faf250>,) inside the event loop by integration 'anthropic' at homeassistant/components/anthropic/config_flow.py, line 62: client = anthropic.AsyncAnthropic(api_key=data[CONF_API_KEY])

What version of Home Assistant Core has the issue?

core-2024.10.2

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

Anthropic Conversation

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-10-14 07:09:57.426 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to load_verify_locations with args (<ssl.SSLContext object at 0x7f83c1faf250>,) inside the event loop by integration 'anthropic' at homeassistant/components/anthropic/config_flow.py, line 62: client = anthropic.AsyncAnthropic(api_key=data[CONF_API_KEY]) (offender: /usr/local/lib/python3.12/site-packages/httpx/_config.py, line 149: context.load_verify_locations(cafile=cafile)), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+anthropic%22


### Additional information

_No response_
home-assistant[bot] commented 1 month ago

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

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


anthropic documentation anthropic source (message by IssueLinks)

Nardol commented 5 days ago

I also have this message on each Home Assistant startup:

2024-11-20 13:57:29.702 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to load_verify_locations with args (<ssl.SSLContext object at 0xffff5651d5d0>,) inside the event loop by integration 'anthropic' at homeassistant/components/anthropic/__init__.py, line 23: client = anthropic.AsyncAnthropic(api_key=entry.data[CONF_API_KEY]) (offender: /srv/homeassistant/lib/python3.12/site-packages/httpx/_config.py, line 149: context.load_verify_locations(cafile=cafile)), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+anthropic%22
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#load_verify_locations
Traceback (most recent call last):
  File "/srv/homeassistant/bin/hass", line 8, in <module>
    sys.exit(main())
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/runner.py", line 189, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/lib/python3.12/asyncio/base_events.py", line 673, in run_until_complete
    self.run_forever()
  File "/usr/lib/python3.12/asyncio/base_events.py", line 640, in run_forever
    self._run_once()
  File "/usr/lib/python3.12/asyncio/base_events.py", line 1992, in _run_once
    handle._run()
  File "/usr/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/setup.py", line 165, in async_setup_component
    result = await _async_setup_component(hass, domain, config)
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/setup.py", line 461, in _async_setup_component
    await asyncio.gather(
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/setup.py", line 463, in <genexpr>
    create_eager_task(
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/util/async_.py", line 45, in create_eager_task
    return Task(coro, loop=loop, name=name, eager_start=True)
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/config_entries.py", line 783, in async_setup_locked
    await self.async_setup(hass, integration=integration)
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/config_entries.py", line 546, in async_setup
    await self.__async_setup_with_context(hass, integration)
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/config_entries.py", line 635, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/anthropic/__init__.py", line 23, in async_setup_entry
    client = anthropic.AsyncAnthropic(api_key=entry.data[CONF_API_KEY])