recurrent nginx 502 bad gateway after about 5 days no access sentry
Self-Hosted Version
23.8.0
CPU Architecture
x86_64
Docker Version
22.0.5
Docker Compose Version
2.6.0
Steps to Reproduce
When i firstly accessed sentry to find any error logs after almost about 5 days,then i got this 502.
But if i refreshed this page again, then i accessed sentry successfully.
Also after very long days to access my sentry, i will got 502 again, :c, super noisy.
Expected Result
I can access my sentry successfully every single time!
Actual Result
2 questions:
一、
When i firstly accessed sentry to find any error logs after almost about 5 days,then i got this 502.
But if i refreshed this page again, then i accessed sentry successfully.
Also after very long days to access my sentry, i will got 502 again, :c, super noisy.
二、
I am not sure, dose the nginx.conf file work with sentry. I cannot find access.log or error.log work with sentry either.
Event ID
c2d85058-d3b0-4d85-a509-e2ba965845d7
You can try the instructions here to enable more nginx logs.
You can try the instructions here to enable more nginx logs.
Firstly,still no idea,about how could i enable more nginx logs.
Secondly,how to solve the 502 problem.
You will probably need to enable proxy buffering in your nginx configs on your machine. I'm suspecting the issue is similar to this one: https://github.com/getsentry/self-hosted/issues/2256
One thing that caught me out was that Sentry takes ages to start-up fully. Don't try anything until your server has been up and running for about 10 minutes.
Once the RAM usage gets upto about 6 GB it should be online. I use htop and watch the RAM usage climb up... ;)
As for Nginx this is the config I am using
# force https
server {
listen 80;
server_name sentry.mydomain.com;
return 301 https://$host$request_uri;
}
# main site processing
server {
# Set server name
server_name sentry.mydomain.com;
# Set default files to use for homepage
index index.html index.htm;
# route to port 9000
location / {
proxy_pass http://localhost:9000;
include proxy_params;
}
# deny other hidden files
location ~ /\.(?!well-known).* {
deny all;
}
# communicate with the browser over HTTPS
#listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/sentry.mydomain.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/sentry.mydomain.com/privkey.pem; # managed by Certbot
#include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
#ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
Forgot something...
Contents of the /etc/nginx/proxy_params file in the above config
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
...also in ~/.sentry/sentry/sentry.conf.py
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀