I am trying push data to elasticsearch using aws lambda function written in node js and getting this error

Elasticsearch ERROR: 2020-05-01T13:31:11Z
Error: Request error, retrying
POST https://xxx.gcp.cloud.es.io:9243/a_comment/comment/_search => socket hang up
at Log.error (/app/node_modules/elasticsearch/src/lib/log.js:226:56)
at checkRespForFailure (/app/node_modules/elasticsearch/src/lib/transport.js:259:18)
at HttpConnector. (/app/node_modules/elasticsearch/src/lib/connectors/http.js:163:7)
at ClientRequest.wrapper (/app/node_modules/lodash/lodash.js:4935:19)
at emitOne (events.js:121:20)
at ClientRequest.emit (events.js:211:7)
at TLSSocket.socketOnEnd (_http_client.js:423:9)
at emitNone (events.js:111:20)
at TLSSocket.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)

What is the Node.js version you're using?

It seems not a specific problem with Elasticsearch but with Node.js on Lambda and/or the framework used.

Node js10.x
Also i used elasticsearch client to update the data

AWS Lambda functions have a timeout of 3-900 seconds, with 3 seconds being the default. If your Lambda does not have the timeout configured, and it takes more than 3 seconds to execute, you will get these errors.

https://docs.aws.amazon.com/lambda/latest/dg/configuration-console.html

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.