Cant open Sentinel 2 in SNAP 9.0.0

Actually am experiencing problem " no appropriate product reader found" using SNAP 9.0.0 while opening Sentinel 2 level 2A image for preprocessing. How can i solve this? “I have tried opening the file MTD_MSIL.xml” in vain. I have still gone to file-import-Optical sensors but no option for Sentinel 2. I have tried unzipping the folder win 7zip after reading some solutions given to a person who had similar problem but still cant open.
I have tried to clean the cache using the steps Tools > Options > S2TBX > Sentinel-2 Cache but S2TBX isn’t available in 9.0.0 SNAP. i have explored options in vain. kindly guide. thank you

Hello @jimmy,

Do you have this message with any S2 L2A product or a specific one?
Can you check if “Sentinel-2 Toolbox Kit Module” is the list of installed plugins (Tools → Plugins → “Installed” tab)?

If it is not, it can be installed from the “Available Plugins” tab:

I am having the same problems now in Mac. I delete the .snap/auxdata/gdal but the problem persists. I cannot open .xml or zip files. This problem was not such less than one month ago.

java.lang.UnsatisfiedLinkError: org.gdal.gdalconst.gdalconstJNI.GDT_Unknown_get()I
at org.gdal.gdalconst.gdalconstJNI.GDT_Unknown_get(Native Method)
at org.gdal.gdalconst.gdalconstConstants.(gdalconstConstants.java:12)
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43)
at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:156)
at java.lang.reflect.Field.acquireFieldAccessor(Field.java:1088)
at java.lang.reflect.Field.getFieldAccessor(Field.java:1069)
at java.lang.reflect.Field.get(Field.java:393)
at org.esa.snap.dataio.gdal.drivers.GDALReflection.fetchGDALLibraryConstant(GDALReflection.java:31)
at org.esa.snap.dataio.gdal.drivers.GDALConst.gaReadonly(GDALConst.java:28)
at org.esa.s2tbx.dataio.s2.ortho.Sentinel2OrthoProductReader.addBands(Sentinel2OrthoProductReader.java:592)
at org.esa.s2tbx.dataio.s2.ortho.Sentinel2OrthoProductReader.readProduct(Sentinel2OrthoProductReader.java:268)
at org.esa.s2tbx.dataio.s2.Sentinel2ProductReader.readProductNodesImpl(Sentinel2ProductReader.java:198)
at org.esa.snap.core.dataio.AbstractProductReader.readProductNodes(AbstractProductReader.java:178)
at org.esa.s2tbx.dataio.s2.ortho.Sentinel2OrthoProductReaderProxy.readProductNodes(Sentinel2OrthoProductReaderProxy.java:90)
at org.esa.snap.core.dataio.ProductIO.readProduct(ProductIO.java:182)
at org.esa.snap.rcp.actions.file.ReadProductOperation.run(ReadProductOperation.java:61)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)

Hello @abruescas,

Which version of MacOS do you have?
Can yo provide a capture with contents of .snap/auxdata/gdal after the error occurs to help us investigating the problem?

Regards
Adrian

Hi, I attach here the screenshots with all the info:


Thank you @abruescas for the reply.

We tried to reproduce your error on our Mac with the same OS version, and we cannot get the error.
Based on our knowledge your error is related to loading the GDAL native library, which occurs when a dependency of GDAL native library not exists on your system or fails to load.

To hep us investigating your problem with loading of GDAL native library we need more information:

  • please provide a capture with the output of the following command: otool -L ~/.snap/auxdata/gdal/gdal-3-2-1/lib/jni/libgdalalljni.dylib
  • please provide a capture with the output of the following command: otool -L ~/.snap/auxdata/gdal/gdal-3-2-1/lib/libgdal.28.dylib

Thank you @abruescas for the reply.

Your output of the requested commands, matches the output on our Mac.

To continue the investigation we need the SNAP log file, which can contain information that will help us to identify your problem. The SNAP log file is messages.log, which is located on ~/.snap/system/var/log.

Please send us the SNAP log file after you reproduce the problem.

Regards
Adrian

How can I do it? Should I run SNAP and produce the error first?
Do I attach the messages.log file here?

messages.log (77.6 KB)

Thank you @abruescas for the SNAP log file.

We successfully identified your problem and now it will be investigated.

We come back soon with the results of investigation and a solution if we found it.

Regards
Adrian

1 Like

We come back with the results of the investigations:

The GDAL native library fail to load because a dependency library (libjpeg.8.dylib) is loaded from your system instead of being loaded from the SNAP internal GDAL distribution bundle. This library has been removed by one of the last system updates and replaced by a newer version (libjpeg.9.dylib).

A JIRA ticket SNAP-3500 has been created to fix this problem and it will be available with the next SNAP update.

Meanwhile, a workaround can be applied to load the dependency library from the SNAP internal GDAL distribution bundle.

To quickly apply this solution on your system please run:

install_name_tool -change "/usr/local/opt/jpeg/lib/libjpeg.8.dylib" "@loader_path/libjpeg.8.dylib" ~/.snap/auxdata/gdal/gdal-3-2-1/lib/libtiff.5.dylib

Regards
Adrian

Sorry to bother you again, but now I have a different error:

java.io.IOException: Cannot open /Users/abruescas/Desktop/GEO_2023/BIOGEOGRAFIA/Salida_campo/S2A_MSIL2A_20230415T104621_N0509_R051_T30TXK_20230415T182858.SAFE/GRANULE/L2A_T30TXK_A040803_20230415T105842/IMG_DATA/R20m/T30TXK_20230415T104621_B01_20m.jp2
at org.esa.s2tbx.dataio.s2.ortho.Sentinel2OrthoProductReader.addBands(Sentinel2OrthoProductReader.java:587)
at org.esa.s2tbx.dataio.s2.ortho.Sentinel2OrthoProductReader.readProduct(Sentinel2OrthoProductReader.java:265)
at org.esa.s2tbx.dataio.s2.Sentinel2ProductReader.readProductNodesImpl(Sentinel2ProductReader.java:199)
at org.esa.snap.core.dataio.AbstractProductReader.readProductNodes(AbstractProductReader.java:178)
at org.esa.s2tbx.dataio.s2.ortho.Sentinel2OrthoProductReaderProxy.readProductNodes(Sentinel2OrthoProductReaderProxy.java:90)
at org.esa.snap.core.dataio.ProductIO.readProduct(ProductIO.java:182)
[catch] at org.esa.snap.rcp.actions.file.ReadProductOperation.run(ReadProductOperation.java:61)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)

Thank you @abruescas for the reply.

This confirm us that the workaround fixed the problem on your side.

We reproduced your new error on our Mac after applying the solution for your previous problem.
The problem was successfully identified and now it will be investigated.

We come back soon with the results of investigation and a solution if we found it.

Regards
Adrian

1 Like

We come back again with the results of the investigations for your new problem:

On SNAP S2TBX minor release 9.0.1, the S2 product reader was updated to read JP2 files using the GDAL library. After this update, the S2 products cannot be open on Mac systems, because the SNAP internal GDAL distribution does not contain the openjpeg driver to open JP2 files.

A JIRA ticket SNAP-3503 has been created to fix this problem and it will be available with the next SNAP update.

Meanwhile, a workaround can be applied to fix your problem.

To quickly apply this solution on your system please run:

curl -o ~/Downloads/gdal-3-2-1.zip https://raw.githubusercontent.com/senbox-org/snap-engine/14a83a887ac85b0b67edb60fcb4fb3c733b937f2/lib-gdal/src/main/resources/auxdata/gdal/MacOSX/x64/gdal-3-2-1.zip && rm -rf ~/.snap/auxdata/gdal/gdal-3-2-1/ && unzip ~/Downloads/gdal-3-2-1.zip -d ~/.snap/auxdata/gdal/gdal-3-2-1 && rm -rf ~/Downloads/gdal-3-2-1.zip

Regards
Adrian

2 Likes

Many thanks!! It works well.

Hi @diana_harosa, am sorry I also have the same challenge despite having the Sentinel-2 Toolbox Kit Module installed. Am running SNAP 9.0.0 installed in Windows 11.
Thank you

Hi @mumina, can you give us more details about the error? Do you have a " no appropriate product reader found" message or a GDAL issue?

Here is the error message

java.io.IOException: Cannot open C:\XXXX\Data\S2A_MSIL1C_20220915T115411_N0400_R023_T30UUG_20220915T170834\S2A_MSIL1C_20220915T115411_N0400_R023_T30UUG_20220915T170834.SAFE\GRANULE\L1C_T30UUG_A037772_20220915T115503\IMG_DATA\T30UUG_20220915T115411_B01.jp2
at org.esa.s2tbx.dataio.s2.ortho.Sentinel2OrthoProductReader.addBands(Sentinel2OrthoProductReader.java:587)
at org.esa.s2tbx.dataio.s2.ortho.Sentinel2OrthoProductReader.readProduct(Sentinel2OrthoProductReader.java:265)
at org.esa.s2tbx.dataio.s2.Sentinel2ProductReader.readProductNodesImpl(Sentinel2ProductReader.java:199)
at org.esa.snap.core.dataio.AbstractProductReader.readProductNodes(AbstractProductReader.java:178)
at org.esa.s2tbx.dataio.s2.ortho.Sentinel2OrthoProductReaderProxy.readProductNodes(Sentinel2OrthoProductReaderProxy.java:90)
at org.esa.snap.core.dataio.ProductIO.readProduct(ProductIO.java:182)
[catch] at org.esa.snap.rcp.actions.file.ReadProductOperation.run(ReadProductOperation.java:61)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)

Thanks @mumina!
Please close SNAP, delete the C:\Users<user>\ .snap\auxdata\gdal folder, restart SNAP and try to open your S2 product again.