Cant open Sentinel 2 in SNAP 9.0.0

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.

Done that but still have the error. Find attached the logfile
messages.log.1 (76.8 KB)

Can you send us a screenshot with the content of C:\Users<user>\ .snap\auxdata\gdal\gdal-3-2-1 folder?


gdal.zip (282.3 KB)

I see that you are using an installed GDAL version.
There are 2 possible solutions:

  1. You can set SNAP to use the internal GDAL distribution using Tools-> Options menu → GDAL Library Loader tab

    image
    Please restart SNAP after changing the GDAL version!

  2. Or, if you want to continue with the installed GDAL, you have to set the value of the PROJ_LIB system variable to : PROJ_LIB=<GDAL_HOME>\projlib

1 Like

Works ok now. Thanks

Hi,

I am new to SNAP and am encountering a similar problem with loading a Sentinel-2 image. I have SNAP 9.0.0 w/ up-to-date updates. I already tried deleting my C:\Users\ .snap\auxdata\gdal\gdal-3-2-1 and set my Options menu → GDAL Library Loader tab to use the internal gdal version.

I am working on a Macnook Pro w/ Monterey OS and Apple M1 chip.

I have attached an image for the error I am getting:

Thanks in advance for your help here!
anshu