Failure Index / Rate limits & availability · critical · LangChain · OpenAI Agents SDK · CrewAI

Agent tool fails: connection refused / reset

The agent couldn't even reach the service — the connection was refused or dropped. Frequent with self-hosted dependencies (vector DBs, internal APIs) that went down or moved.

The error

ConnectionRefusedError agent tool
connection reset by peer langchain
agent ECONNREFUSED

Root cause

The target service is down, the URL/port in the tool's config is wrong or stale, or a firewall/DNS change broke the path. In containerized setups: the service name resolves differently between environments (localhost vs service DNS).

The fix

Verify the URL the tool actually uses (log it), confirm the service is up and listening, and check environment-specific config — the classic bug is localhost baked into production config.

Preventing it next time

Keep tool endpoints in per-environment config with startup health checks, so the agent fails fast at boot instead of mid-run.

Stop debugging this by hand. Vorlo watches your agent and, when this failure happens, hands you the diagnosis and the fix — verified by developers who hit it before you — in your dashboard, Slack, or your editor. Two lines of code: pip install vorlo-trace · npm install vorlo-trace. Start free

Related failures