[BUG] API Error: Connection refused — a firewall or proxy may be blocking it (ECONNREFUSED)

Status Fixed / completed
Reported on v2.1.281
Maintainer reply None cached
Activity 1 comment · opened Sep 23, 2026 · closed Oct 1, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Windows, Claude Code 2.1.281 (npm com claude.exe nativo), curl e Node OK, conexões TCP abertas via IPv6 e log com "Connection error"

message: API Error: Connection refused — a firewall or proxy may be blocking it (ECONNREFUSED)

What Should Happen?

Any message I send results in an ECONNREFUSED error.

Error Messages/Logs

$ ls -t ~/.claude/debug | head -3
7ea312c3-5942-43c2-b457-db72fe584d27.txt
188e8481-6508-466c-9a7a-1bdaba1ea0e3.txt
b85977ee-31b9-4946-8453-eb5ad29e9824.txt

$ grep -i -E "ECONNREFUSED|error|connect" ~/.claude/debug/$(ls -t ~/.claude/debug | head -1) | tail -30
2026-09-23T20:57:37.247Z [DEBUG] Error log sink initialized
2026-09-23T20:57:38.056Z [DEBUG] "rg error (signal=undefined, code=2, stderr: rg: C:\\Users\\DELL\\.claude\\plugins\\cache: IO error for operation on C:\\Users\\DELL\\.claude\\plugins\\cache: O sistema não pode encontrar o arquivo especificado. (os error 2)\n), 0 results"
2026-09-23T20:57:38.221Z [DEBUG] [jobStateNameSync] watch skipped: Error: ENOENT: no such file or directory, watch 'C:\Users\DELL\.claude\jobs\7ea312c3'
2026-09-23T20:57:38.843Z [DEBUG] Loaded plugins - Enabled: 2, Disabled: 0, Commands: 0, Agents: 0, Errors: 0
2026-09-23T20:57:39.766Z [DEBUG] MCP server "claude.ai Claude Docs": GET notification stream disabled for claude.ai connectors; a GET the SDK sends to the proxy URL is answered locally with 405
2026-09-23T20:57:39.768Z [DEBUG] MCP server "claude.ai Gmail": GET notification stream disabled for claude.ai connectors; a GET the SDK sends to the proxy URL is answered locally with 405
2026-09-23T20:57:39.768Z [DEBUG] MCP server "claude.ai Gmail": Starting connection with timeout of 30000ms
2026-09-23T20:57:39.784Z [DEBUG] MCP server "claude.ai Gmail": Successfully connected (transport: claudeai-proxy) in 17ms
2026-09-23T20:57:39.784Z [DEBUG] MCP server "claude.ai Gmail": Connection established with capabilities: {"hasTools":true,"hasPrompts":false,"hasResources":false,"hasResourceSubscribe":false,"serverVersion":{"name":"StatelessServer","version":"ESF"},"protocolEra":"legacy","negotiatedProtocolVersion":"2025-11-25"}
2026-09-23T20:57:39.784Z [DEBUG] [MCP] Server "claude.ai Gmail" connected with subscribe=false
2026-09-23T20:57:39.788Z [DEBUG] MCP server "claude.ai Claude Docs": Starting connection with timeout of 30000ms
2026-09-23T20:57:40.599Z [DEBUG] MCP server "claude.ai Claude Docs": Successfully connected (transport: claudeai-proxy) in 834ms
2026-09-23T20:57:40.599Z [DEBUG] MCP server "claude.ai Claude Docs": Connection established with capabilities: {"hasTools":true,"hasPrompts":false,"hasResources":false,"hasResourceSubscribe":false,"serverVersion":{"name":"Claude Docs","version":"0.1.0"},"protocolEra":"legacy","negotiatedProtocolVersion":"2025-11-25"}
2026-09-23T20:57:40.599Z [DEBUG] [MCP] Server "claude.ai Claude Docs" connected with subscribe=false
2026-09-23T20:57:54.124Z [ERROR] API error (attempt 1/11): undefined Connection error.
2026-09-23T20:57:54.383Z [ERROR] API error (attempt 1/11): undefined Connection error.
2026-09-23T20:57:54.652Z [ERROR] API error (attempt 2/11): undefined Connection error.
2026-09-23T20:57:55.007Z [ERROR] API error (attempt 2/11): undefined Connection error.
2026-09-23T20:57:55.668Z [ERROR] API error (attempt 3/11): undefined Connection error.
2026-09-23T20:57:56.169Z [ERROR] API error (attempt 3/11): undefined Connection error.
2026-09-23T20:57:57.907Z [ERROR] API error (attempt 4/11): undefined Connection error.
2026-09-23T20:57:58.402Z [ERROR] API error (attempt 4/11): undefined Connection error.
2026-09-23T20:58:02.363Z [ERROR] API error (attempt 5/11): undefined Connection error.
2026-09-23T20:58:02.872Z [ERROR] API error (attempt 5/11): undefined Connection error.
2026-09-23T20:58:11.729Z [ERROR] API error (attempt 6/11): undefined Connection error.
2026-09-23T20:58:12.108Z [ERROR] API error (attempt 6/11): undefined Connection error.
2026-09-23T20:58:17.421Z [ERROR] 1P event logging: 192 events failed to export (code=ECONNABORTED, timeout of 10000ms exceeded)
2026-09-23T20:58:30.181Z [ERROR] Failed to flush logs to Datadog: AxiosError: timeout of 5000ms exceeded
2026-09-23T20:58:30.262Z [ERROR] API error (attempt 7/11): undefined Connection error.
2026-09-23T20:58:31.425Z [ERROR] API error (attempt 7/11): undefined Connection error.

Steps to Reproduce

Any message I send results in an ECONNREFUSED error.

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.281

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗