Skip to content

500 Internal Server Error when accessing specific host detail pages #12295

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

Open
1 of 3 tasks
yerayvillamarin opened this issue Apr 23, 2025 · 2 comments
Open
1 of 3 tasks
Labels

Comments

@yerayvillamarin
Copy link

yerayvillamarin commented Apr 23, 2025

Bug description
Accessing certain hosts results in a 500 Internal Server Error. This occurs when visiting specific host detail pages.

Steps to reproduce
Steps to reproduce the behavior:

  1. Go to 'Hosts' page
  2. Click on a host (e.g., host with ID 906)
  3. Observe the page load
  4. See error: 500 Internal Server Error

Expected behavior
The host detail page should render successfully, displaying the corresponding information for the selected host.

Deployment method (select with an X)

  • Docker Compose
  • Kubernetes
  • GoDojo

Environment information

  • Operating System: Ubuntu 24.04 LTS
  • Docker Compose or Helm version Latest
  • DefectDojo version (see footer) or commit message: 2.45.2

Logs
uwsgi-1 | [23/Apr/2025 09:40:13] ERROR [django.request:248] Internal Server Error: /endpoint/host/906
uwsgi-1 | Traceback (most recent call last):
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
uwsgi-1 | response = get_response(request)
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
uwsgi-1 | response = wrapped_callback(request, *callback_args, **callback_kwargs)
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/app/dojo/authorization/authorization_decorators.py", line 36, in _wrapped
uwsgi-1 | return func(request, *args, **kwargs)
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/app/dojo/endpoint/views.py", line 175, in view_endpoint_host
uwsgi-1 | return process_endpoint_view(request, eid, host_view=True)
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/app/dojo/endpoint/views.py", line 154, in process_endpoint_view
uwsgi-1 | return render(request,
uwsgi-1 | ^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/shortcuts.py", line 25, in render
uwsgi-1 | content = loader.render_to_string(template_name, context, request, using=using)
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/loader.py", line 62, in render_to_string
uwsgi-1 | return template.render(context, request)
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/backends/django.py", line 107, in render
uwsgi-1 | return self.template.render(context)
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 171, in render
uwsgi-1 | return self._render(context)
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 163, in _render
uwsgi-1 | return self.nodelist.render(context)
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 1008, in render
uwsgi-1 | return SafeString("".join([node.render_annotated(context) for node in self]))
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 1008, in
uwsgi-1 | return SafeString("".join([node.render_annotated(context) for node in self]))
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 969, in render_annotated
uwsgi-1 | return self.render(context)
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/loader_tags.py", line 159, in render
uwsgi-1 | return compiled_parent._render(context)
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 163, in _render
uwsgi-1 | return self.nodelist.render(context)
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 1008, in render
uwsgi-1 | return SafeString("".join([node.render_annotated(context) for node in self]))
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 1008, in
uwsgi-1 | return SafeString("".join([node.render_annotated(context) for node in self]))
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 969, in render_annotated
uwsgi-1 | return self.render(context)
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/loader_tags.py", line 65, in render
uwsgi-1 | result = block.nodelist.render(context)
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 1008, in render
uwsgi-1 | return SafeString("".join([node.render_annotated(context) for node in self]))
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 1008, in
uwsgi-1 | return SafeString("".join([node.render_annotated(context) for node in self]))
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 969, in render_annotated
uwsgi-1 | return self.render(context)
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/defaulttags.py", line 327, in render
uwsgi-1 | return nodelist.render(context)
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 1008, in render
uwsgi-1 | return SafeString("".join([node.render_annotated(context) for node in self]))
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 1008, in
uwsgi-1 | return SafeString("".join([node.render_annotated(context) for node in self]))
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 969, in render_annotated
uwsgi-1 | return self.render(context)
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/defaulttags.py", line 327, in render
uwsgi-1 | return nodelist.render(context)
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 1008, in render
uwsgi-1 | return SafeString("".join([node.render_annotated(context) for node in self]))
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 1008, in
uwsgi-1 | return SafeString("".join([node.render_annotated(context) for node in self]))
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 969, in render_annotated
uwsgi-1 | return self.render(context)
uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/template/defaulttags.py", line 198, in render
uwsgi-1 | values = list(values)
uwsgi-1 | ^^^^^^^^^^^^
uwsgi-1 | ValueError: zip() argument 2 is shorter than argument 1
uwsgi-1 | [pid: 32|app: -|req: -/-] 10.69.88.129 (admin) {46 vars in 1099 bytes} [Wed Apr 23 09:40:13 2025] GET /endpoint/host/906 => generated 45485 bytes in 765 msecs (HTTP/1.1 500) 7 headers in 242 bytes (1 switches on core 1)
nginx-1 | 10.69.88.129 - - [23/Apr/2025:09:40:14 +0000] "GET /endpoint/host/906 HTTP/1.1" 500 45485 "http://10.69.88.135:8080/endpoint/host?product=8&page_size=76" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36" "-"

Screenshots

Image

@manuel-sommer
Copy link
Contributor

Could you share a sample file to reproduce this?

@yerayvillamarin
Copy link
Author

Yes, we upload OpenVAS reports in CSV format via the API to an engagement. I'm attaching a sample CSV file that causes the error when trying to view the corresponding host detail page. Let me know if you need any other info to reproduce the issue.

report-4379aa53-f6d6-4579-8f2a-e708cfd7b362.csv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants