Can someone explain this "connect EAFNOSUPPORT" Lambda error?



I have deployed a Node JS API to Lambda which works fine on my local development machine. However when the Lambda is triggered it runs until it hits a call to an external API( I receive the following error that I'm not quite sure the meaning of. Did a search and came up empty.

There are other external API calls in the function that work if I circumvent this particular problematic call.

Your help would be greatly appreciated.

2022-09-22T16:51:59.090Z	29f689fb-1ae5-4b26-bd21-69ce6bab6ae1	INFO	{
    "message": "connect EAFNOSUPPORT ::1:80 - Local (undefined:undefined)",
    "name": "Error",
    "stack": "Error: connect EAFNOSUPPORT ::1:80 - Local (undefined:undefined)\n    at internalConnect (node:net:953:16)\n    at defaultTriggerAsyncIdScope (node:internal/async_hooks:465:18)\n    at node:net:1044:9\n    at processTicksAndRejections (node:internal/process/task_queues:78:11)",
    "config": {
        "transitional": {
            "silentJSONParsing": true,
            "forcedJSONParsing": true,
            "clarifyTimeoutError": false
        "transformRequest": [
        "transformResponse": [
        "timeout": 0,
        "xsrfCookieName": "XSRF-TOKEN",
        "xsrfHeaderName": "X-XSRF-TOKEN",
        "maxContentLength": -1,
        "maxBodyLength": -1,
        "env": {},
        "headers": {
            "Accept": "application/json, text/plain, */*",
            "Content-Type": "application/json",
            "User-Agent": "axios/0.27.2",
            "Content-Length": 143
        "method": "post",
        "url": "/",
        "data": "{\"getTransactionDetailsRequest\":{\"merchantAuthentication\":{\"name\":\"[my-login-id]\",\"transactionKey\":\"[my-transaction-key]\"},\"transId\":\"60201341313\"}}"
    "code": "EAFNOSUPPORT",
    "status": null

demandé il y a un an2971 vues
2 réponses

Lambda does not support IPv6 for outbound traffic.

profile pictureAWS
répondu il y a un an

It looks like the code is trying to connect to an IPv6 address of ::1:80 and that's what is failing. You'll need to determine why that is happening and correct it.

profile pictureAWS
répondu il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions