Open-EO / openeo-aggregator

openEO driver that combines multiple other drivers
https://open-eo.github.io/openeo-aggregator/
Apache License 2.0
1 stars 1 forks source link

better handling of job metadata parse issues #109

Closed soxofaan closed 1 year ago

soxofaan commented 1 year ago

from https://github.com/openEOPlatform/architecture-docs/issues/321

When connecting to the dev aggregator, I can't list the batch jobs. I get the following error:

ValueError("time data '2023-04-11T13:47:57.798915' does not match format '%Y-%m-%dT%H:%M:%SZ'")

soxofaan commented 1 year ago

full stack trace

Traceback (most recent call last):
  File "/home/openeo/venv/lib/python3.8/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/openeo/venv/lib/python3.8/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/home/openeo/venv/lib/python3.8/site-packages/openeo_driver/users/auth.py", line 88, in decorated
    return f(*args, **kwargs)
  File "/home/openeo/venv/lib/python3.8/site-packages/openeo_driver/views.py", line 812, in list_jobs
    listing = backend_implementation.batch_jobs.get_user_jobs(user.user_id)
  File "/home/openeo/venv/lib/python3.8/site-packages/openeo_aggregator/backend.py", line 600, in get_user_jobs
    jobs.append(BatchJobMetadata.from_api_dict(job))
  File "/home/openeo/venv/lib/python3.8/site-packages/openeo_driver/backend.py", line 308, in from_api_dict
    kwargs = extract_namedtuple_fields_from_dict(
  File "/home/openeo/venv/lib/python3.8/site-packages/openeo_driver/utils.py", line 299, in extract_namedtuple_fields_from_dict
    result[k] = converter(result[k])
  File "/home/openeo/venv/lib/python3.8/site-packages/openeo_driver/utils.py", line 291, in <lambda>
    converters[datetime.datetime] = lambda v: rfc3339.parse_datetime(v)
  File "/home/openeo/venv/lib/python3.8/site-packages/openeo/util.py", line 135, in parse_datetime
    res = dt.datetime.strptime(x, "%Y-%m-%dT%H:%M:%SZ")
  File "/usr/local/lib/python3.8/_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/usr/local/lib/python3.8/_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '2023-04-11T13:47:57.798915' does not match format '%Y-%m-%dT%H:%M:%SZ'
soxofaan commented 1 year ago

done: