Skip to content
← Back to activity

Immutable solution version

AttributeError: 'SyncHttpxClientWrapper' object has no attribute '_state'

Version 1

Complete solution

Covers this Agno problem: AttributeError: 'SyncHttpxClientWrapper' object has no attribute '_state'. If Agno throws AttributeError: 'SyncHttpxClientWrapper' object has no attribute '_state' when wrapping the OpenAI or Anthropic client, it is a version mismatch between httpx and the client SDK.

The problem

Issue agno-agi/agno#3523 (closed, 22 comments): ### Description

Performing web search... Exception ignored in: the function element (SyncHttpxClientWrapper.del at 0x758043ee4720) Traceback (most recent call last): File ".venv/lib/python3.11/site-packages/openai/baseclient.py", line 801, in del if self.isclosed: ^^^^^^^^^^^^^^ File ".venv/lib/python3.11/site-packages/httpx/client.py", line 202, in isclosed return self.state == ClientState.CLOSED ^^^^^^^^^^^ AttributeError: 'SyncHttpxClientWrapper' object has no attribute 'state' Exception ignored in: <function SyncHttpxClientWrapper.del_ at...

What fixed it

If Agno throws AttributeError: 'SyncHttpxClientWrapper' object has no attribute '_state' when wrapping the OpenAI or Anthropic client, it is a version mismatch between httpx and the client SDK. The fix that worked in the thread: pin httpx to 0.27.2 (pip install httpx==0.27.2); the Agno maintainer pinned that version in upcoming releases. If the error persists on 0.27.2, check for duplicate httpx installs in your environment (uv tree or pip list), since a stray httpx 0.28.1 copy reintroduces it.

Evidence

In gh:agno-agi/agno#3523 (Agno), the issue reported was: Issue agno-agi/agno#3523 (closed, 22 comments): ### Description

Performing web search... Exception ignored in: the function element (SyncHttpxClientWrapper.del at 0x758043ee4720) Traceback (most recent call last): File ".venv/lib/python3.11/site-packages/openai/baseclient.py", line 801, in del if self.isclosed: ^^^^^^^^^^^^^^ File ".venv/lib/python3.11/site-packages/httpx/client.py", line 202, in isclosed return self.state == ClientState.CLOSED ^^^^^^^^^^^ AttributeError: 'SyncHttpxClientWrapper' object has no attribute 'state' Exception ignored in: <function SyncHttpxClientWrapper.del at... The verified resolution from the thread: If Agno throws AttributeError: 'SyncHttpxClientWrapper' object has no attribute 'state' when wrapping the OpenAI or Anthropic client, it is a version mismatch between httpx and the client SDK. The fix that worked in the thread: pin httpx to 0.27.2 (pip install httpx==0.27.2); the Agno maintainer pinned that version in upcoming releases. If the error persists on 0.27.2, check for duplicate httpx installs in your environment (uv tree or pip list), since a stray httpx 0.28.1 copy reintroduces it. Source: mount the host path https at container path //github.com/agno-agi/agno/issues/3523

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_O7HP_uKVZOXXkIeUNxeI9w" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">AttributeError: &#39;SyncHttpxClientWrapper&#39; object has no attribute &#39;_state&#39; <span>— Vectle</span></a>

AttributeError: 'SyncHttpxClientWrapper' object has no attribute '_state' | Vectle