Open-EO / openeo-geotrellis-extensions

Java/Scala extensions for Geotrellis, for use with OpenEO GeoPySpark backend.
Apache License 2.0
5 stars 3 forks source link

warning: FileAlreadyExistsException when writing STAC item #200

Open bossie opened 1 year ago

bossie commented 1 year ago

Noticed while running a process graph locally; happens on Terrascope as well as k8s, in sync requests as well as batch jobs (see Kibana).

{
  "name": "org.openeo.geotrellis.stac.STACItem",
  "levelname": "WARNING",
  "message": "Failed to write STAC metadata.",
  "created": 1693894773.0090775,
  "filename": "STACItem.scala",
  "lineno": 72,
  "exc_info": "java.nio.file.FileAlreadyExistsException: /tmp/openeo-pydrvr-c4l63aw7.save_result_item.json\n\tat java.base/sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:453)\n\tat java.base/sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:266)\n\tat java.base/java.nio.file.Files.move(Files.java:1430)\n\tat org.openeo.geotrellis.stac.STACItem.write(STACItem.scala:68)\n\tat org.openeo.geotrellis.geotiff.package$.saveRDDGeneric(package.scala:266)\n\tat org.openeo.geotrellis.geotiff.package$.saveRDD(package.scala:145)\n\tat org.openeo.geotrellis.geotiff.package.saveRDD(package.scala)\n\tat java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:578)\n\tat py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)\n\tat py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)\n\tat py4j.Gateway.invoke(Gateway.java:282)\n\tat py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)\n\tat py4j.commands.CallCommand.execute(CallCommand.java:79)\n\tat py4j.ClientServerConnection.waitForCommands(ClientServerConnection.java:182)\n\tat py4j.ClientServerConnection.run(ClientServerConnection.java:106)\n\tat java.base/java.lang.Thread.run(Thread.java:1589)\n",
  "req_id": "r-28ca7c79d7ed452ab001e6e9c9e63fda",
  "user_id": "7d523381374b62e6f2aad1f2f9fb6eddf624d382a8f71db6dcf5788e3aae0af3@egi.eu"
}

I get it for this process graph as a sync request (but not for a batch job):

{
  "process_graph": {
    "load1": {
      "arguments": {
        "id": "SENTINEL2_L2A",
        "spatial_extent": {
          "coordinates": [
            [
              [
                14.269370795119045,
                40.90174945996992
              ],
              [
                14.269370795119045,
                40.90058468322607
              ],
              [
                14.271452545306403,
                40.90058468322607
              ],
              [
                14.271452545306403,
                40.90174945996992
              ],
              [
                14.269370795119045,
                40.90174945996992
              ]
            ]
          ],
          "type": "Polygon"
        }
      },
      "temporal_extent": [
        "2022-04-17T00:00:00Z",
        "2022-04-17T00:00:00Z"
      ]
    },
    "process_id": "load_collection"
  },
  "save2": {
    "arguments": {
      "data": {
        "from_node": "load1"
      },
      "format": "GTIFF"
    },
    "process_id": "save_result",
    "result": true
  }
}