Skip to content
New issue

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

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

Already on GitHub? # to your account

Events fail to send when compression is enabled #71

Closed
lunim opened this issue Jul 30, 2018 · 3 comments
Closed

Events fail to send when compression is enabled #71

lunim opened this issue Jul 30, 2018 · 3 comments
Labels
Bug Something isn't working

Comments

@lunim
Copy link

lunim commented Jul 30, 2018

I am seeing this in the debug log:

Sentry responded with status 'BadRequest' for event 9a6e423b-63e2-4e39-bec6-9a58088bfb9f. Message: No JSON data was found

Here is the code I am running;

static void Main()
{
    using ( SentrySdk.Init("https://<id>@<on_prem_server>") )
    {
        SentrySdk.CaptureMessage("Sample Test 1");
    }
}

I have an on-premise 9.0.0 server.

The following code successfully sends issues:

using (var sdk = SentrySdk.Init(s =>
{
    s.Dsn = new Dsn("https://<id>@<on_prem_server>");
    s.Http(h =>
    {
        h.RequestBodyCompressionLevel = System.IO.Compression.CompressionLevel.NoCompression;
    });

}))
{
    SentrySdk.CaptureMessage("Sample Test 1");
}
@lunim lunim changed the title Preview 4 not reporting issues Events fail to send when is compression enabled Jul 30, 2018
@lunim lunim changed the title Events fail to send when is compression enabled Events fail to send when compression is enabled Jul 31, 2018
@bruno-garcia bruno-garcia added the Bug Something isn't working label Jul 31, 2018
@bruno-garcia
Copy link
Member

This is strange. I've tested against Sentry.io which is also Sentry 9 and it works properly.
I'll run on-prem here and try on that.

@bruno-garcia
Copy link
Member

It turns out you need to enable on a reverse proxy, support to chunked transfer encoding.

For example, if you are using nginx, you can do as documented here

sentry.io has it enabled, that's why the SDK works fine with the SaaS version.

After a discussion internally it was decided to buffer the request to be able to get the Content-Length and avoid chunked transfer encoding altogether.

bruno-garcia added a commit that referenced this issue Jul 31, 2018
* Default option now uses Content-Length
* Resolves #71
bruno-garcia added a commit that referenced this issue Jul 31, 2018
* Default option now uses Content-Length
* Resolves #71
@bruno-garcia
Copy link
Member

Just merged the change: https://github.com/getsentry/sentry-dotnet/pull/73/files
It'll go to NuGet in a few days when we make a new release.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants