Skip to content
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

Fix sending of GZIP-compressed requests when the enable_compression option is on #857

Merged
merged 2 commits into from
Jul 30, 2019
Merged

Fix sending of GZIP-compressed requests when the enable_compression option is on #857

merged 2 commits into from
Jul 30, 2019

Conversation

ste93cry
Copy link
Collaborator

Q A
Branch? 2.1
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
License MIT

When the enable_compression option was enabled it was affecting only the responses received by the server while first of all the requests should be compressed with GZIP. This PR fixes the problem. Note that if Sentry is running in uWSGI mode and behind a NGINX server as described in the documentation and the client sends a chunked request (as in our case) then a bug in the latter makes the proxied request have both the Transfer-Encoding and Content-Length headers set, which per HTTP/1.1 specs is not valid. For this reason Sentry will be unable to read the request content and will silently discard the event logging an error. The solution is to unset the Transfer-Encoding header in the NGINX config.

server {
  ...

  location / {
    include uwsgi_params;
    
    uwsgi_param HTTP_TRANSFER_ENCODING "";

    ...
  }
}

ping @HazAT can you please update the docs with the note about NGINX + uWSGI?

Copy link
Collaborator

@stayallive stayallive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it, thanks for the time to take another look at it and find what I could not 😄

.appveyor.yml Show resolved Hide resolved
@ste93cry ste93cry merged commit fc4cd99 into getsentry:master Jul 30, 2019
@ste93cry ste93cry deleted the fix/gzip-request-encoding branch July 30, 2019 12:01
HazAT added a commit that referenced this pull request Aug 22, 2019
* release/2.1.2:
  meta: Update changelog
  meta: Changelog 2.1.2
  Skip integrations not bound to the current client and fetch their options from it (#861)
  Do not set the transaction attribute of the event when in CLI (#864)
  Added OXID eShop to the list of 3rd party integrations (#860)
  Fix error thrown when function name is missing in the stacktrace frame (#823)
  Fix sending of GZIP-compressed requests when the enable_compression option is on (#857)

# Conflicts:
#	CHANGELOG.md
#	tests/ClientBuilderTest.php
Jean85 added a commit to Jean85/sentry-docs that referenced this pull request Sep 6, 2019
jan-auer added a commit to getsentry/sentry-docs that referenced this pull request Sep 23, 2019
* master: (22 commits)
  chore(proofreading): Remove pain (#1229)
  fix: Add note about complications in Django Channels (#1225)
  fix: Change the goroutine example order (#1226)
  swap compile for implementation in android gradle snippet
  feat: Sample for ASP.NETCore 3 (#1222)
  fix: Fix a broken link into Flask docs (#1224)
  change to using seconds as timeout measurement.
  feat: Added redirect for rollups
  feat: Added new grouping documentation (#1047)
  Mark two options as supported in the PHP SDK
  feat: Add ignore options docs for JS SDK (#1213)
  update URL snapshot
  review changes 1
  Update javascript documentation link
  docs: [sentry-cli] Update strip-prefix description (#1214)
  (ref)React Native: Fix typo, code formatting, and format notes (#1215)
  Fix formatting of levels in PHP docs (#1209)
  Add new uwsgi_param in suggested WSGI config as suggested in getsentry/sentry-php#857
  Make throttling/rate limiting docs more verbose #1193
  Fix typo
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants