Fauna error on production: "FetchError: request to https://db.fauna.com/ failed, reason: write EPIPE"

I’m trying to launch my new web app using Netlify Functions accessing FaunaDB and while it seems to work locally great (via netlify dev), when it’s online it feels like every 3rd call to the database fails with the following error:

FetchError: request to https://db.fauna.com/ failed, reason: write EPIPE
at ClientRequest.<anonymous> (/var/task/src/node_modules/faunadb/node_modules/node-fetch/lib/index.js:1461:11)
at ClientRequest.emit (events.js:315:20)
at TLSSocket.socketErrorListener (_http_client.js:426:9)
at TLSSocket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  type: 'system',
  errno: 'EPIPE',
  code: 'EPIPE'
}

I have no clue what this means or what I’m maybe doing wrong or how to fix it. It seems like it’s on Fauna’s side.

All of the “server side code” executing calls to Fauna are in various Netlify functions (which I guess are just wrapped up AWS Lambdas). Various different function calls hitting different Netlify functions are generating this error, not just one in particular.

Please help me understand what’s going on and what I can do to fix this, or is this a bug on the Fauna platform side?

@WillPwn4Food This known issue should help you resolve it.