We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Be informative DD raises an exception (HTTP-500 - internal server error) if a user uses a name of an non-existing environment in (re)imports
Bug description
ImportScanSerializer.set_context and ReImportScanSerializer.set_context uses
ImportScanSerializer.set_context
ReImportScanSerializer.set_context
context["environment"] = Development_Environment.objects.get( name=data.get("environment", "Development") )
which is able to handle not defined environment but does not handle non-existenting one
environment
Steps to reproduce
curl -X 'POST' \ 'http://xxx:8080/api/v2/reimport-scan/' \ ... -F 'environment=non_existing_enviro' \ ...
Expected behavior There are 2 options
set_context
Deployment method (select with an X)
X
Environment information
Logs
uwsgi-1 | [14/May/2024 19:26:39] ERROR [dojo.api_v2.exception_handler:43] Development_Environment matching query does not exist. uwsgi-1 | Traceback (most recent call last): uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 506, in dispatch uwsgi-1 | response = handler(request, *args, **kwargs) uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/rest_framework/mixins.py", line 19, in create uwsgi-1 | self.perform_create(serializer) uwsgi-1 | File "/app/dojo/api_v2/views.py", line 2792, in perform_create uwsgi-1 | serializer.save(push_to_jira=push_to_jira) uwsgi-1 | File "/app/dojo/api_v2/serializers.py", line 2538, in save uwsgi-1 | context = self.set_context(data) uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^ uwsgi-1 | File "/app/dojo/api_v2/serializers.py", line 2415, in set_context uwsgi-1 | context["environment"] = Development_Environment.objects.get( uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/db/models/manager.py", line 85, in manager_method uwsgi-1 | return getattr(self.get_queryset(), name)(*args, **kwargs) uwsgi-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ uwsgi-1 | File "/usr/local/lib/python3.11/site-packages/django/db/models/query.py", line 650, in get uwsgi-1 | raise self.model.DoesNotExist( uwsgi-1 | dojo.models.Development_Environment.DoesNotExist: Development_Environment matching query does not exist. uwsgi-1 | [14/May/2024 19:26:39] ERROR [django.request:241] Internal Server Error: /api/v2/reimport-scan/
The text was updated successfully, but these errors were encountered:
im actually seeing this error on import with undefined environment in 2.33.7
edit: looks like this dd instance did not get the default environments created, somehow
Sorry, something went wrong.
No branches or pull requests
Be informative
DD raises an exception (HTTP-500 - internal server error) if a user uses a name of an non-existing environment in (re)imports
Bug description
ImportScanSerializer.set_context
andReImportScanSerializer.set_context
useswhich is able to handle not defined
environment
but does not handle non-existenting oneSteps to reproduce
Expected behavior
There are 2 options
set_context
is happening outside of AutoCreate contextDeployment method (select with an
X
)Environment information
Logs
The text was updated successfully, but these errors were encountered: