Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Getting APIErrors from Sentry #4

Closed
hynek opened this issue Oct 30, 2015 · 5 comments
Closed

Getting APIErrors from Sentry #4

hynek opened this issue Oct 30, 2015 · 5 comments

Comments

@hynek
Copy link

hynek commented Oct 30, 2015

When I use the default transport, everything is dandy. But if I add this transport I’m getting:

Sentry responded with an API error: APIError(Bad data decoding request (error, Error -3 while decompressing data: incorrect header check))

Is it me or is something broken?

Sentry 7.7.1
raven-aiohttp 0.1.1
raven 5.8.1

@mwfrojdman
Copy link

Same thing. This is the cause: aio-libs/aiohttp#619

Although I think aiohttp's API should make it possible to send requests like this, I also think the responsibility of compressing (or to not compress) the data should in the transport, not in core raven-python. Different libraries may have different needs.

@dcramer
Copy link
Member

dcramer commented Nov 3, 2015

@mwfrojdman compression cant happen in the transport as the server is responsible for decompression and it only supports a fixed set of routines. All transports should be able to support gzipped data as its almost required in order for reliable transport.

That said, It's not clear to me what is wrong here. @hynek do you have the ability to reproduce this? i can give you an account on getsentry.com to see if maybe we resolved this in 8.0

@mwfrojdman
Copy link

The transport is on the client side so it shouldn't matter to the server which layer on the client the compression happens. I got the thing working by adding these to lines to

@asyncio.coroutine

    def async_send(self, data, headers, success_cb, failure_cb):
        data = zlib.decompress(data)
        del headers['Content-Encoding']
        @asyncio.coroutine
        def f():

There are two things leading to errors:

  • When the Content-Encoding header is set, aiohttp will compress the data with the given algorithm. That's a deficiency in aiohttp, but in this case it leads to the data being compressed twice
  • When compression in enabled, aiohttp sends the request with Transfer-Encoding: chunked. Our sentry installation didn't cope with it. Turning compression off in the client (as in the example above) leads to aiohttp sending the request with usual Content-Length headers etc and resulted in a successful request.

I'm doing a pull req against aiohttp that will hopefully resolve the issue.

@hynek
Copy link
Author

hynek commented Nov 7, 2015

@dcramer for me reproduction = trying to submit an error. :) I’m not sure why it would work for anyone. :)

@dcramer
Copy link
Member

dcramer commented Dec 28, 2015

This should be reoslved in 0.2.0

@dcramer dcramer closed this as completed Dec 28, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants