Open-EO / openeo-geopyspark-driver

OpenEO driver for GeoPySpark (Geotrellis)
Apache License 2.0
25 stars 4 forks source link

log error details for PARTIAL SHub batch processes #686

Open bossie opened 4 months ago

bossie commented 4 months ago

Batch processes that fail with a PARTIAL status carry an error property e.g. "Too many failed tiles":

{
    "id": "d3e20617-86fd-49d2-9049-93832a0245d9",
    "processRequest": {
        "input": {
            "bounds": {
                "geometry": {
                    "type": "Polygon",
                    "crs": {
                        "type": "name",
                        "properties": {
                            "name": "urn:ogc:def:crs:OGC::CRS84"
                        }
                    },
                    "coordinates": [
                        [
                            [
                                4.289378217520509,
                                50.724074128385375
                            ],
                            [
                                4.289378217520509,
                                51.713327894895976
                            ],
                            [
                                5.868774248104696,
                                51.713327894895976
                            ],
                            [
                                5.868774248104696,
                                50.724074128385375
                            ],
                            [
                                4.289378217520509,
                                50.724074128385375
                            ]
                        ]
                    ]
                },
                "properties": {
                    "crs": "http://www.opengis.net/def/crs/EPSG/0/4326"
                }
            },
            "data": [
                {
                    "dataFilter": {
                        "timeRange": {
                            "from": "2019-01-02T10:34:07.476Z",
                            "to": "2019-05-26T10:33:55.925Z"
                        },
                        "mosaickingOrder": "mostRecent",
                        "maxCloudCoverage": 100.0
                    },
                    "processing": {},
                    "type": "LOTL2"
                }
            ]
        },
        "output": {
            "responses": [
                {
                    "identifier": "_20190102",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190109",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190111",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190118",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190125",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190127",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190203",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190210",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190212",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190219",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190226",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190228",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190307",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190314",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190316",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190323",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190330",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190401",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190408",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190415",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190417",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190424",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190501",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190503",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190510",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190517",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190519",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                },
                {
                    "identifier": "_20190526",
                    "format": {
                        "type": "image/tiff"
                    },
                    "logo": false
                }
            ]
        },
        "evalscript": "//VERSION=3\nfunction setup() {\n    return {\n        input: [\"B04\",\"B05\"],\n        output: [{\n    id: \"_20190102\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190109\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190111\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190118\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190125\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190127\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190203\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190210\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190212\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190219\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190226\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190228\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190307\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190314\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190316\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190323\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190330\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190401\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190408\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190415\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190417\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190424\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190501\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190503\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190510\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190517\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190519\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n},\n{\n    id: \"_20190526\",\n    bands: 2,\n    sampleType: \"FLOAT32\"\n}],\n        mosaicking: \"ORBIT\"\n    };\n}\n\nfunction evaluatePixel(samples, scenes) {\n    return {\n        _20190102: bandValues(samples, scenes, \"_20190102\"),\n_20190109: bandValues(samples, scenes, \"_20190109\"),\n_20190111: bandValues(samples, scenes, \"_20190111\"),\n_20190118: bandValues(samples, scenes, \"_20190118\"),\n_20190125: bandValues(samples, scenes, \"_20190125\"),\n_20190127: bandValues(samples, scenes, \"_20190127\"),\n_20190203: bandValues(samples, scenes, \"_20190203\"),\n_20190210: bandValues(samples, scenes, \"_20190210\"),\n_20190212: bandValues(samples, scenes, \"_20190212\"),\n_20190219: bandValues(samples, scenes, \"_20190219\"),\n_20190226: bandValues(samples, scenes, \"_20190226\"),\n_20190228: bandValues(samples, scenes, \"_20190228\"),\n_20190307: bandValues(samples, scenes, \"_20190307\"),\n_20190314: bandValues(samples, scenes, \"_20190314\"),\n_20190316: bandValues(samples, scenes, \"_20190316\"),\n_20190323: bandValues(samples, scenes, \"_20190323\"),\n_20190330: bandValues(samples, scenes, \"_20190330\"),\n_20190401: bandValues(samples, scenes, \"_20190401\"),\n_20190408: bandValues(samples, scenes, \"_20190408\"),\n_20190415: bandValues(samples, scenes, \"_20190415\"),\n_20190417: bandValues(samples, scenes, \"_20190417\"),\n_20190424: bandValues(samples, scenes, \"_20190424\"),\n_20190501: bandValues(samples, scenes, \"_20190501\"),\n_20190503: bandValues(samples, scenes, \"_20190503\"),\n_20190510: bandValues(samples, scenes, \"_20190510\"),\n_20190517: bandValues(samples, scenes, \"_20190517\"),\n_20190519: bandValues(samples, scenes, \"_20190519\"),\n_20190526: bandValues(samples, scenes, \"_20190526\")\n    };\n}\n\nfunction bandValues(samples, scenes, identifier) {\n    function asIdentifier(orbit) {\n        let year = orbit.dateFrom.substr(0, 4)\n        let month = orbit.dateFrom.substr(5, 2)\n        let day = orbit.dateFrom.substr(8, 2)\n        return `_${year}${month}${day}`\n    }\n\n    function indexOfIdentifier() {\n        return scenes.orbits.findIndex(orbit => asIdentifier(orbit) === identifier)\n    }\n\n    let sampleIndex = indexOfIdentifier()\n    return sampleIndex >= 0 ? [samples[sampleIndex].B04,samples[sampleIndex].B05] : [0,0]\n}\n"
    },
    "tilingGrid": {
        "id": 1,
        "resolution": 10.0
    },
    "userId": "c7f2fe23-fe01-4815-a54d-851517c69f98",
    "accountId": "09597513-3322-4ceb-80b4-6905cf43b222",
    "status": "PARTIAL",
    "error": "Too many failed tiles",
    "userAction": "START",
    "userActionUpdated": "2024-02-14T10:05:40.136263Z",
    "output": {
        "defaultTilePath": "s3://openeo-sentinelhub-uswest2",
        "overwrite": true,
        "skipExisting": false,
        "outputEmpty": true,
        "cogOutput": true,
        "createCollection": false
    },
    "description": "landsat-ot-l2 1 2019-01-01T00:00:00+00:00 2019-05-31T23:59:59.999999999Z [B04, B05]",
    "created": "2024-02-14T09:22:43.352840Z",
    "valueEstimate": 35397.00083789891,
    "tileCount": 146,
    "tileWidthPx": 1000,
    "tileHeightPx": 1000
}

https://github.com/Open-EO/openeo-geopyspark-driver/issues/354 added logging of these error details for FAILED batch processes but this can also be done for batch processes that fail with a PARTIAL status twice (in which case we abort).

Note that the individual tiles (/api/batch/process/abc123/tiles) don't carry more details (they just have a status of FAILED).