Snap Error Opening Manifest.safe error

Hi. I am trying to load a Sentinel-1 image. When I use the Snap program to open manifest.safe I obtain the following error of Content is not allowed in prolog. Does anyone know how to fix the issue for a Mac Computer. Thanks.

I’m guessing the xml parser has difficulty with the prolog or header of the manifest file or another product xml file. Try opening the files in a text editor and comparing it with the same file from another product that works. Something must be wrong with an xml file.

I had the same problem and just figured it out. If you have opened the folder (and any sub-folders) in OS X Finder, hidden .DS_Store files have been created. If you delete these hidden files, you will be able to open manifest.safe with Snap again.

Thanks. That’s strange. I’ll give it a try with the .DS_Store files to see if somehow the reader is getting into trouble.

I also encountered this problem. But I could not find the hidden file .DS_Store on my MAC computer. So how to fix that?

I got into the same problem on my MAC (High Sierra) and deleting the .DS_Store did not help. But I noticed that if I rename the manifest.safe file to manifest.xml everything works well. So the quick fix I am using is copying the file programmatically from manifest.safe to manifest.xml before trying to open it and this works well:

shutil.copyfile(pathdir + “manifest.safe”, pathdir + “manifest.xml”)
product = snappy.ProductIO.readProduct(pathdir + “manifest.xml”)

In fact this did not solve the problem. The error message does not appear anymore but no product is generated, i.e. the “product” variable in the above code results in None.

Could anyone solve this?

More generally, what argument does readProduct() accepts to read a S1 data product? Is there an alternative way, other than providing the path of the manifest.safe file? I tried providing the .tiff file directly, which does create a product but further processing with operators (e.g. Calibration) does not seem to work.

Hi there,
I had the same error.
For me, loading the zip file (instead of the manifest.safe) did the trick, via File. → Open product.

Hi @Ludoohh,
Please provide more details: SNAP version, OS version. Does this problem occur with all Sentinel-1 products or only with a specific one?

hi @diana_harosa, I was merely offering a possible solution.
I think it’s pretty much the same with all Sentinel-1 SAFE products.
I’m on macOS too, so that may be related, I don’t know.
All I know is, I don’t unzip the file, but I load the zip file in SNAP instead.