Error in function resample_spatial

Hi,

When using resample_spatial to both re-project and resample in the same step the job gives an error.
See the following example:

collections = "SENTINEL2_L2A_SENTINELHUB"
bands = c("B02", "B03", "B04", "B08", "SCL")
period = c("2021-04-01", "2021-06-30")
ext = list(11.12692, 49.74992, 11.15708, 49.76938)
names(ext) = c("west", "south", "east", "north")

# change to login with your credentials
# con = openeo::connect("https://openeo.cloud")
# login(
#     login_type = "oidc"
#     , provider = "egi"
#     , config = list(
#         client_id = "<client_id>"
#         , secret = "<secret>"
#     )
# )

procs = openeo::processes()

cube = procs$load_collection(
    id = collections
    , spatial_extent = ext
    , temporal_extent = period
    , bands = bands
)

# resampling
res_cube = p$resample_spatial(
    cube
    , resolution = 20
    , projection = 3035
    , method = "near"
)

## create process graph
graph = procs$save_result(
    data = res_cube
    , format = "GTiff"
)

## create and start job
job = openeo::create_job(graph)
openeo::start_job(job)
id = job$id

jobs = openeo::list_jobs()
jobs[[id]]$status

openeo::log_job(job = job)

However, dividing resampling and re-projection into two separate processes works fine:

proj_cube = p$resample_spatial(
    cube
    , projection = 3035
    # , method = "near"
)

res_cube = p$resample_spatial(
    proj_cube
    , resolution = 20
    , method = "near"
)

## create process graph
graph = procs$save_result(
    data = res_cube
    , format = "GTiff"
)

## create and start job
job = openeo::create_job(graph)
openeo::start_job(job)
id = job$id
jobs = openeo::list_jobs()

dirout = path.expand("~/Downloads/openEO/resample")
if (!dir.exists(dirout)) dir.create(dirout)

openeo::download_results(
    job = jobs[[id]]$id
    , folder = dirout
)

## create stars object
fls = list.files(dirout, pattern = "^openEO_", full.names = TRUE)
stars = stars::read_stars(fls, along = "time")
stars = stats::setNames(stars, nm = "value")

Unfortunately, analyzing the error does not give us many clues as to what goes wrong. Maybe you have any ideas?

I have run the first example also and can confirm that an error occurs on the back-end side.

Traceback (most recent call last):
  File "batch_job.py", line 293, in main
    run_driver()
  File "batch_job.py", line 279, in run_driver
    api_version=api_version, job_dir=job_dir, dependencies=dependencies, user_id=user_id
  File "/data4/hadoop/yarn/local/usercache/openeo/appcache/application_1638452756802_5074/container_e5003_1638452756802_5074_01_000014/venv/lib64/python3.6/site-packages/openeogeotrellis/utils.py", line 38, in memory_logging_wrapper
    return function(*args, **kwargs)
  File "batch_job.py", line 353, in run_job
    assets_metadata = result.write_assets(str(output_file))
  File "/data4/hadoop/yarn/local/usercache/openeo/appcache/application_1638452756802_5074/container_e5003_1638452756802_5074_01_000014/venv/lib64/python3.6/site-packages/openeo_driver/save_result.py", line 82, in write_assets
    return self.cube.write_assets(filename=directory, format=self.format, format_options=self.options)
  File "/data4/hadoop/yarn/local/usercache/openeo/appcache/application_1638452756802_5074/container_e5003_1638452756802_5074_01_000014/venv/lib64/python3.6/site-packages/openeogeotrellis/geopysparkdatacube.py", line 1235, in write_assets
    gtiff_options)
  File "/usr/hdp/3.1.4.0-315/spark2/python/lib/py4j-0.10.7-src.zip/py4j/java_gateway.py", line 1257, in __call__
    answer, self.gateway_client, self.target_id, self.name)
  File "/usr/hdp/3.1.4.0-315/spark2/python/lib/py4j-0.10.7-src.zip/py4j/protocol.py", line 328, in get_return_value
    format(target_id, ".", name), value)
py4j.protocol.Py4JJavaError: An error occurred while calling z:org.openeo.geotrellis.geotiff.package.saveRDDTemporal.
: java.util.NoSuchElementException: EmptyBounds.get
	at geotrellis.layer.EmptyBounds$.get(KeyBounds.scala:146)
	at geotrellis.layer.EmptyBounds$.get(KeyBounds.scala:128)
	at org.openeo.geotrellis.geotiff.package$.saveRDDTemporal(package.scala:101)
	at org.openeo.geotrellis.geotiff.package.saveRDDTemporal(package.scala)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
	at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
	at py4j.Gateway.invoke(Gateway.java:282)
	at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
	at py4j.commands.CallCommand.execute(CallCommand.java:79)
	at py4j.GatewayConnection.run(GatewayConnection.java:238)
	at java.lang.Thread.run(Thread.java:748)

@jeroen.dries, maybe you can help to translate the error message?

Thanks for reporting, clearly a bug on our side!
Can I assume this is not urgent because you do seem to have a working approach that is easier compared to splitting it in two steps?