Snappy - Reading Product Error

I have used Snappy for a while now, and read lots of Sentinel 1 products, easily.
But I cannot read Sentinel 2 products, i don’t know why. I use the exact same function.

This is my code:

def read(filename):
print(‘>Reading ‘+filename+’…’)
return ProductIO.readProduct(filename)

I give the filename as argument, and it is correct, i checked.
This is the output:

INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
SEVERE: org.esa.s2tbx.dataio.gdal.activator.GDALDistributionInstaller: The environment variable LD_LIBRARY_PATH is not set. It must contain the current folder '.'.
INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.
>Reading S2B_MSIL2A_20191226T112359_N0213_R037_T29TNE_20191226T122946.zip...
SEVERE: org.esa.snap.core.dataio.ProductIO: Error attempting to read S2B_MSIL2A_20191226T112359_N0213_R037_T29TNE_20191226T122946.zip with plugin reader org.esa.s2tbx.dataio.s2.ortho.plugins.Sentinel2L1CProduct_Multi_UTM29N_ReaderPlugIn@63dda940: null
SEVERE: org.esa.snap.core.dataio.ProductIO: Error attempting to read S2B_MSIL2A_20191226T112359_N0213_R037_T29TNE_20191226T122946.zip with plugin reader org.csa.rstb.io.rcm.RCMProductReaderPlugIn@65844c96: null
SEVERE: org.esa.snap.core.dataio.ProductIO: Error attempting to read S2B_MSIL2A_20191226T112359_N0213_R037_T29TNE_20191226T122946.zip with plugin reader org.esa.s1tbx.io.risat1.Risat1ProductReaderPlugIn@54c11750: null
2 Likes

Did anyone ever follow up with you? Did you figure out your issue?

I just did a fresh Anaconda3 environment install of Python 3.6 and the latest SNAP download. I used the SNAP Python config tool to put files directly into my Python 3.6 environment in the anaconda3/envs/py36/lib/python3.6/site-packages. Everything imports. I can read Sentinel-1 .zip files. But for Sentinel-2 .zip files when I call ProductIO.readProduct() on a valid SNAP-desktop-loadable file I get:

SEVERE: org.esa.snap.core.dataio.ProductIO: Error attempting to read S2A_MSIL2A_20210613T161901_N0300_R040_T17TLG_20210613T204439.zip with plugin reader org.esa.s2tbx.dataio.s2.ortho.plugins.Sentinel2L1CProduct_Multi_UTM17N_ReaderPlugIn@2d64c100
java.lang.NullPointerException
at java.nio.file.Files.provider(Files.java:97)
at java.nio.file.Files.readAttributes(Files.java:1737)
at java.nio.file.Files.isRegularFile(Files.java:2229)
at org.esa.s2tbx.dataio.VirtualDirEx.build(VirtualDirEx.java:88)
at org.esa.s2tbx.dataio.s2.ortho.S2OrthoProductReaderPlugIn.getDecodeQualification(S2OrthoProductReaderPlugIn.java:126)
at org.esa.snap.core.dataio.ProductIO.getProductReaderForInput(ProductIO.java:301)
at org.esa.snap.core.dataio.ProductIO.readProductImpl(ProductIO.java:252)
at org.esa.snap.core.dataio.ProductIO.readProduct(ProductIO.java:204)

It feels like a configuration issue, but it is not obvious.