Getting socket hang up ECONNRESET in graphql requests inside functions

This is happening in two different netlify sites connecting to the same API.

Sites:

  • vc-webhooks
  • virtual-coffee-io

The API in question is https://members.virtualcoffee.io/api

I can’t post the access key here, but I did verify it’s the same in netlify env as in local.

in vc-webhooks, there is a background function that is calling a graphql api via graphql-request
In virtual-coffee-io it is a normal function via remix

In both instances, I’m getting the following error in the function logs:

Jun 17, 11:13:50 AM: 6617c0a8 ERROR  FetchError: request to https://members.virtualcoffee.io/api failed, reason: socket hang up
    at ClientRequest.<anonymous> (/var/task/node_modules/node-fetch/lib/index.js:1491:11)
    at ClientRequest.emit (events.js:400:28)
    at TLSSocket.socketOnEnd (_http_client.js:499:9)
    at TLSSocket.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'
}

These functions are working fine locally via netlify dev and were working fine on netlify up until two days ago. The API responses also respond quickly with no problems when reached via insomnia or other requests.

I really don’t know what to do anymore - it’s nuking our entire site. What have I missed?

The API server logs show that these requests are being returned properly in 391 milliseconds:

2022-06-17@12:23:25
nginx-production
54.158.217.181 - - [17/Jun/2022:16:23:25 +0000] "POST /api HTTP/1.1" 200 391 0.054 "-" "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" upstream

OK - I take that back. The function is making two calls, and one succeeds while the other one never shows up in the server logs - which implies it’s never even going out to my API server and is getting hung up somewhere in lambda-land?

Hey @danieltott,

Are you still seeing this issue? This could be related to what other folks were seeing, and has since been fixed.