GPT Resampling Error "dataType out of range" with S2 MSIL1C data (since PB400?)

Hello all,

my script to resample S2 MSIL1C data with GPT recently fails with:
Error: dataType out of range!

Older data and also resampling the same data with SNAP (8.0.9) is working just fine.
I wonder if this is an issue with the latest Processing Baseline 04.00? I saw this post (S2 error in resampling) describing a different problem with PB400.

It shouldnt be a memory issue, but I cant figure out what else it might be.
The resampled products are created, but it breaks with the error halfway. Any idea?
thanks
Daniel

…10%…90% done.
org.esa.snap.core.gpf.OperatorException: dataType out of range!
at org.esa.snap.core.gpf.graph.GraphProcessor$GPFImagingListener.errorOccurred(GraphProcessor.java:379)
at com.sun.media.jai.util.SunTileScheduler.sendExceptionToListener(Unknown Source)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
at javax.media.jai.OpImage.getTile(Unknown Source)
at com.sun.media.jai.opimage.TranslateIntOpImage.getTile(Unknown Source)
at javax.media.jai.PlanarImage.getData(Unknown Source)
at javax.media.jai.PlanarImage.getExtendedData(Unknown Source)
at com.sun.media.jai.opimage.MosaicOpImage.computeTile(Unknown Source)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
at javax.media.jai.OpImage.getTile(Unknown Source)
at javax.media.jai.PlanarImage.getData(Unknown Source)
at javax.media.jai.PlanarImage.getExtendedData(Unknown Source)
at javax.media.jai.ScaleOpImage.computeTile(Unknown Source)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
at javax.media.jai.OpImage.getTile(Unknown Source)
at com.sun.media.jai.opimage.CropOpImage.getTile(Unknown Source)
at javax.media.jai.PlanarImage.cobbleByte(Unknown Source)
at javax.media.jai.PlanarImage.getData(Unknown Source)
at javax.media.jai.RenderedOp.getData(Unknown Source)
at com.bc.ceres.glevel.MultiLevelImage.getData(MultiLevelImage.java:64)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:449)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:435)
at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImage.java:75)
at javax.media.jai.SourcelessOpImage.computeTile(Unknown Source)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
at javax.media.jai.OpImage.getTile(Unknown Source)
at com.sun.media.jai.util.RequestJob.compute(Unknown Source)
at com.sun.media.jai.util.WorkerThread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: dataType out of range!
at it.geosolutions.imageio.plugins.tiff.TIFFTag.getSizeOfType(TIFFTag.java:326)
at it.geosolutions.imageioimpl.plugins.tiff.TIFFIFD.initialize(TIFFIFD.java:285)
at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageMetadata.initializeFromStream(TIFFImageMetadata.java:148)
at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.readMetadata(TIFFImageReader.java:911)
at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.seekToImage(TIFFImageReader.java:864)
at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.seekToImage(TIFFImageReader.java:822)
at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.getWidth(TIFFImageReader.java:1080)
at org.esa.snap.jp2.reader.internal.JP2TileOpImage$ImageReader.getImageWidth(JP2TileOpImage.java:303)
at org.esa.snap.jp2.reader.internal.JP2TileOpImage.computeRectIndirect(JP2TileOpImage.java:148)
at org.esa.snap.jp2.reader.internal.JP2TileOpImage.computeRect(JP2TileOpImage.java:113)
at javax.media.jai.SourcelessOpImage.computeTile(Unknown Source)
… 26 more

Error: dataType out of range!

Hi Daniel,

I’ve also no idea what the error is but I do have suggestions to work around it. Maybe you can try them.

  1. Maybe you are running at the memory limit. Please try increasing the Xmx value.
    SNAP FAQs - Memory Issues
  2. Instead of using the intermediate step to convert Jp2 to Tiff files. you could switch to the direct reading. To do this you need to set the property use.openjp2.jna
    This can be done by adding -J-Duse.openjp2.jna=true at the beginngin of your gpt call.
    Alternatively. you can add this to s2tbx.properties file contained in <user_dir>/.snap/etc.
    If it does not exist yet. Create it and add the line use.openjp2.jna=true
  3. Last idea: It could be related to the ECMWF data.
    If you remove (or rename it) the file “AUX_ECMWFT” from the granule dir it might work too.
S2B_MSIL1C_20210517T103619_N7990_R008_T30QVE_20210929T075738.SAFE
├───AUX_DATA
├───DATASTRIP
│   └───DS_VGSR_20210929T075738_S20210517T104617
│       └───QI_DATA
├───GRANULE
│   └───L1C_T30QVE_A021913_20210517T104617
│       ├───AUX_DATA < Contained here >
│       ├───IMG_DATA
│       └───QI_DATA

@FlorianD Do you have another idea how to overcome this issue?

Hi Marco,
thanks for your reply. I will try that out. However its very unlikely a memory problem, as it happens the same way on different machines, even on the one with -Xmx138240m.

In my initial post I forgot my gpt call, its:
gpt resample_s2.xml -e -f NETCDF4-BEAM -p resample_10m.properties -t S2B_MSIL1C_20220314T101019_N0400_R022_T33VWF_20220314T122840_resampled.nc S2B_MSIL1C_20220314T101019_N0400_R022_T33VWF_20220314T122840.SAFE
The properties contain only default values, though.

And I also noticed something very strange. The resampling process breaks at some point and leaves an incomplete target file behind. If I now run the same command again I see more progress on the command line output (…10%…20%…) before the error occurs. Doing this 4-5 times in a row I finally get to (…90%…done) and the resampled file is properly written without any error. As if the target file doesnt get replaced, but successively written. Weird. If I have more details I post them here.
thanks

Another addition:
when using my batch script I in fact get different errors with some granules.
I also noticed that it always says (…90% done), but if the sequence of percentages isnt complete, an error occurs.

2nd error (happens with S2B_MSIL1C_20220314T101019_N0400_R022_T34VCM_20220314T122840.SAFE):

....10%....20%....30%...90% done.
org.esa.snap.core.gpf.OperatorException: Failed to read the data for level 0 and rectangle java.awt.Rectangle[x=0,y=0,width=256,height=256].
	at org.esa.snap.core.gpf.graph.GraphProcessor$GPFImagingListener.errorOccurred(GraphProcessor.java:379)
	at com.sun.media.jai.util.SunTileScheduler.sendExceptionToListener(Unknown Source)
	at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
	at javax.media.jai.OpImage.getTile(Unknown Source)
	at com.sun.media.jai.opimage.TranslateIntOpImage.getTile(Unknown Source)
	at javax.media.jai.PlanarImage.getData(Unknown Source)
	at javax.media.jai.PlanarImage.getExtendedData(Unknown Source)
	at com.sun.media.jai.opimage.MosaicOpImage.computeTile(Unknown Source)
	at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
	at javax.media.jai.OpImage.getTile(Unknown Source)
	at javax.media.jai.PlanarImage.getData(Unknown Source)
	at javax.media.jai.PlanarImage.getExtendedData(Unknown Source)
	at javax.media.jai.ScaleOpImage.computeTile(Unknown Source)
	at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
	at javax.media.jai.OpImage.getTile(Unknown Source)
	at com.sun.media.jai.opimage.CropOpImage.getTile(Unknown Source)
	at javax.media.jai.PlanarImage.cobbleByte(Unknown Source)
	at javax.media.jai.PlanarImage.getData(Unknown Source)
	at javax.media.jai.RenderedOp.getData(Unknown Source)
	at com.bc.ceres.glevel.MultiLevelImage.getData(MultiLevelImage.java:64)
	at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:449)
	at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:435)
	at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImage.java:75)
	at javax.media.jai.SourcelessOpImage.computeTile(Unknown Source)
	at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
	at javax.media.jai.OpImage.getTile(Unknown Source)
	at com.sun.media.jai.util.RequestJob.compute(Unknown Source)
	at com.sun.media.jai.util.WorkerThread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Failed to read the data for level 0 and rectangle java.awt.Rectangle[x=0,y=0,width=256,height=256].
	at org.esa.snap.jp2.reader.internal.JP2TileOpImage.computeRect(JP2TileOpImage.java:115)
	at javax.media.jai.SourcelessOpImage.computeTile(Unknown Source)
	... 26 more
Caused by: javax.imageio.IIOException: I/O error reading header!
	at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.readHeader(TIFFImageReader.java:567)
	at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.locateImage(TIFFImageReader.java:705)
	at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.seekToImage(TIFFImageReader.java:835)
	at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.seekToImage(TIFFImageReader.java:822)
	at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.getWidth(TIFFImageReader.java:1080)
	at org.esa.snap.jp2.reader.internal.JP2TileOpImage$ImageReader.getImageWidth(JP2TileOpImage.java:303)
	at org.esa.snap.jp2.reader.internal.JP2TileOpImage.computeRectIndirect(JP2TileOpImage.java:148)
	at org.esa.snap.jp2.reader.internal.JP2TileOpImage.computeRect(JP2TileOpImage.java:113)
	... 27 more
Caused by: java.io.EOFException
	at it.geosolutions.imageio.stream.eraf.EnhancedRandomAccessFile.readUnsignedShort(EnhancedRandomAccessFile.java:978)
	at it.geosolutions.imageio.stream.input.FileImageInputStreamExtImpl.readUnsignedShort(FileImageInputStreamExtImpl.java:130)
	at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.readHeader(TIFFImageReader.java:513)
	... 34 more

3rd error (happens with S2B_MSIL1C_20220314T101019_N0400_R022_T34VEN_20220314T122840.SAFE):

....10%....20%....30%....90% done.
org.esa.snap.core.gpf.OperatorException: -1
	at org.esa.snap.core.gpf.graph.GraphProcessor$GPFImagingListener.errorOccurred(GraphProcessor.java:379)
	at com.sun.media.jai.util.SunTileScheduler.sendExceptionToListener(Unknown Source)
	at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
	at javax.media.jai.OpImage.getTile(Unknown Source)
	at com.sun.media.jai.opimage.TranslateIntOpImage.getTile(Unknown Source)
	at javax.media.jai.PlanarImage.getData(Unknown Source)
	at javax.media.jai.PlanarImage.getExtendedData(Unknown Source)
	at com.sun.media.jai.opimage.MosaicOpImage.computeTile(Unknown Source)
	at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
	at javax.media.jai.OpImage.getTile(Unknown Source)
	at javax.media.jai.PlanarImage.getData(Unknown Source)
	at javax.media.jai.PlanarImage.getExtendedData(Unknown Source)
	at javax.media.jai.ScaleOpImage.computeTile(Unknown Source)
	at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
	at javax.media.jai.OpImage.getTile(Unknown Source)
	at com.sun.media.jai.opimage.CropOpImage.getTile(Unknown Source)
	at javax.media.jai.PlanarImage.cobbleByte(Unknown Source)
	at javax.media.jai.PlanarImage.getData(Unknown Source)
	at javax.media.jai.RenderedOp.getData(Unknown Source)
	at com.bc.ceres.glevel.MultiLevelImage.getData(MultiLevelImage.java:64)
	at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:449)
	at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:435)
	at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImage.java:75)
	at javax.media.jai.SourcelessOpImage.computeTile(Unknown Source)
	at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
	at javax.media.jai.OpImage.getTile(Unknown Source)
	at com.sun.media.jai.util.RequestJob.compute(Unknown Source)
	at com.sun.media.jai.util.WorkerThread.run(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
	at java.util.ArrayList.elementData(ArrayList.java:422)
	at java.util.ArrayList.get(ArrayList.java:435)
	at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.locateImage(TIFFImageReader.java:712)
	at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.seekToImage(TIFFImageReader.java:835)
	at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.seekToImage(TIFFImageReader.java:822)
	at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.getWidth(TIFFImageReader.java:1080)
	at org.esa.snap.jp2.reader.internal.JP2TileOpImage$ImageReader.getImageWidth(JP2TileOpImage.java:303)
	at org.esa.snap.jp2.reader.internal.JP2TileOpImage.computeRectIndirect(JP2TileOpImage.java:148)
	at org.esa.snap.jp2.reader.internal.JP2TileOpImage.computeRect(JP2TileOpImage.java:113)
	at javax.media.jai.SourcelessOpImage.computeTile(Unknown Source)
	... 26 more

Error: -1

Hi Daniel,

I have take a look. I don’t catch theses kind of exceptions at 60m resolution with default parameters and NETCDF4-BEAM output format. I will try with the same product and the same parameters.
Could you share your parameters?
I have created an issue on JIRA: [SIITBX-484] - JIRA

Best,
Florian

I have run into similar problem when I use S2 Resampling Processor to resample Sentinel-2 MSI data to 10m resolution, but at earlier times it had been OK. I wander the update of MSI data format might be the possible casue?

Hi, this seems to be a different problem. The error described in the initial post only occurs during command line processing with gpt, not in the Snap GUI itself.

Hi Florian,
thanks for your reply. I also did a test batch run with a minimized command. I removed both the xml and the properties file and used only command line parameters. Surprisingly, it worked.

I did another quick test processing the same granule with the two different commands.

  1. Minimal call, without .xml and .properties:
    ~/snap/bin/gpt Resample -e -x -f NETCDF4-BEAM -PtargetResolution=10 -t S2A_MSIL1C_20220311T104841_N0400_R051_T31UDU_20220311T130621_resampled.nc -SsourceProduct=S2A_MSIL1C_20220311T104841_N0400_R051_T31UDU_20220311T130621.SAFE
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: GDAL 2.2.3 found on system. JNI driver will be used.
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
INFO: org.esa.s2tbx.dataio.s2.ortho.S2OrthoProductReaderPlugIn: Building product reader - EPSG:32631
WARNING: org.esa.snap.core.metadata.GenericXmlMetadata: Metadata: the path to element [metadata_level] does not exist
WARNING: org.esa.snap.core.metadata.GenericXmlMetadata: Metadata: the path to element [granuleidentifier] does not exist
WARNING: org.esa.snap.core.metadata.GenericXmlMetadata: Metadata: the path to element [bandid] does not exist
INFO: org.hsqldb.persist.Logger: dataFileCache open start
Executing operator...
20%....30%....40%....50%....60%....70%....80%....90%.... done.
INFO: org.esa.snap.core.gpf.common.WriteOp: Start writing product S2A_MSIL1C_20220311T104841_N0400_R051_T31UDU_20220311T130621_resampled to S2A_MSIL1C_20220311T104841_N0400_R051_T31UDU_20220311T130621_resampled.nc
Writing...
....10%....13651 [main] INFO serverStartup - Nc4Iosp: NetCDF-4 C library loaded (jna_path='/home/behrd/.snap/auxdata/netcdf_natives/8.0.9/amd64', libname='netcdf').
13656 [main] INFO serverStartup - NetcdfLoader: set log level: old=0 new=0
13656 [main] INFO serverStartup - Nc4Iosp: set log level: old=0 new=0
20%....30%....40%....50%....60%....70%....80%....90%.... done.
INFO: org.esa.snap.core.gpf.common.WriteOp: End writing product S2A_MSIL1C_20220311T104841_N0400_R051_T31UDU_20220311T130621_resampled to S2A_MSIL1C_20220311T104841_N0400_R051_T31UDU_20220311T130621_resampled.nc
INFO: org.esa.snap.core.gpf.common.WriteOp: Time: 827.771 s total, 75.389 ms per line, 0.006866 ms per pixel

So, this runs without problems.

  1. Original call with .xml and .properties files:
    ~/snap/bin/gpt resample_s2.xml -e -x -f NETCDF4-BEAM -p resample_10m.properties -t S2A_MSIL1C_20220311T104841_N0400_R051_T31UDU_20220311T130621_resampled.nc S2A_MSIL1C_20220311T104841_N0400_R051_T31UDU_20220311T130621.SAFE
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: GDAL 2.2.3 found on system. JNI driver will be used.
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.
Executing processing graph
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
INFO: org.esa.s2tbx.dataio.s2.ortho.S2OrthoProductReaderPlugIn: Building product reader - EPSG:32631
WARNING: org.esa.snap.core.metadata.GenericXmlMetadata: Metadata: the path to element [metadata_level] does not exist
WARNING: org.esa.snap.core.metadata.GenericXmlMetadata: Metadata: the path to element [granuleidentifier] does not exist
WARNING: org.esa.snap.core.metadata.GenericXmlMetadata: Metadata: the path to element [bandid] does not exist
INFO: org.hsqldb.persist.Logger: dataFileCache open start
7425 [main] INFO serverStartup - Nc4Iosp: NetCDF-4 C library loaded (jna_path='/home/behrd/.snap/auxdata/netcdf_natives/8.0.9/amd64', libname='netcdf').
7429 [main] INFO serverStartup - NetcdfLoader: set log level: old=0 new=0
7429 [main] INFO serverStartup - Nc4Iosp: set log level: old=0 new=0
....10%.90% done.
org.esa.snap.core.gpf.OperatorException: Failed to read the data for level 0 and rectangle java.awt.Rectangle[x=0,y=0,width=256,height=256].
	at org.esa.snap.core.gpf.graph.GraphProcessor$GPFImagingListener.errorOccurred(GraphProcessor.java:379)
	at com.sun.media.jai.util.SunTileScheduler.sendExceptionToListener(Unknown Source)
	at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
	at javax.media.jai.OpImage.getTile(Unknown Source)
	at com.sun.media.jai.opimage.TranslateIntOpImage.getTile(Unknown Source)
	at javax.media.jai.PlanarImage.getData(Unknown Source)
	at javax.media.jai.PlanarImage.getExtendedData(Unknown Source)
	at com.sun.media.jai.opimage.MosaicOpImage.computeTile(Unknown Source)
	at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
	at javax.media.jai.OpImage.getTile(Unknown Source)
	at javax.media.jai.PlanarImage.getData(Unknown Source)
	at javax.media.jai.PlanarImage.getExtendedData(Unknown Source)
	at javax.media.jai.ScaleOpImage.computeTile(Unknown Source)
	at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
	at javax.media.jai.OpImage.getTile(Unknown Source)
	at com.sun.media.jai.opimage.CropOpImage.getTile(Unknown Source)
	at javax.media.jai.PlanarImage.cobbleByte(Unknown Source)
	at javax.media.jai.PlanarImage.getData(Unknown Source)
	at javax.media.jai.RenderedOp.getData(Unknown Source)
	at com.bc.ceres.glevel.MultiLevelImage.getData(MultiLevelImage.java:64)
	at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:449)
	at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:435)
	at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImage.java:75)
	at javax.media.jai.SourcelessOpImage.computeTile(Unknown Source)
	at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
	at javax.media.jai.OpImage.getTile(Unknown Source)
	at com.sun.media.jai.util.RequestJob.compute(Unknown Source)
	at com.sun.media.jai.util.WorkerThread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Failed to read the data for level 0 and rectangle java.awt.Rectangle[x=0,y=0,width=256,height=256].
	at org.esa.snap.jp2.reader.internal.JP2TileOpImage.computeRect(JP2TileOpImage.java:115)
	at javax.media.jai.SourcelessOpImage.computeTile(Unknown Source)
	... 26 more
Caused by: javax.imageio.IIOException: I/O error reading header!
	at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.readHeader(TIFFImageReader.java:567)
	at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.locateImage(TIFFImageReader.java:705)
	at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.seekToImage(TIFFImageReader.java:835)
	at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.seekToImage(TIFFImageReader.java:822)
	at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.getWidth(TIFFImageReader.java:1080)
	at org.esa.snap.jp2.reader.internal.JP2TileOpImage$ImageReader.getImageWidth(JP2TileOpImage.java:303)
	at org.esa.snap.jp2.reader.internal.JP2TileOpImage.computeRectIndirect(JP2TileOpImage.java:148)
	at org.esa.snap.jp2.reader.internal.JP2TileOpImage.computeRect(JP2TileOpImage.java:113)
	... 27 more
Caused by: java.io.EOFException
	at it.geosolutions.imageio.stream.eraf.EnhancedRandomAccessFile.readUnsignedShort(EnhancedRandomAccessFile.java:978)
	at it.geosolutions.imageio.stream.input.FileImageInputStreamExtImpl.readUnsignedShort(FileImageInputStreamExtImpl.java:130)
	at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.readHeader(TIFFImageReader.java:513)
	... 34 more

Error: Failed to read the data for level 0 and rectangle java.awt.Rectangle[x=0,y=0,width=256,height=256].

resample_s2.xml file:

<graph id="Resample_Sentinel-2">
  <version>1.0</version>
  <node id="resample-s2">
    <operator>Resample</operator>
      <sources>
        <sourceProduct>${sourceProduct}</sourceProduct>
      </sources>
      <parameters>
        <targetResolution>${resolution}</targetResolution>
        <upsampling>${up}</upsampling>
        <downsampling>${down}</downsampling>
        <flagDownsampling>${flag}</flagDownsampling>
        <resampleOnPyramidLevels>true</resampleOnPyramidLevels>
      </parameters>  
   </node>
</graph>

resample_10m.properties file:

resolution=10
down=First
up=Nearest
flag=First

For my understanding the two commands should do just the same processing, but the command line output looks different.
I actually didnt notice that these values are all defaults except for the resolution and the parameters can also be put directly on the command line. It seems there is a problem when reading the combination of these files, maybe you can find out what happens. However, for my purpose its easier to provide the command line parameters. gpt processes just fine this way.
If I can help tracking down the error, let me know.
Best,
Daniel

One more observation running the minimized command in a batch. Randomly some files are not processed properly, but run into another error:

INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: GDAL 2.2.3 found on system. JNI driver will be used.
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
INFO: org.esa.s2tbx.dataio.s2.ortho.S2OrthoProductReaderPlugIn: Building product reader - EPSG:32634
WARNING: org.esa.snap.core.metadata.GenericXmlMetadata: Metadata: the path to element [metadata_level] does not exist
WARNING: org.esa.snap.core.metadata.GenericXmlMetadata: Metadata: the path to element [granuleidentifier] does not exist
WARNING: org.esa.snap.core.metadata.GenericXmlMetadata: Metadata: the path to element [bandid] does not exist
INFO: org.hsqldb.persist.Logger: dataFileCache open start
Executing operator...
20%....30%....40%....50%....60%....70%....80%....90%.... done.
INFO: org.esa.snap.core.gpf.common.WriteOp: Start writing product S2B_MSIL1C_20220301T100029_N0400_R122_T34VDL_20220301T121139_resampled to S2B_MSIL1C_20220301T100029_N0400_R122_T34VDL_20220301T121139_resampled.nc
Writing...
....10%....14036 [main] INFO serverStartup - Nc4Iosp: NetCDF-4 C library loaded (jna_path='/home/behrd/.snap/auxdata/netcdf_natives/8.0.9/amd64', libname='netcdf').
14040 [main] INFO serverStartup - NetcdfLoader: set log level: old=0 new=0
14040 [main] INFO serverStartup - Nc4Iosp: set log level: old=0 new=0
20%....30%....40%....50%Exception in thread "SunTileScheduler0Standard6" java.lang.NullPointerException
	at com.sun.media.jai.util.SunCachedTile.<init>(Unknown Source)
	at com.sun.media.jai.util.SunTileCache.add(Unknown Source)
	at javax.media.jai.OpImage.addTileToCache(Unknown Source)
	at javax.media.jai.OpImage.getTile(Unknown Source)
	at org.esa.snap.core.gpf.internal.OperatorExecutor$OperatorTileComputationListenerStack.tileComputed(OperatorExecutor.java:315)
	at com.sun.media.jai.util.RequestJob.compute(Unknown Source)
	at com.sun.media.jai.util.WorkerThread.run(Unknown Source)
99% done.
org.esa.snap.core.gpf.OperatorException
	at org.esa.snap.core.gpf.internal.OperatorExecutor$GPFImagingListener.errorOccurred(OperatorExecutor.java:381)
	at com.sun.media.jai.util.SunTileScheduler.sendExceptionToListener(Unknown Source)
	at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
	at javax.media.jai.OpImage.getTile(Unknown Source)
	at com.sun.media.jai.opimage.TranslateIntOpImage.getTile(Unknown Source)
	at javax.media.jai.PlanarImage.getData(Unknown Source)
	at javax.media.jai.PlanarImage.getExtendedData(Unknown Source)
	at com.sun.media.jai.opimage.MosaicOpImage.computeTile(Unknown Source)
	at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
	at javax.media.jai.OpImage.getTile(Unknown Source)
	at javax.media.jai.PlanarImage.getData(Unknown Source)
	at javax.media.jai.RenderedOp.getData(Unknown Source)
	at org.esa.snap.core.image.VirtualBandOpImage.addDataToReferredRasterDataSymbols(VirtualBandOpImage.java:307)
	at org.esa.snap.core.image.VirtualBandOpImage.computeTile(VirtualBandOpImage.java:235)
	at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
	at javax.media.jai.OpImage.getTile(Unknown Source)
	at javax.media.jai.PlanarImage.getData(Unknown Source)
	at com.bc.ceres.glevel.MultiLevelImage.getData(MultiLevelImage.java:64)
	at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:449)
	at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:435)
	at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImage.java:75)
	at javax.media.jai.SourcelessOpImage.computeTile(Unknown Source)
	at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
	at javax.media.jai.OpImage.getTile(Unknown Source)
	at org.esa.snap.core.gpf.internal.OperatorExecutor$OperatorTileComputationListenerStack.tileComputed(OperatorExecutor.java:315)
	at com.sun.media.jai.util.RequestJob.compute(Unknown Source)
	at com.sun.media.jai.util.WorkerThread.run(Unknown Source)
Caused by: java.nio.BufferUnderflowException
	at java.nio.Buffer.nextGetIndex(Buffer.java:506)
	at java.nio.DirectByteBuffer.getInt(DirectByteBuffer.java:681)
	at org.esa.snap.lib.openjpeg.dataio.RasterUtils.readAsByteArray(RasterUtils.java:70)
	at org.esa.snap.lib.openjpeg.dataio.OpenJP2Decoder.decompress(OpenJP2Decoder.java:307)
	at org.esa.snap.lib.openjpeg.dataio.OpenJP2Decoder.read(OpenJP2Decoder.java:132)
	at org.esa.snap.jp2.reader.internal.JP2TileOpImage.computeRectDirect(JP2TileOpImage.java:133)
	at org.esa.snap.jp2.reader.internal.JP2TileOpImage.computeRect(JP2TileOpImage.java:110)
	at javax.media.jai.SourcelessOpImage.computeTile(Unknown Source)
	... 25 more

Error: org.esa.snap.core.gpf.OperatorException

The good thing is that there is no corrupted file left behind after failing (unlike running gpt with .xml and .properties files). So I can simply run the batch again and the missing files get processed.
I’m not a java expert, but until now I never heard of a BufferUnderflowException…