cve-search/vulnerability-lookup

Add exception for GSD import

FafnerKeyZee opened this issue · 2 comments

Hello,

Some date are a little weird with GSD and we got the following error:

2023-09-30 13:54:22,649 GSDImporter ERROR:Something went terribly wrong in GSDImporter.
Traceback (most recent call last):
  File "/home/fafner/vulnerability-lookup/vulnerabilitylookup/default/abstractmanager.py", line 144, in run
    self._to_run_forever()
  File "/home/fafner/vulnerability-lookup/bin/gsd.py", line 22, in _to_run_forever
    self.gsd.gsd_update()
  File "/home/fafner/vulnerability-lookup/vulnerabilitylookup/feeders/gsd.py", line 91, in gsd_update
    last_modified = fromisoformat_wrapper(vuln['gsd']['modified'])
  File "/home/fafner/vulnerability-lookup/vulnerabilitylookup/helpers.py", line 16, in fromisoformat_wrapper
    return datetime.fromisoformat(date_iso)
ValueError: Invalid isoformat string: '2022-09-30Y14:31:09.936138101+00:00'

Not sure that adding date_iso = date_iso.replace('Y','T').split('.')[0] in vulnerabilitylookup/helpers.py is the best solution but it's working \o/

Better solution: Run with python3.11 \o/
Did some test with python 3.11.0rc1 on Ubuntu 22.04
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy

And all seems working fine

Rafiot commented

Fixed for python < 3.11. Turns out the Y/T doesn't matters, only the nanoseconds.