opencensus-node icon indicating copy to clipboard operation
opencensus-node copied to clipboard

propagation causes "Error: socket hang up "

Open chrisdostert opened this issue 6 years ago • 6 comments

Repro

  • Wire up tracing per below code snippet
  • Start application & make a request

Expected

traces show up in stackdriver

Actual

no traces show up in stackdriver and the application crashes w/ the error snippet below a minute or so after receiving a few requests

of note, if I remove propagation traces DO show up in stackdriver so it's something related to the use of @opencensus/propagation-stackdriver

code snippet

const tracing = require('@opencensus/nodejs')
const stackdriverKeyFile = require('/stackdriverKeyFile.json')
const propagation = require('@opencensus/propagation-stackdriver')
const exporter = require('@opencensus/exporter-stackdriver')

tracing.start({
  exporter: new exporter.StackdriverTraceExporter({
    projectId: stackdriverKeyFile.project_id
  }),
  logLevel: 4,
  propagation: propagation.v1
})

error snippet

Error: socket hang up
    at createHangUpError (_http_client.js:335:15)
    at TLSSocket.socketOnEnd (_http_client.js:428:23)
    at TLSSocket.emit (events.js:185:15)
    at endReadableNT (_stream_readable.js:1101:12)
    at process._tickCallback (internal/process/next_tick.js:114:19)
Emitted 'error' event at:
    at TLSSocket.socketOnEnd (_http_client.js:428:9)
    at TLSSocket.emit (events.js:185:15)
    at endReadableNT (_stream_readable.js:1101:12)
    at process._tickCallback (internal/process/next_tick.js:114:19)

chrisdostert avatar Aug 28 '18 10:08 chrisdostert

Interesting, I just tried using require('@opencensus/propagation-b3') and it has the same behavior so it appears the issue does not lie with '@opencensus/propagation-stackdriver'

chrisdostert avatar Aug 29 '18 00:08 chrisdostert

I also get this error when using @opencensus/exporter-stackdriver but not when using the @opencensus/exporter-jaegerso my guess is that is has something to do with the stackdriver exporter.

antonj avatar Sep 14 '18 12:09 antonj

@antonj do you get the same error if you use the @opencensus/exporter-jaeger and set the sampling rate to 0?

I am pretty sure that this issue is related to #119

conord33 avatar Oct 05 '18 07:10 conord33

Same situation here with require('@opencensus/propagation-b3'). The Error: socket hang up is happening with node v8.12.0. When using node v10.12.0 the issue dissapears and traces show up in stackdriver.

frankcs avatar Oct 18 '18 15:10 frankcs

blocked by https://github.com/census-instrumentation/opencensus-node/issues/158

isaikevych avatar Oct 22 '18 23:10 isaikevych

@chrisdostert, @antonj, Could you please provide stackdriver version or try one more time with latest master? I found another issue https://github.com/census-instrumentation/opencensus-node/issues/158 which was fixed, and I cant reproduce current in master, node v8.12.0, I checked opencensus/exporter-stackdriver and @opencensus/propagation-b3

isaikevych avatar Oct 23 '18 18:10 isaikevych