Open-EO / openeo-earthengine-driver

openEO back-end driver for Google Earth Engine.
Apache License 2.0
21 stars 7 forks source link

Validation endpoint reports errors for process graph that works #28

Closed christophfriedrich closed 4 years ago

christophfriedrich commented 4 years ago

I just tested the first process graph that is currently shared on the Hub (the max NDVI one, pasted below) against the /validation endpoint of the driver.

I get this reponse:

{
    "errors": [
        {
            "id": "1568129980622",
            "code": "StartNodeMissing",
            "message": "No start nodes found for process graph.",
            "url": "https://open-eo.github.io/openeo-api/errors/#openeo-error-codes"
        }
    ]
}

~(Interestingly with a 200 OK status code; I'll open a separate issue for that.)~ Edit: I re-read the spec and apparently that is absolutely correct behaviour.

But when I paste that same process graph into the Web Editor, save it as a Web Service and show that service on the map, everything works perfectly fine.

Process graph used:

{ "1": { "process_id": "load_collection", "arguments": { "id": "COPERNICUS/S2", "spatial_extent": null, "temporal_extent": [ "2018-04-30", "2018-06-26" ], "bands": [ "B4", "B8" ] } }, "2": { "process_id": "normalized_difference_fast", "arguments": { "data": { "from_node": 1 }, "band1": "B4", "band2": "B8" } }, "3": { "process_id": "reduce", "arguments": { "data": { "from_node": 2 }, "reducer": { "callback": { "min": { "arguments": { "data": { "from_argument": "data" } }, "process_id": "min", "result": true } } }, "dimension": "temporal" } }, "4": { "process_id": "apply", "arguments": { "data": { "from_node": 3 }, "process": { "callback": { "lsr": { "arguments": { "x": { "from_argument": "x" }, "inputMin": -1, "inputMax": 1, "outputMin": 0, "outputMax": 255 }, "process_id": "linear_scale_range", "result": true } } } } }, "5": { "process_id": "save_result", "arguments": { "data": { "from_node": 4 }, "format": "png" }, "result": true } }

m-mohr commented 4 years ago

Thanks for reporting this. I'll check that later.

The 200 OK status code is correct. The status code is about whether the request succeeded, but doesn't imply anything on the validation.

200 + 0 errors in list => process graph valid 200 + 1+ errors in list => process graph invalid 400/500 error => your request was incorrect (e.g. send XML instead of JSON) or server errors (e.g. busy/not found/...)

m-mohr commented 4 years ago

Did you send only the process graph or was it wrapped into a { process_graph: ... }? Please check the API how a valid request has to be sent.

christophfriedrich commented 4 years ago

Re: 200 OK You're too quick! :D See edit above. I noticed that status code because in openEO v0.3 a valid process graph was characterized by a 204. But the change is very reasonable.

Re: Was it wrapped in process_graph? Of course it was not, the mistake was on the client side and you found it spot on :upside_down_face: