Error: Must be valid TraceId instance
See original GitHub issueAfter upgrading to version 0.18.5 of zipkin-instrumentation-restify and zipkin, I am getting the following error when the request to my server comes in with a traceId: “Error: Must be valid TraceId instance”.
I’ve narrowed the problem down to the following snippet of code in zipkin/tracer/index.js inside the join function
if (!(traceId instanceof TraceId)) {
throw new Error('Must be valid TraceId instance');
}
This if is always resulting to false, after inspecting the traceid passed to this function, I found the following.
traceId parameter:
TraceId {
_traceId: 'b7daf2ae1b9e2555',
_parentId:
{ type: [Getter],
present: [Getter],
map: [Function: map],
ifPresent: [Function: ifPresent],
flatMap: [Function: flatMap],
getOrElse: [Function: getOrElse],
equals: [Function: equals],
toString: [Function: toString] },
_spanId: 'b7daf2ae1b9e2555',
_sampled:
{ type: [Getter],
present: [Getter],
map: [Function: map],
ifPresent: [Function: ifPresent],
flatMap: [Function: flatMap],
getOrElse: [Function: getOrElse],
equals: [Function: equals],
toString: [Function: toString] },
_debug: false,
_shared: false }
traceId instanceof TraceId_1
: false
traceId.constructor.name
: TraceId
TraceId_1.constructor.name
: Function
TraceId.constructor.name
: Function
Please note: The usage of TraceId_1 is because that is the output produced after transpilation, and hence is what is being checked in the code when it is actually running.
if (!(traceId instanceof TraceId_1)) {
throw new Error('Must be valid TraceId instance');
}
This issue only happens if the request is made with the traceid and spanid headers populated.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:20 (8 by maintainers)
Top GitHub Comments
https://github.com/openzipkin/zipkin-js/pull/328 introduced this, specifically f665dc3e3efe99760486ae404291a344c2406a92
looking into it and will put a patch up ASAP
Updated to 0.18.6, tested and everything looks fine. Thanks @adriancole for the fast resolution!