# socket hang up errors with nodejs apps

**URL:** <https://community.dynatrace.com/t/socket-hang-up-errors-with-nodejs-apps/21243>\
**Category:** Real User Monitoring\
**Tags:** nodejs, application-monitoring, profiling-and-optimization, javascript\
**Created:** [January 19, 2021, 8:52am UTC](https://community.dynatrace.com/t/socket-hang-up-errors-with-nodejs-apps/21243 "2021-01-19T08:52:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kumararajan\_raj](https://avatars.discourse-cdn.com/v4/letter/k/3ec8ea/32.png) [@kumararajan\_raj](https://community.dynatrace.com/u/kumararajan_raj)\
**Post date:** [January 19, 2021, 8:52am UTC](https://community.dynatrace.com/t/socket-hang-up-errors-with-nodejs-apps/21243/1 "2021-01-19T08:52:03Z")

</div>

We are starting to see Socket Hang up errors on node js applications that appears to point us to dynatrace being an issue. We could be wrong. But, what is interesting is we are moving from CA to dynatrace. When we were not on dynatrace, we didnt see this issue and as soon as we introduced dynatrace we are starting to notice it. Initially we thought it could be us. But, then as we move apps to utilize dynatrace, we are seeing a spike in this error. First SPA and now Lambdas. We have SPA app and AWS lambdas where we have noticed this. Attached are some of sample errors for your reference. Are there any suggestions for us on how to troubleshoot this issue or how to prove this is not dynatrace being the problem?

Any help is greatly appreciated.

_ **From Lambda:** _

RequestError: socket hang up at ClientRequest.\<anonymous\> (/var/task/node\_modules/got/source/request-as-event-emitter.js:178:14) at ClientRequest.c (/opt/nodejs/node\_modules/@dynatrace/oneagent-dependency/agent/bin/1.201.133.20201001-160832/any/nodejs/nodejsagent.js:3784:23) at Object.dynatraceOnServiceExecutionIndicator (/opt/nodejs/node\_modules/@dynatrace/oneagent-dependency/agent/bin/1.201.133.20201001-160832/any/nodejs/nodejsagent.js:1792:20) at Object.a.safeInvoke (/opt/nodejs/node\_modules/@dynatrace/oneagent-dependency/agent/bin/1.201.133.20201001-160832/any/nodejs/nodejsagent.js:1843:29) at ClientRequest.\<anonymous\> (/opt/nodejs/node\_modules/@dynatrace/oneagent-dependency/agent/bin/1.201.133.20201001-160832/any/nodejs/nodejsagent.js:5309:21) at ClientRequest.emit (events.js:326:22) at ClientRequest.EventEmitter.emit (domain.js:483:12) at ClientRequest.origin.emit (/var/task/node\_modules/@szmarczak/http-timer/source/index.js:37:11) at TLSSocket.socketCloseListener (\_http\_client.js:401:11) at Object.dynatraceOnServiceExecutionIndicator (/opt/nodejs/node\_modules/@dynatrace/oneagent-dependency/agent/bin/1.201.133.20201001-160832/any/nodejs/nodejsagent.js:1792:20)

_ **From SPA:** _

Error: socket hang up at createHangUpError (\_http\_client.js:323:15) at TLSSocket.socketOnEnd (\_http\_client.js:426:23) at Object.dynatraceOnServiceExecutionIndicator [as doInvoke] (/opt/dynatrace/oneagent/agent/bin/1.203.166.20201020-120314/any/nodejs/nodejsagent.js:1807:20) at Object.b.safeInvoke (/opt/dynatrace/oneagent/agent/bin/1.203.166.20201020-120314/any/nodejs/nodejsagent.js:1860:29) at TLSSocket.\<anonymous\> (/opt/dynatrace/oneagent/agent/bin/1.203.166.20201020-120314/any/nodejs/nodejsagent.js:5355:21) at TLSSocket.emit (events.js:203:15) at endReadableNT (\_stream\_readable.js:1145:12) at process.\_tickCallback (internal/process/next\_tick.js:63:19)

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [January 21, 2021, 8:40am UTC](https://community.dynatrace.com/t/socket-hang-up-errors-with-nodejs-apps/21243/2 "2021-01-21T08:40:30Z")

</div>

I rather suggest you to rise support ticket. If this indeed is kind of bug, support will take care of this.

Sebastian

---

<div class="post-metadata">

**Author:** ![kumararajan\_raj](https://avatars.discourse-cdn.com/v4/letter/k/3ec8ea/32.png) [@kumararajan\_raj](https://community.dynatrace.com/u/kumararajan_raj)\
**Post date:** [January 22, 2021, 11:08pm UTC](https://community.dynatrace.com/t/socket-hang-up-errors-with-nodejs-apps/21243/3 "2021-01-22T23:08:31Z")

</div>

Thanks. I have opened a ticket with support.

---

<div class="post-metadata">

**Author:** ![Karolina\_Linda](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/karolina_linda/32/36089_2.png) [@Karolina\_Linda](https://community.dynatrace.com/u/Karolina_Linda)\
**Post date:** [February 8, 2021, 7:22am UTC](https://community.dynatrace.com/t/socket-hang-up-errors-with-nodejs-apps/21243/4 "2021-02-08T07:22:23Z")

</div>

In case other Dynatrace users have a similar issue, here are the Support findings:

_This is an uncaught exception and Dynatrace is capturing the socket hang up - which is why you see references to Dynatrace in the stack trace. It does not appear that this issue is caused by Dynatrace. If you would like to confirm this, you can disable monitoring on the host generating this service call and note if the issue persists._
