#Discarded invalid value, reason: expected a primitive value

2 messages · Page 1 of 1 (latest)

crystal lava
#

I see the above reported under Event Processing Errors in Sentry UI. We are using @sentry/node@8.13.0 in an express app. The Discarded invalid value is displayed as:

Name
request.headers.22.1
Value: { session: { ... } }
Reason: expected a primitive value

Example snippets of how we call the Sentry methods in our code:

  1. Sentry.init(...),
  2. Sentry.captureException(<an instance of Error>),
  3. Sentry.withScope((scope) => { scope.setTag("kind", "<Some string>"); scope.setTag("operationName", "<Some string>"); scope.setExtra("query", "<Some string>"); scope.addBreadcrumb({ category: "query-path", message: err.path.join(" > "), level: "debug" }); })

How can I debug the root cause of this?

heady osprey
#

the message means the field in the event is expecting a string or int, but was populated with an object instead.
the event's JSON can show more info on which value was discarded