DefectDojo / django-DefectDojo

DevSecOps, ASPM, Vulnerability Management. All on one platform.
https://defectdojo.com
BSD 3-Clause "New" or "Revised" License
3.68k stars 1.55k forks source link

Metrics dashboard crash on nginx with 502 bad gateway #10259

Closed sebglon closed 4 months ago

sebglon commented 5 months ago

Bug description We have a big defectdojo. When we need to show the metris dashobard /metrics?date=5&view=dashboard, the query require 10G on the uwsgi and the nginx return an error

Steps to reproduce Steps to reproduce the behavior:

  1. Go to UI
  2. Click on metrics dashboard
  3. See error

Expected behavior The dashboard is well open

Deployment method (select with an X)

Environment information

Logs

2024/05/23 09:06:48 [error] 12#12: *265 upstream prematurely closed connection while reading response header from upstream, client: 10.233.114.23, server: , request: "GET /metrics?date=5&view=dashboard HTTP/1.1", upstream: "uwsgi://unix:///run/defectdojo/uwsgi.sock:", host: "defectdojo.xxxxxx"
10.233.114.23 - - [23/May/2024:09:06:48 +0000] "GET /metrics?date=5&view=dashboard HTTP/1.1" 502 497 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" "10.0.1.74"
Thu May 23 09:02:18 2024 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) !!!
Thu May 23 09:02:18 2024 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during GET /alerts/count (10.233.78.161)
GurbanV commented 4 months ago

@sebglon Hi! I fixed the same issue just adding more resource for uwsgi and a little bit for nginx container of django-defectdojo pod. My DefectDojo also deploy via k8s

manuel-sommer commented 4 months ago

I guess this can be closed @mtesauro .