-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
RequestParsingError: Failed to decompress data. Not a gzipped file (b'un') #4816
Comments
That error is thrown when the first two bytes of the gzipped file are incorrect The gzip format begins with a "magic number" https://datatracker.ietf.org/doc/html/rfc1952#page-6
From gzip.py
suggests that when this error is being thrown we're receiving corrupt or incomplete data |
Ha :) the data is |
@mariusandra the next step that occurs to me is to log out from here https://github.com/PostHog/posthog-js/blob/800f4e373f46a0861383f7162c0aaf72d2a439d5/src/compression.js#L20 to Sentry Ideally, we can determine whether the undefined comes from the rrweb library or from our compression of the data Not sure if we log from that library historically, don't want to break things for users. Ideally I can force a log/error into Sentry, when it is available, and then return from the method unchanged so we preserve existing behaviour |
we coordinate two libraries here https://github.com/PostHog/posthog-js/blob/master/src/compression.js#L21 rrweb generates the snapshot events, fflate compresses the content one of these could be generating the undefined unexpectedly |
Great work tracking this down this far! Very curious to find out where it eventually breaks down... 🤔 |
* speculative logging for PostHog/posthog#4816 * use capture metrics to send debug messages home * adds tests and only sends debug "metrics" when debug is enabled * only check one flag before logging debug 'metrics' * update tests now that debug flag is not used in capture metrics: * add information to README on how to use yalc to develop locally * catch errors in new debug logging to avoid this check affecting users on error * remove usage of debug enabled as a parameter to capture metrics * add instructions to remove yalc linkage
Still seeing this event but not seeing capture metrics emitting debug information :'( |
The call chain is effectively
if But!
The API is logging 'undefined' not '"undefined"' as the error value. Suggesting that the input to strToU8 and strToU8 itself are not the problem |
The call chain is closer to
if |
This reverts commit 5447142.
This reverts commit 5447142.
We now log referrer to Sentry when this error occurs. Since the release of the specualtive fix in PostHog/posthog-js#300 we see fewer instances - 37 in the last 24 hours In those 37 we've only seen two customers with the undefined bug They're both on old versions of the library. And consistently send an empty body via sendBeacon on unload |
That's amazing! This took a lot of effort and head scratching, but I'm very glad it's fixed! 🎉 Going to close this issue. |
For future reference the fix for this went into posthog-js version 1.14.1 |
This seems related to session recordings being flakey.
See: #4815
Sentry Issue: POSTHOG-2PA
The text was updated successfully, but these errors were encountered: