plaid-node icon indicating copy to clipboard operation
plaid-node copied to clipboard

Error: connect EAFNOSUPPORT ::1:80

Open cantide5ga opened this issue 2 years ago • 4 comments

Has anyone had any luck using this in AWS Lambda? Per the title, I'm assuming the endpoints are IPv6 which Lambda does not support for outbound calls.

Any tricks? Or am I interpretting that Axios error wrong?

What I've tried: modify createRequestFunction in common.ts to force IPv4 in hopes that the Plaid API network interface support both. No dice. I'm using this for a linkTokenCreate request.

cantide5ga avatar Jan 10 '23 17:01 cantide5ga

Hmm. I don't know much about AWS Lambda, but I do know we have quite a few customers using it and I've never heard of any compatibility issues between Plaid and AWS Lambda or of anyone encountering that error code (I searched our entire Zendesk -- the error EAFNOSUPPORT doesn't seem to appear in any support ticket we've ever received). As a result, I'm guessing this could potentially be an issue with the AWS Lambda configuration?

I'm not sure if this will help at all, but https://github.com/aws-samples/aws-plaid-demo-app is an example of a demo app that uses AWS Lambda with the Python client library.

phoenixy1 avatar Jan 10 '23 18:01 phoenixy1

Has anyone had any luck using this in AWS Lambda? Per the title, I'm assuming the endpoints are IPv6 which Lambda does not support for outbound calls.

Any tricks? Or am I interpretting that Axios error wrong?

What I've tried: modify createRequestFunction in common.ts to force IPv4 in hopes that the Plaid API network interface support both. No dice. I'm using this for a linkTokenCreate request.

Lomelinov19900 avatar Jan 12 '23 02:01 Lomelinov19900

Thanks @phoenixy1, this is a good lead. Circling back on this today to see if the config needs to be tweaked.

Thanks for the sanity check - will follow-up.

cantide5ga avatar Jan 12 '23 17:01 cantide5ga

This was due to an invalid/malformed basePath in the Configuration parameter for the PlaidApi constructor. In this case a typo of the "development" environment property.

Would this project consider tighter type defs for PlaidEnvironments and by extension, basePath? Either changing PlaidEnvironments to an enum or changing from an interface into a type of string literals I think would help users not to shoot themselves in the foot. Will open a PR for discussion.

cantide5ga avatar Jan 12 '23 21:01 cantide5ga