[AWS-Lambda] - NetworkingError: Client network socket disconnected before secure TLS connection was established
We are having problems with several of our services to access DynamoDb. This problem is intermittent, but occurs randomly several times a day at each of the services on (AWS LAMBDA).
Any suggestion?
{
"errorType": "Runtime.UnhandledPromiseRejection",
"errorMessage": "NetworkingError: Client network socket disconnected before secure TLS connection was established",
"reason": {
"errorType": "NetworkingError",
"errorMessage": "Client network socket disconnected before secure TLS connection was established",
"code": "NetworkingError",
"message": "Client network socket disconnected before secure TLS connection was established",
"path": null,
"host": "dynamodb.us-east-1.amazonaws.com",
"port": 443,
"region": "us-east-1",
"hostname": "dynamodb.us-east-1.amazonaws.com",
"retryable": true,
"time": "2021-01-06T14:25:06.323Z",
"stack": [
"Error: Client network socket disconnected before secure TLS connection was established",
" at connResetException (internal/errors.js:609:14)",
" at TLSSocket.onConnectEnd (_tls_wrap.js:1547:19)",
" at Object.onceWrapper (events.js:420:28)",
" at TLSSocket.emit (events.js:326:22)",
" at TLSSocket.EventEmitter.emit (domain.js:483:12)",
" at endReadableNT (_stream_readable.js:1223:12)",
" at processTicksAndRejections (internal/process/task_queues.js:84:21)"
]
},
"promise": {},
"stack": [
"Runtime.UnhandledPromiseRejection: NetworkingError: Client network socket disconnected before secure TLS connection was established",
" at process.<anonymous> (/var/runtime/index.js:35:15)",
" at process.emit (events.js:326:22)",
" at process.emit (/var/task/node_modules/source-map-support/source-map-support.js:495:21)",
" at processPromiseRejections (internal/process/promises.js:209:33)",
" at processTicksAndRejections (internal/process/task_queues.js:98:32)"
]
}
I got something very similar: intermittent, similar error, different service (S3):
Error: Client network socket disconnected before secure TLS connection was established
at connResetException (internal/errors.js:609:14)
at TLSSocket.onConnectEnd (_tls_wrap.js:1547:19)
at Object.onceWrapper (events.js:420:28)
at TLSSocket.emit (events.js:326:22)
at TLSSocket.EventEmitter.emit (domain.js:483:12)
at endReadableNT (_stream_readable.js:1223:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
code: 'ECONNRESET',
path: null,
host: 's3.eu-west-1.amazonaws.com',
port: 443,
localAddress: undefined
}
It seems to be a problem at Lambda.
Our support from aws:
I also want to confirm that we are already aware of this issue in Nodejs Lambda function and can confirm that it is affecting a very small set of invocations for Nodejs runtime. There are some mitigation steps that we suggest for it, meanwhile the Lambda internal team is doing the investigation for the root cause.
@robsonkades, thanks for providing the update, can you share the ticket number that you have with AWS and I can look into it, would like to close the issue if the issue is not related to the SDK.
@ajredniwja, Thank you for your help!
Case 7831443621
@robsonkades, thanks for providing that, I can reach out to the team related to that and can update once I hear back from them.
Hi - we're also seeing some instances of this in a NodeJs lambda, are there any updates?
@rcoundon No solution so far
Ok, thanks for the update. Any ETA?
I was not able to get any updates as of yet, I have contacted the engineers associated and will update you guys once I have some more insight from Lambda team.
2021-02-05T01:27:25.910Z 1f0f65f6-4194-4948-b322-981bb95c4466 ERROR Unhandled Promise Rejection {
"errorType": "Runtime.UnhandledPromiseRejection",
"errorMessage": "NetworkingError: Client network socket disconnected before secure TLS connection was established",
"reason": {
"errorType": "NetworkingError",
"errorMessage": "Client network socket disconnected before secure TLS connection was established",
"code": "NetworkingError",
"message": "Client network socket disconnected before secure TLS connection was established",
"path": null,
"host": "dynamodb.ap-southeast-1.amazonaws.com",
"port": 443,
"region": "ap-southeast-1",
"hostname": "dynamodb.ap-southeast-1.amazonaws.com",
"retryable": true,
"time": "2021-02-05T01:27:25.908Z",
"stack": [
"Error: Client network socket disconnected before secure TLS connection was established",
" at connResetException (internal/errors.js:609:14)",
" at TLSSocket.onConnectEnd (_tls_wrap.js:1549:19)",
" at Object.onceWrapper (events.js:420:28)",
" at TLSSocket.emit (events.js:326:22)",
" at TLSSocket.EventEmitter.emit (domain.js:483:12)",
" at endReadableNT (_stream_readable.js:1241:12)",
" at processTicksAndRejections (internal/process/task_queues.js:84:21)"
]
},
"promise": {},
"stack": [
"Runtime.UnhandledPromiseRejection: NetworkingError: Client network socket disconnected before secure TLS connection was established",
" at process.<anonymous> (/var/runtime/index.js:35:15)",
" at process.emit (events.js:314:20)",
" at process.EventEmitter.emit (domain.js:483:12)",
" at process.emit (/var/task/node_modules/source-map-support/source-map-support.js:495:21)",
" at processPromiseRejections (internal/process/promises.js:209:33)",
" at processTicksAndRejections (internal/process/task_queues.js:98:32)"
]
}
I face same error in aws lambda, I am using nodejs
looks like aws-sdk lib problem??
using "aws-sdk": "^2.835.0", try upgrade version see how
In case it's helpful, our issue is related to writes to S3.
Same for us. Seems to affect quite significantly our Lambdas. Thanks @ajredniwja for the update.
We've also got the same issue with AppSync - happening on a somewhat sensitive service.
Any idea how we can mitigate this until there is a proper fix?
We had the same issue reading from secretsmanager but also reading from s3 today. Our lambdas are running in a VPC so that is likely the issue in our case.
https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html#vpc-samples
@brucemackenzie the lambda functions I have do not run in a VPC so I doubt this is a VPC specific issue. The primary function where this is causing us a concern has the issue does run on a cron - every minute - so not sure if that has any impact.
However, I am possibly more concerned should this could happen on webhook requests. Especially as I may not be guaranteed a retry by a third-party service should the function fail.
We don't use VPC approximately 0.7% of requests fail.
Seeing same issue appearing here.
+1 same issue. @robsonkades do you still have this issue? This has started to appear for us recently. ( lambda deployed in a VPC, but this seems do not matter )
+1 same issue while calling a 3rd party service via https
node v14.16.0
aws-sdk 2.804.0
+1 same issue node v14.x
2021-04-14T08:07:31.506Z 8636001a-b230-4580-828b-966334e116ee INFO came to callback Error: Client network socket disconnected before secure TLS connection was established at connResetException (internal/errors.js:607:14) at TLSSocket.onConnectEnd (_tls_wrap.js:1544:19) at TLSSocket.emit (events.js:327:22) at endReadableNT (internal/streams/readable.js:1327:12) at processTicksAndRejections (internal/process/task_queues.js:80:21) { code: 'ECONNRESET', path: null, host: 'cognito-idp.us-east-2.amazonaws.com', port: 443, localAddress: undefined } undefined
@illia-sh yes, still with the same problem
We also started seeing this a couple of days ago. Before that there was absolutely no problem. The lambda does not run in a VPC but is invoked by API Gateway
I experience the same error When ts is compiled with js after putting axios in forEach, map environment : Connect Lambda to SQS and run Lambda
2021-04-16T06:00:24.537Z 1f630065-c993-5f4e-bb70-5896e0bbfe96 INFO Error: Client network socket disconnected before secure TLS connection was established at connResetException (internal/errors.js:609:14) at TLSSocket.onConnectEnd (_tls_wrap.js:1549:19) at Object.onceWrapper (events.js:420:28) at TLSSocket.emit (events.js:326:22) at endReadableNT (_stream_readable.js:1241:12) at processTicksAndRejections (internal/process/task_queues.js:84:21) { code: 'ECONNRESET', path: null, host: 'bot-api.kakao.com', port: 443, localAddress: undefined, }
Experiencing the same issue for AWS_Lambda while logging data into Sumologic, this is impacting us at a higher level. Requesting some ETA on the same
Client network socket disconnected before secure TLS connection was established at connResetException
+1 on this issue, we started experiencing this recently on a newly re-deployed micro service. AWS Lambda on Nodejs 12 runtime
{ "errorType": "Runtime.UnhandledPromiseRejection", "errorMessage": "Error: Client network socket disconnected before secure TLS connection was established", "reason": { "message": "Client network socket disconnected before secure TLS connection was established", "name": "Error", "stack": "Error: Client network socket disconnected before secure TLS connection was established\n at connResetException (internal/errors.js:609:14)\n at TLSSocket.onConnectEnd (_tls_wrap.js:1549:19)\n at Object.onceWrapper (events.js:420:28)\n at TLSSocket.emit (events.js:326:22)\n at TLSSocket.EventEmitter.emit (domain.js:483:12)\n at endReadableNT (_stream_readable.js:1241:12)\n at processTicksAndRejections (internal/process/task_queues.js:84:21)" }

Same issue on Lambda running nodejs 12
Is there anything we can do to solve it?
Best regards
We have this issue as well, but it just popped up after a redeployment of a long-stable Lambda. Nodejs10x runtime.
Reached out to the Lambda team again, would update the issue shortly? @robsonkades was there a word from Lambda team?
Same here, opened a ticket to aws team.
I'm also experience same issue, only on a cron lambda and it is attempting to connect to DynamoDB