Skip to content

Sentry endpoint often returns 400 Bad Request "invalid event envelope" #4404

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

Closed
3 of 4 tasks
prewk opened this issue Jan 14, 2022 · 2 comments
Closed
3 of 4 tasks

Sentry endpoint often returns 400 Bad Request "invalid event envelope" #4404

prewk opened this issue Jan 14, 2022 · 2 comments
Labels
Package: browser Issues related to the Sentry Browser SDK

Comments

@prewk
Copy link

prewk commented Jan 14, 2022

Package + Version

  • @sentry/browser: 6.15.0
  • @sentry/node: 6.15.0
  • @sentry/tracing: 6.15.0

Version:

Self-hosted Sentry 21.8.0

Description

I'm using the report-tunnel functionality, and for multiple versions (both client and server) I've been getting frequent 400 Bad Request that look like this:

Request:

{"dsn":"https://REDACTED@REDACTED/2"}
{"type":"client_report"}
{"timestamp":1642153010.09,"discarded_events":[{"reason":"sample_rate","category":"transaction","quantity":1}]}

Response with 400 Bad Request:

{
  "detail": "invalid event envelope",
  "causes": [
    "invalid item header",
    "unknown variant `client_report`, expected one of `event`, `transaction`, `security`, `attachment`, `form_data`, `raw_security`, `unreal_report`, `user_report`, `session`, `sessions`, `metrics`, `metric_buckets` at line 1 column 23"
  ]
}

What's causing this? Thanks!

@AbhiPrasad
Copy link
Member

AbhiPrasad commented Jan 14, 2022

Hey, thanks for writing in! This occurs because of the client reports feature, which may not be supported by your self hosted Sentry.

To disable client reports, please set sendClientReports to be false in your Sentry.init config.

Sentry.init({
  sendClientReports: false,
});

sendClientReports?: boolean;

You can also filter out client_report envelopes in your tunnelling set up.

@AbhiPrasad AbhiPrasad added Package: browser Issues related to the Sentry Browser SDK Status: As Designed and removed Status: Untriaged labels Jan 14, 2022
@prewk
Copy link
Author

prewk commented Jan 14, 2022

Interesting, didn't know there was a difference. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: browser Issues related to the Sentry Browser SDK
Projects
None yet
Development

No branches or pull requests

2 participants