pyrollbar icon indicating copy to clipboard operation
pyrollbar copied to clipboard

Truncate large payloads to ensure we don't drop them

Open rivkahstandig3636 opened this issue 7 years ago • 9 comments

rivkahstandig3636 avatar Mar 15 '18 05:03 rivkahstandig3636

Still happening.

Our work-around is to check the size request.body. If greatear than 1 MB, we drop the traceback.

DZPM avatar Apr 16 '19 08:04 DZPM

@DZPM while reporting error on rollbar, I am also getting below error. errors on rollbar are being reported at different places in different files, do you know how can I trace back where this is coming from? And how to stop this error to pop up again?

Failsafe from pyrollbar: payload too large. Original payload may be found in your server logs by searching for the UUID.

Below is how I report errors on rollbar, where do you check the request.body size? rollbar.report_exc_info()

AwaishK avatar Jun 17 '20 12:06 AwaishK

@AwaishK I'm afraid don't have access to that codebase anymore. I guess you should check the size before reporting to rollbar. Good luck!

DZPM avatar Jun 17 '20 14:06 DZPM

Any workaround for this? I am getting this regularly when sqlalchemy throws an exception.

camden-lowrance avatar Feb 14 '22 18:02 camden-lowrance

Xometry is also experiencing this problem: the data that is too large is locals data from the stack frames of the exception: it would be perfectly acceptable, if locals data is too large, to partially or complete omit it from the payload.

bsmedberg-xometry avatar Jul 21 '22 14:07 bsmedberg-xometry

Here is a blunt instrument as a workaround... you can disable locals collection entirely with:

rollbar.SETTINGS['locals']['enabled'] = False

Agree this should be handled better; @bsmedberg-xometry 's suggestion makes sense to me.

brianr avatar Jul 21 '22 19:07 brianr

We had a similar issue where the default rollbar shortener transform wasn't shortening parts of our payload. We added a custom payload handler using Link to shorten the payload with custom logic.

saiyalamarty avatar Aug 03 '22 19:08 saiyalamarty

Adding this to my Rollbar config solved the problem for us:

        'shortener_keys': [
            ('request', 'POST', '*'),
            ('request', 'POST', '*', '*'),
            ('request', 'POST', '*', '*', '*'),
            ('body', 'trace', 'frames', '*', 'locals', '*', '*'),
            ('body', 'trace', 'frames', '*', 'locals', '*', '*', '*'),
        ]

The default shortener keys defined here don't truncate values inside local variable dictionaries, and they don't truncate POST values inside dictionaries either.

schmave avatar Jan 26 '23 15:01 schmave