Skip to content

UWSGI container crashes when logging in #14123

@enidevops

Description

@enidevops

Bug description
I did a fresh install of DefectDojo on a k3s cluster using the latest DefectDojo Helm chart and DefectDojo v2.54.1. The installation/sync completes without errors, and the UI loads, but login fails consistently.

When submitting the login form (POST /login?next=/), the browser shows a 502 Bad Gateway (see screenshot). At the same time, the uwsgi container crashes/restarts without any errors in the logfile, and the nginx container logs show upstream failures to the uWSGI socket.

Image

Uwsgi logs:

uwsgi.log

Nginx logs:

2026/01/19 14:50:46 [error] 15#15: *18666 upstream prematurely closed connection while reading response header from upstream, client: 10.244.1.123, server: , request: "POST /login?next=/ HTTP/1.1", upstream: "uwsgi://unix:///run/defectdojo/uwsgi.sock:", host: "portal.tail073687.ts.net", referrer: "https://portal.tail073687.ts.net/login?next=/" 10.244.1.123 - - [19/Jan/2026:14:50:46 +0000] "POST /login?next=/ HTTP/1.1" 502 497 "https://portal.tail073687.ts.net/login?next=/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36" "100.65.7.94" 2026/01/19 14:50:46 [error] 15#15: *18666 connect() to unix:///run/defectdojo/uwsgi.sock failed (111: Connection refused) while connecting to upstream, client: 10.244.1.123, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "uwsgi://unix:///run/defectdojo/uwsgi.sock:", host: "portal.tail073687.ts.net", referrer: "https://portal.tail073687.ts.net/login?next=/" 10.244.1.123 - - [19/Jan/2026:14:50:46 +0000] "GET /favicon.ico HTTP/1.1" 502 497 "https://portal.tail073687.ts.net/login?next=/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36" "100.65.7.94" 2026/01/19 14:50:51 [error] 13#13: *18686 connect() to unix:///run/defectdojo/uwsgi.sock failed (111: Connection refused) while connecting to upstream, client: 10.244.1.1, server: , request: "GET /uwsgi_health HTTP/1.1", upstream: "uwsgi://unix:///run/defectdojo/uwsgi.sock:", host: "portal.tail073687.ts.net" 10.244.1.1 - - [19/Jan/2026:14:50:51 +0000] "GET /uwsgi_health HTTP/1.1" 502 497 "-" "kube-probe/1.34" "-"

Here are the logs from the postgresql pod (I tried an external db as well, same result):

"dojo_system_settings"."non_common_password_required", "dojo_system_settings"."api_expose_error_details", "dojo_system_settings"."filter_string_matching" FROM "dojo_system_settings" LIMIT 21 2026-01-18 21:38:21.282 GMT [159] LOG: checkpoint starting: time 2026-01-18 21:40:11.005 GMT [159] LOG: checkpoint complete: wrote 1090 buffers (6.7%); 0 WAL file(s) added, 0 removed, 0 recycled; write=109.225 s, sync=0.402 s, total=109.723 s; sync files=1624, longest=0.051 s, average=0.001 s; distance=9372 kB, estimate=9372 kB; lsn=0/22304F0, redo lsn=0/2230460 2026-01-19 04:03:28.091 GMT [159] LOG: checkpoint starting: time 2026-01-19 04:03:28.402 GMT [159] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.302 s, sync=0.003 s, total=0.312 s; sync files=3, longest=0.002 s, average=0.001 s; distance=6 kB, estimate=8435 kB; lsn=0/2231EF0, redo lsn=0/2231E98

Additionally, here is my values.yaml:

values.txt

Steps to reproduce
Steps to reproduce the behavior:

  1. Go to defectdojo.url
  2. Put in Login Credentials
  3. Click on 'Login'
  4. See error

Expected behavior
Container doesn't crash and the login succeeds

Deployment method (select with an X)

  • Docker Compose
  • [ X] Kubernetes
  • GoDojo

Environment information

  • Operating System: Ubuntu 24.04 + k3s
  • DefectDojo + Helm 2.54.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions