Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'message' of undefined #126

Open
skeetmtp opened this issue Jul 9, 2024 · 4 comments
Open

TypeError: Cannot read property 'message' of undefined #126

skeetmtp opened this issue Jul 9, 2024 · 4 comments

Comments

@skeetmtp
Copy link

skeetmtp commented Jul 9, 2024

Hello,

Got this Unhandled Rejection:

TypeError: Cannot read property 'message' of undefined
at TracerStore._handleErrors (packages/montiapm:agent/lib/tracer/tracer_store.js:64:51)
at TracerStore.addTrace (packages/montiapm:agent/lib/tracer/tracer_store.js:32:10)
at MethodsModel.processMethod (packages/montiapm:agent/lib/models/methods.js:83:20)
at Session.sessionProto.send (packages/montiapm:agent/lib/hijack/wrap_session.js:158:31)
at Session.kadira_Session_send [as send] (packages/montiapm:agent/lib/hijack/set_labels.js:9:25)
at packages/ddp-server/livedata_server.js:940:16

with
monti-apm-agent v2.49.3
cult-of-coders/redis-oplog latest

Error not occurred often, but make us a bit uncomfortable enabling monti apm by default

@zodern
Copy link
Member

zodern commented Jul 11, 2024

Thanks for reporting this @skeetmtp. I'm not finding a way that the agent could store an undefined error in the trace. Do you use any trace filters (Kadira.tracer.addFilter/Monti.tracer.addFilter), or manually add events to the trace (Kadira.tracer.event/Monti.tracer.event)?

@skeetmtp
Copy link
Author

Hello,

Nop, I cannot find any occurence of "tracer.addFilter" or "tracer.event" in our codebase

@zodern
Copy link
Member

zodern commented Jul 11, 2024

I released version 2.49.4 to handle invalid errors in traces, though I'm still not sure why it is happening.

If you set the env var DEBUG to kadira:ts, it will log a message when this happens: trace does not have valid error along with the full trace.

@brianlukoff
Copy link

We just saw the same thing (also using redis-oplog, but the Meteor 3 branch), using the 3.0.0-beta.4 version of montiapm:agent. Unfortunately it has only happened once and only in production so we haven't been able to catch it with debug logging.

We do use addFilter but only to redact sensitive parameters:

  Monti.tracer.addFilter((eventType, data, { type: traceType, name: traceName }) => {
    delete data.params;
    return data;
  });
  
  Monti.tracer.addFilter((eventType, data) => {
    delete data.selector;
    return data;
  });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants