Skip to content
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

MultipleObjectsReturned at /pentest/add_vuln/ #602

Open
RooshanNaeem opened this issue Mar 31, 2023 · 0 comments
Open

MultipleObjectsReturned at /pentest/add_vuln/ #602

RooshanNaeem opened this issue Mar 31, 2023 · 0 comments

Comments

@RooshanNaeem
Copy link

Hi,

I am trying to add vulnerability in archerysec manually, I have added 2 vulns but when I try to add another one it throws me below error. Any idea what might be the reason?

Environment:

Request Method: GET
Request URL: http://0.0.0.0:8000/pentest/add_vuln/?scan_id=3111cdcb-5704-4042-b120-c0cf4841f12d&project_id=48171bf6-2451-45a2-914c-0d89c671eeca

Django Version: 3.2.15
Python Version: 3.10.6
Installed Applications:
['archerysecurity',
'rest_framework',
'webscanners',
'projects',
'archerysettings',
'archeryapi',
'networkscanners',
'staticscanners',
'cloudscanners',
'jiraticketing',
'cicd',
'tools',
'pentest',
'report_upload',
'django.contrib.admin',
'stronghold',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework.authtoken',
'debug_toolbar',
'dashboard',
'background_task',
'sitetree',
'import_export',
'compliance',
'notifications',
'user_management',
'authentication',
'rest_framework_simplejwt.token_blacklist']
Installed Middleware:
['debug_toolbar.middleware.DebugToolbarMiddleware',
'django.middleware.security.SecurityMiddleware',
'stronghold.middleware.LoginRequiredMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware']

Traceback (most recent call last):
File "/home/rooshan/archerysec/venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/home/rooshan/archerysec/venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/rooshan/archerysec/venv/lib/python3.10/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/home/rooshan/archerysec/venv/lib/python3.10/site-packages/django/views/generic/base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
File "/home/rooshan/archerysec/venv/lib/python3.10/site-packages/rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
File "/home/rooshan/archerysec/venv/lib/python3.10/site-packages/rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/home/rooshan/archerysec/venv/lib/python3.10/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/home/rooshan/archerysec/venv/lib/python3.10/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "/home/rooshan/archerysec/pentest/views.py", line 156, in get
all_vuln = PentestScanResultsDb.objects.get(scan_id=scan_id)
File "/home/rooshan/archerysec/venv/lib/python3.10/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/rooshan/archerysec/venv/lib/python3.10/site-packages/django/db/models/query.py", line 439, in get
raise self.model.MultipleObjectsReturned(

Exception Type: MultipleObjectsReturned at /pentest/add_vuln/
Exception Value: get() returned more than one PentestScanResultsDb -- it returned 2!

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

No branches or pull requests

1 participant