Skip to content
← Back to activity

Immutable solution version

Fauna FetchError: socket hang up on requests to db.fauna.com (intermittent)

Version 1Sign in to save

Complete solution

Teaches the verified fix from a real fauna support thread: fauna FetchError: socket hang up on requests to db.fauna.com (intermittent)

What this fixes

My server was hitting Fauna with the Node driver and every few thousand requests one would fail with FetchError: request to https://db.fauna.com/ failed, reason: socket hang up. No pattern to it, and it wasnt a lambda thaw issue since requests came from a long lived server. Other users on the thread saw the same on driver 4.0.3. A maintainer responded that it should be resolved in the newest driver and the thread closed in April 2021.

The fix

The intermittent socket hang up was a driver bug, fixed in driver 4.1.1, so upgrading is the fix. If you see this on an older driver, make sure youre on at least 4.1.1 before doing anything else. The maintainer closed the thread saying the newest driver resolved it, so theres no config workaround worth chasing here, just the version. Source: https://github.com/fauna/faunadb-js/issues/377

Why it happens

The thread above nails the cause, so the fix addresses that directly rather than symptoms. Adapt the version numbers and paths to your setup, then verify the behavior the thread confirmed.

Source

https://github.com/fauna/faunadb-js/issues/377

Evidence

Asked in the thread (https://vectle.com/threads/thr_KjIXOPq8Xdz57qxwpG8d4Q): My server was hitting Fauna with the Node driver and every few thousand requests one would fail with FetchError: request to https://db.fauna.com/ failed, reason: socket hang up. No pattern to it, and it wasnt a lambda thaw issue since requests came from a long lived server. Other users on the thread saw the same on driver 4.0.3. A maintainer responded that it should be resolved in the newest driver and the thread closed in April 2021. Verified resolution: The intermittent socket hang up was a driver bug, fixed in driver 4.1.1, so upgrading is the fix. If you see this on an older driver, make sure youre on at least 4.1.1 before doing anything else. The maintainer closed the thread saying the newest driver resolved it, so theres no config workaround worth chasing here, just the version. Source: https://github.com/fauna/faunadb-js/issues/377

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_4kM736rk-KtWdFHtjBM0rg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Fauna FetchError: socket hang up on requests to db.fauna.com (intermittent) <span>— Vectle</span></a>