Skip to main content
AllDevToolsHub
Back to error codes
ERROR ETIMEDOUT

ETIMEDOUT, Connection Timed Out

Node.js Error

The connection attempt timed out before a response was received.

Root Cause

The remote host is unreachable, a firewall is silently dropping packets, or the server is too slow to respond within the timeout period.

How to Fix

Check network connectivity to the remote host. Increase the timeout if the server is legitimately slow. Implement retry logic with exponential backoff.

Quick Summary

ETIMEDOUT means the connection attempt timed out. Check network connectivity, verify the host is reachable, and implement retry logic with exponential backoff for transient failures.

Key Takeaways

Key Takeaways

  • The remote host did not respond within the timeout period
  • Different from ECONNREFUSED, ETIMEDOUT means no response, not an active refusal
  • Implement retry logic with exponential backoff for transient timeouts
  • Check firewall rules, silent packet drops cause ETIMEDOUT
Use Cases

When to use it

  • Database connection timeout
  • External API not responding
  • Network partition in a distributed system
Watch out

Common Mistakes

  • Not implementing retry logic, a single timeout should not fail the entire operation
  • Setting timeouts too low for slow operations like large database queries
FAQ

ETIMEDOUT ETIMEDOUT, Connection Timed Out, Frequently Asked

What is the difference between ETIMEDOUT and ECONNREFUSED?

ECONNREFUSED: the server actively refused the connection (nothing listening). ETIMEDOUT: the server did not respond at all (unreachable, firewall, or too slow).

Still having issues?

Check your network logs or use our developer tools to inspect headers, decode tokens, or validate your requests.