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

weird TypeError DryRunDataCube is not JSON serializable #567

Open
soxofaan opened this issue Nov 6, 2023 · 3 comments
Open

weird TypeError DryRunDataCube is not JSON serializable #567

soxofaan opened this issue Nov 6, 2023 · 3 comments

Comments

@soxofaan
Copy link
Member

soxofaan commented Nov 6, 2023

reported by @jdries earlier today: sometimes GET https://openeo.dataspace.copernicus.eu/openeo/1.1/processes fails with

TypeError('Object of type DryRunDataCube is not JSON serializable')
@soxofaan
Copy link
Member Author

soxofaan commented Nov 6, 2023

from logs in kibana:

Traceback (most recent call last):
  File "/opt/openeo/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/openeo/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/opt/openeo/lib/python3.8/site-packages/openeo_driver/util/view_helpers.py", line 42, in wrapped
    return func(*args, **kwargs)
  File "/opt/openeo/lib/python3.8/site-packages/openeo_driver/views.py", line 672, in processes
    return jsonify({'processes': processes, 'links': []})
  File "/opt/openeo/lib/python3.8/site-packages/flask/json/__init__.py", line 361, in jsonify
    f"{dumps(data, indent=indent, separators=separators)}\n",
  File "/opt/openeo/lib/python3.8/site-packages/flask/json/__init__.py", line 139, in dumps
    rv = _json.dumps(obj, **kwargs)
  File "/usr/lib64/python3.8/json/__init__.py", line 234, in dumps
    return cls(
  File "/usr/lib64/python3.8/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib64/python3.8/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/opt/openeo/lib/python3.8/site-packages/flask/json/__init__.py", line 57, in default
    return super().default(o)
  File "/usr/lib64/python3.8/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type DryRunDataCube is not JSON serializable

@soxofaan
Copy link
Member Author

soxofaan commented Nov 9, 2023

soxofaan added a commit to Open-EO/openeo-python-driver that referenced this issue Nov 9, 2023
…ss_graph_process

in-place modification might break re-JSON-encoding

related to Open-EO/openeo-geopyspark-driver#567
@soxofaan
Copy link
Member Author

soxofaan commented Nov 9, 2023

This one is hard to figure out, but I'm working on this hypothesis: we have this process graph node caching feature, which manipulates the process graph in-place (to cache values) and this manipulated process graph leaks into places where we assume the process graph is immutable.
Did first attempt to workaround this with Open-EO/openeo-python-driver@bf93bff

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