microsoft / ApplicationInsights-node.js

Microsoft Application Insights SDK for Node.js
MIT License
325 stars 140 forks source link

ApplicationInsights Fails to Configure #435

Closed largeDachshund closed 6 years ago

largeDachshund commented 6 years ago

With this configuration: var appInsights = require("applicationinsights"); appInsights.setup();// assuming ikey is in env var appInsights.start(); in my node app, I received a 500 error due to this:

2018-10-14T20:46:31 Welcome, you are now connected to log-streaming service.

Sun Oct 14 2018 20:47:01 GMT+0000 (Coordinated Universal Time): Application has thrown an uncaught exception and is terminated:

Error: 30912:error:140740BF:SSL routines:SSL23_CLIENT_HELLO:no protocols available:openssl\ssl\s23_clnt.c:283:

at CleartextStream._pusher (tls.js:508:24)

at CleartextStream._push (tls.js:334:25)

at SecurePair.cycle (tls.js:734:20)

at Array.0 (tls.js:660:10)

at EventEmitter._tickCallback (node.js:190:38)

ApplicationInsights:Sender [ 'Ingestion endpoint could not be reached. This batch of telemetry items has been lost. Use Disk Retry Caching to enable resending of failed telemetry. Error:',

{ [Error: socket hang up] code: 'ECONNRESET' } ]

2018-10-14T20:48:31 No new trace in the past 1 min(s).

OsvaldoRosado commented 6 years ago

This log statement:

ApplicationInsights:Sender [ 'Ingestion endpoint could not be reached. This batch of telemetry items has been lost. Use Disk Retry Caching to enable resending of failed telemetry. Error:',
{ [Error: socket hang up] code: 'ECONNRESET' } ]

Should indicate that the SDK successfully caught an error internally and shouldn't further throw to cause a 500 in your app. If you don't require applicationinsights do you still get 500 errors?

EDIT: Can you also specify which version of the SDK you are on?

largeDachshund commented 6 years ago

Thanks, Osvaldo. You're suspicions were right. I sourced the error to another API. thanks!