ETIMEDOUT API Origin: Application & API Last updated 14 Oct 2026

API Request Timed Out (ETIMEDOUT / ReadTimeout / timeout of 30000ms exceeded)

The client gave up waiting — either for the connection to open or for the response to arrive.

Exact message you may see timeout of 30000ms exceededRead timed outConnection timed outcontext deadline exceeded

Meaning

There are two different timeouts: a connect timeout (server/port unreachable — firewall, wrong host, server down) and a read timeout (connected, but the response is too slow). Knowing which one fired tells you whether to look at the network or at server performance.

Common causes

  • Firewall/security group dropping packets (connect timeout)
  • Wrong host or port, or the service is down
  • Slow endpoint, database query or upstream dependency (read timeout)
  • Client timeout set too low for a legitimately long operation
  • DNS resolution slow or failing
  • Server overloaded / rate limiting by delaying

⚡ Quick fix

  1. Determine connect vs read timeout from the error type
  2. For connect timeouts: nc -vz host port from the same machine
  3. For read timeouts: measure the endpoint and fix the slow part
  4. Set explicit timeouts and retry idempotent requests with backoff

Detailed fix by platform

Python

  1. Separate connect and read timeouts:
    python
    import requests
    try:
        r = requests.get(url, timeout=(3.05, 30))   # (connect, read)
    except requests.exceptions.ConnectTimeout:
        ...  # network/firewall/host problem
    except requests.exceptions.ReadTimeout:
        ...  # server too slow

Node.js

  1. fetch with AbortSignal timeout (Node 18+):
    javascript
    try {
      const res = await fetch(url, { signal: AbortSignal.timeout(10_000) });
    } catch (err) {
      if (err.name === 'TimeoutError') console.error('API took longer than 10s');
      else throw err;
    }

JavaScript

  1. axios: timeout: 30000 produces "timeout of 30000ms exceeded" (ECONNABORTED) — that is a read+connect total, not per phase.

AWS

  1. Lambda calling a VPC resource without a NAT gateway / security-group rule times out on connect.

Code examples

Test reachability and timing

bash
nc -vz api.example.com 443                 # connect works?
curl -o /dev/null -s -w 'dns=%{time_namelookup} connect=%{time_connect} tls=%{time_appconnect} ttfb=%{time_starttransfer} total=%{time_total}\n' https://api.example.com/health

How to diagnose

  1. Type — Connect timeout or read timeout?
  2. Reachability — Can this machine open a TCP connection to host:port?
  3. Server time — How long does the endpoint take (logs/APM)?
  4. Timeouts — What are the client, proxy and server timeouts?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

0x80070035 — 0x80070035: The network path was not found (System error 53) (Windows)0x800700350x80072EE7 — Error 0x80072EE7 (Windows Update / Microsoft Store: server name could not be resolved) (Windows)0x80072EE70x8024402C — Windows Update error 0x8024402C (cannot connect to update server) (Windows)0x8024402C14 UNAVAILABLE — gRPC Error: 14 UNAVAILABLE: No connection established / failed to connect to all addresses (API)14 UNAVAILABLE2013 — MySQL ERROR 2013 (HY000): Lost connection to MySQL server during query (MySQL)2013408 — HTTP 408 Request Timeout (HTTP)408504 — HTTP 504 Gateway Timeout (HTTP)504522 — Cloudflare Error 522: Connection Timed Out (Cloudflare)522ETIMEDOUT

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.