By using AWS re:Post, you agree to the Terms of Use

Can someone explain this "connect EAFNOSUPPORT" Lambda error?

0

Hello,

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(authorize.net). 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": [
            null
        ],
        "transformResponse": [
            null
        ],
        "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
}

asked 10 days ago75 views
2 Answers
1

Lambda does not support IPv6 for outbound traffic.

profile picture
EXPERT
answered 8 days ago
0

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 picture
EXPERT
answered 10 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions