invoke-aws-lambda
invoke-aws-lambda copied to clipboard
Error: read ECONNRESET
Hello, I have some tests running on aws lambda and lately they've been failing with the following message:
Run gagoar/[email protected] with: FunctionName: BackendTests REGION: eu-west-1 AWS_ACCESS_KEY_ID: *** AWS_SECRET_ACCESS_KEY: *** SUCCEED_ON_FUNCTION_FAILURE: false MAX_RETRIES: 0 HTTP_TIMEOUT: 12000000 LogType: Tail Payload: [{"suite": "shipments","verbose": true},{"suite": "shipment-list","verbose": true},{"suite": "shipment-api","verbose": true}] InvocationType: RequestResponse Error: read ECONNRESET
This error seems to happen after around 4-5 minutes even though I set HTTP_TIMEOUT to a very high number and my tests are passing.
I tried upgrading to v3.3.2 and it still fails every time. I have several actions that use invoke-aws-lambda, but only my longest running one fails.
The new error message is
Run gagoar/[email protected] with: FunctionName: BackendTests REGION: eu-west-1 AWS_ACCESS_KEY_ID: *** AWS_SECRET_ACCESS_KEY: *** SUCCEED_ON_FUNCTION_FAILURE: false MAX_RETRIES: 0 HTTP_TIMEOUT: 12000000 LogType: None Payload: [{"suite": "shipments","verbose": true},{"suite": "shipment-list","verbose": true},{"suite": "shipment-api","verbose": true}] InvocationType: RequestResponse Error: Inaccessible host:
lambda.eu-west-1.amazonaws.com'. This service may not be available in the eu-west-1' region.
There is mention online about setting the keep-alive in the http agent but I did not manage to get that to work. I did however manage to hack a fix by updating to aws-sdk-js-v3 which enables keep-alive by default.
The code is a horrible hack and has no tests but I will link to it here in case anyone wants it https://github.com/gagoar/invoke-aws-lambda/compare/master...DavidMakin:invoke-aws-lambda:master