[11/Mar/2024 12:58:49] ERROR [dojo.engagement.views:750] unsupported operand type(s) for -: 'datetime.date' and 'NoneType'
Traceback (most recent call last):
File "/app/dojo/engagement/views.py", line 734, in post
test, finding_count, closed_finding_count, _ = importer.import_scan(scan, scan_type, engagement, user, environment, active=active, verified=verified, tags=tags,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/dojo/importers/importer/importer.py", line 344, in import_scan
new_findings = self.process_parsed_findings(test, parsed_findings, scan_type, user, active=active,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/dojo/decorators.py", line 48, in __wrapper__
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/celery/local.py", line 182, in __call__
return self._get_current_object()(*a, **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/celery/app/task.py", line 411, in __call__
return self.run(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/dojo/importers/importer/importer.py", line 110, in process_parsed_findings
item.save(dedupe_option=False)
File "/app/dojo/models.py", line 3029, in save
self.set_sla_expiration_date()
File "/app/dojo/models.py", line 2882, in set_sla_expiration_date
days_remaining = sla_period - self.sla_age
^^^^^^^^^^^^
File "/app/dojo/models.py", line 2862, in sla_age
return self._age(self.get_sla_start_date())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/dojo/models.py", line 2852, in _age
diff = get_current_date() - start_date
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'datetime.date' and 'NoneType'
Bug description
When you try to import a Nexpose report and don't specify a "Scan Completion Date", the import will fail. Pretty sure this is due to changes made in #9473. Doesn't happen with Burp imports for example. Disabling Finding SLA's and trying the import again causes another import error.
Steps to reproduce
Steps to reproduce the behavior:
Expected behavior
Successful import
Deployment method (select with an
X)Environment information
Ubuntu 18.04
DefectDojo version v. 2.31.5
Logs