## TL;DR

For "network-family-autoselection-attempt-timeout=500": the thread ran through 2025 and closed in July with a confirmed fix. The fix that worked was setting export NODE_OPTIONS="network-family-autoselection-attempt-timeout=500" in the shell env, which one reporter confirmed resolved it.

```text
network-family-autoselection-attempt-timeout=500
```

## Steps

1. The fetch failed error was a Node/undici DNS issue, not a Neon issue: undici's Happy Eyeballs IPv6 probing stalled the connection. The fix that worked was setting export NODE_OPTIONS="network-family-autoselection-attempt-timeout=500" in the shell env, which one reporter confirmed resolved it. Another person on the thread fixed the same error during migrations by routing through Cloudflare WARP, which points at the same network/DNS root cause. If the error is intermittent and only affects the HTTP driver, try the NODE_OPTIONS fix first.

## When to use

You are seeing this: I was connecting to Neon from an SST function using drizzle-orm/neon-http with the serverless driver, and every query died with Error connecting to database: fetch failed. Use this skill when you run into "Neon "Error connecting to database: fetch failed" using drizzle and SST".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

## Sources

- https://github.com/neondatabase/neon/issues/5362
