-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Unable to open Sentry with Safari, possibly related to Content-Encoding: gzip #2285
Comments
Note that this issue only popped up after upgrading to 23.7.0, previous versions had no issues. |
Is there any way to connect directly to the Sentry instance without Caddy in the middle, to see if the headers are still incorrect? |
Yes; I've just found a local instance that is directly accessible and has the same issue. Trying it out with Safari and using its "copy as curl" and executing that (with an additional curl from safari
so it looks like it is serving the right thing (a gzip-ed file, with the correct Content-Encoding and Content-Type headers) - but Safari is choking on it. Doing the same with Chrome gives: curl from Chrome
Note that the Chrome-generated Trying this with Firefox yields the same results as Chrome. (Upon further inspection, |
Also seeing this with the latest self-hosted version. It seems to me that the files may be gzip compressed twice. |
Upon further inspection, nope, the response is gzip compressed only once. Safari trips up on the I'm serving Sentry via nginx, so adding this made the site work with Safari again:
|
Thanks @laurikari , can confirm a similar workaround works with Caddy
to the caddyfile snippet for our sentry host.) |
We've managed to replicate this on our dogfood self-hosted instance. Currently working on getting a fix up. |
So we weren't able to replicate the fix on our local instance (Safari verson 16.5). We tried both |
Hmm, adding If I remove it, the issue reappears. I did have to empty caches (or do a shift-reload) after changing the nginx config, otherwise Safari uses cached values for the CSS and JS files. Latest Safari on macOS arm64 (16.5.2 18615.2.9.11.10). |
Ah, I generally use Chrome for development, I misunderstood how caches are reset in Safari 🤦 . Looks good on my machine as well, pushing the fix now. |
With release 23.7.0, the upstream sentry@23.7.0 upgraded Django to 3.2.20, a breaking change for that dependency. This introduced a number of bugs into self-hosted, including one where the Content-Disposition response header is now set by Django in a manner that is illegible to Safari, as documenting in https://code.djangoproject.com/ticket/31082. This change modifies the default nginx config to override this header with the simpler `inline` setting, allowing Safari to properly decompress gzipped resources like CSS and Javascript bundles. Fixes #2285
With release 23.7.0, the upstream sentry@23.7.0 upgraded Django to 3.2.20, a breaking change for that dependency. This introduced a number of bugs into self-hosted, including one where the Content-Disposition response header is now set by Django in a manner that is illegible to Safari, as documenting in https://code.djangoproject.com/ticket/31082. This change modifies the default nginx config to override this header with the simpler `inline` setting, allowing Safari to properly decompress gzipped resources like CSS and Javascript bundles. Fixes #2285
With release 23.7.0, the upstream sentry@23.7.0 upgraded Django to 3.2.20, a breaking change for that dependency. This introduced a number of bugs into self-hosted, including one where the Content-Disposition response header is now set by Django in a manner that is illegible to Safari, as documenting in https://code.djangoproject.com/ticket/31082. This change modifies the default nginx config to override this header with the simpler `inline` setting, allowing Safari to properly decompress gzipped resources like CSS and Javascript bundles. Fixes #2285
For future reference, the upstream Django 3 bug where they say they won't fix it :/ https://code.djangoproject.com/ticket/31082 |
With release 23.7.0, the upstream sentry@23.7.0 upgraded Django to 3.2.20, a breaking change for that dependency. This introduced a number of bugs into self-hosted, including one where the Content-Disposition response header is now set by Django in a manner that is illegible to Safari, as documenting in https://code.djangoproject.com/ticket/31082. This change modifies the default nginx config to override this header with the simpler `inline` setting, allowing Safari to properly decompress gzipped resources like CSS and Javascript bundles. Fixes #2285
This fix is currently being merged. It will be included in the 23.7.1 release I am currently preparing. |
With release 23.7.0, the upstream sentry@23.7.0 upgraded Django to 3.2.20, a breaking change for that dependency. This introduced a number of bugs into self-hosted, including one where the Content-Disposition response header is now set by Django in a manner that is illegible to Safari, as documenting in https://code.djangoproject.com/ticket/31082. This change modifies the default nginx config to override this header with the simpler `inline` setting, allowing Safari to properly decompress gzipped resources like CSS and Javascript bundles. Fixes #2285
I have tried deleting all cache, and reload even going as far as to restart my Mac. Still no luck... |
Looks like this hacky workaround is creating issues: |
After the release of 23.9.1, this problem began to reproduce again. Can we bring this hack back or come up with other ways to make Safari work properly? |
It's been broken since mid july... |
If you use Apache as frontend proxy, you can workaround this issue by adding this to your vhost config:
(requires mod_headers) |
Unfortunately, we don't have a good solution right now. This doesn't appear to be an issue specically with our code, but an issue with the way Safari handles the headers in Django 3. This hack cannot come back because it is a bigger issue that attachments are not being downloaded properly, which is a result of the workaround. You are free to use the hacky workaround in your own instance if you'd like. |
Looking at fixing this for our single tenant deployments, and it seems like we can fix it specifically for our static files without touching anything else like so:
|
Fixes #2285 Applies the same `proxy_hide_header Content-Disposition;`, but only to paths that start with `_static/` which should avoid the issue introduced previously with attachment downloads.
* Update nginx.conf Fixes #2285 Applies the same `proxy_hide_header Content-Disposition;`, but only to paths that start with `_static/` which should avoid the issue introduced previously with attachment downloads. * Update nginx/nginx.conf Co-authored-by: Amin Vakil <info@aminvakil.com> --------- Co-authored-by: Amin Vakil <info@aminvakil.com>
Sentry 23.10.0 same issue on safari 17 |
It works for me with 23.10.0 in Safari, both version 16 and 17. Might be a browser cache issue or something |
Theres a bug in Sentry, which prevens Safari from rendering assets (JS). getsentry/self-hosted#2285 It was fixed for the self-hosted deploy by adding a 'proxy_hide_header' statement. getsentry/self-hosted@ab9dbbd
* fix: hide content-disposition header on /static for Safari Theres a bug in Sentry, which prevens Safari from rendering assets (JS). getsentry/self-hosted#2285 It was fixed for the self-hosted deploy by adding a 'proxy_hide_header' statement. getsentry/self-hosted@ab9dbbd * fix: tabs / whitespace * chore: update chart version
With release 23.7.0, the upstream sentry@23.7.0 upgraded Django to 3.2.20, a breaking change for that dependency. This introduced a number of bugs into self-hosted, including one where the Content-Disposition response header is now set by Django in a manner that is illegible to Safari, as documenting in https://code.djangoproject.com/ticket/31082. This change modifies the default nginx config to override this header with the simpler `inline` setting, allowing Safari to properly decompress gzipped resources like CSS and Javascript bundles. Fixes getsentry#2285
* Update nginx.conf Fixes getsentry#2285 Applies the same `proxy_hide_header Content-Disposition;`, but only to paths that start with `_static/` which should avoid the issue introduced previously with attachment downloads. * Update nginx/nginx.conf Co-authored-by: Amin Vakil <info@aminvakil.com> --------- Co-authored-by: Amin Vakil <info@aminvakil.com>
* Update nginx.conf Fixes getsentry#2285 Applies the same `proxy_hide_header Content-Disposition;`, but only to paths that start with `_static/` which should avoid the issue introduced previously with attachment downloads. * Update nginx/nginx.conf Co-authored-by: Amin Vakil <info@aminvakil.com> --------- Co-authored-by: Amin Vakil <info@aminvakil.com>
Self-Hosted Version
23.7.0
CPU Architecture
x86_64
Docker Version
24.0.2
Docker Compose Version
2.18.1
Steps to Reproduce
Go to the sentry main page with the latest Safari browser (16.5.1).
Expected Result
I was expecting a styled and working login page.
Actual Result
It doesn't work. Browser Console shows:
This appears to be related to app.js being transfer-encoded with gzip, but Safari not picking this up and trying to parse the gzipped data as javascript. This does work with Chrome for example.
Note that we're running Sentry behind Caddy, which may be interfering with headers.
Event ID
No response
The text was updated successfully, but these errors were encountered: