Sen2cor run error

hi,
I run sen2cor and received this error.

L1C user product directory must match the following mask:
S2A_?????????L1C*
but is:

Please help me to solve this problem

what is the name of your data set?

thanks ABraun,
The error was caused by the S2 image folder name.
folder name was (2016-7-3) when I’ve changed it to 2016_7_3 sen2cor was run .
output of sen2cor 10, 20 and 60m open in snap but failed to open image view???
(failed to open image view) Why this error occurs?


1 Like

The problem is due to longer path, You need to keep you file in C drive or make its path shorter.

1 Like

Yes,
thanks a lot Nabin

1 Like

Hello, I have similar problem, when I run Sen2Cor through cmd I get this:

C:\Users\Veselá Kopa.snap\auxdata\Sen2Cor-02.05.05-win64>L2A_Process.bat --resolution 60 “C:\S2A_MSIL1C”
L1C user product directory must match the following mask: S2?_MSIL1C*.SAFE
but is: S2A_MSIL1C

I tried to change folder and even file name, but with no result. If I run it in SNAP, it gives me hust one band, instead of daset.
Please can you help to solve this? I need AOT and WV maps. Something like "gaso6666 got in this thread SEN2COR L2A_Process doesnt start?!

you should leave the folder name as it is when you extract the data, so the full path name, including .SAFE is required.

But I have downloaded folder with tile containing 16 granules. Name of the main folder is S2A_OPER_PRD_MSIL1C_PDMC_20160901T172819_R079_V20160831T095032_20160831T095217.SAFE

The granules in the main folder are:

I want to run Sen2Cor just for one granule, so I tried to put “.SAFE” at the end of the folder and get this message
C:\Users\Veselá Kopa.snap\auxdata\Sen2Cor-02.05.05-win64>L2A_Process.bat --resolution 60 “C:\sent\S2A_MSIL1C_TL_MPS__20160831T133451_A006225_T33UYQ_N02.04.SAFE”
Product metadata file cannot be read.

Then I tried something else. I left hust one granule in main folder (remove others) but get same result.
Please, dou you have any advice?

this might help you then.

I addressed to individual tile and et this:

C:\Users\Veselá Kopa.snap\auxdata\Sen2Cor-02.05.05-win64>L2A_Process.bat --resolution 60 “C:\sent\S2A_OPER_PRD_MSIL1C_PDMC_20160901T172819_R079_V20160831T095032_20160831T095217.SAFE\GRANULE\S2A_OPER_MSI_L1C_TL_MPS__20160831T
133451_A006225_T33UYQ_N02.04”
Operation mode PDGS is not supported for Product version 13.1.
Operation mode will be reset to TOOLBOX.

Sentinel-2 Level 2A Processor (Sen2Cor). Version: 2.5.5, created: 2018.03.19, supporting Level-1C product version <= 14.5 started …
Product version: 13.1. Operation mode: TOOLBOX. Processing baseline: 02.04.
Selected resolution: 60 m.
Process L2A_ProcessTile-1:
Traceback (most recent call last):
File “C:\Users\Veselß Kopa.snap\auxdata\Sen2Cor-02.05.05-win64\lib\multiprocessing\process.py”, line 258, in _bootstrap
self.run()
File “C:\Users\Veselß Kopa.snap\auxdata\Sen2Cor-02.05.05-win64\Lib\site-packages\sen2cor\L2A_ProcessTile.py”, line 130, in run
if not self.process_60():
File “C:\Users\Veselß Kopa.snap\auxdata\Sen2Cor-02.05.05-win64\Lib\site-packages\sen2cor\L2A_ProcessTile.py”, line 147, in process_60
self.tables = L2A_Tables(self.config)
File “C:\Users\Veselß Kopa.snap\auxdata\Sen2Cor-02.05.05-win64\Lib\site-packages\sen2cor\L2A_Tables.py”, line 113, in init
configFn = u’\’.join([u’\\\\?’, config.configFn])
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe1 in position 14: ordinal not in range(128)

maybe the special characters in your path make problems (ß, á, spacebar)

“á” is part of name of my account. So, can I put folder Sen2Cor-02.05.05-win64 straight on C disk? It doesn’t have to be in path "C:\Users(account name).snap\auxdata\ ?

I’m not sure it it will still work then because there are always some dependencies but you can make a copy and directly call sen2cor from there.

I run se2cor from another folder, but with same result:

C:\sent\Sen2Cor-02.05.05-win64>L2A_Process.bat --resolution 60 C:\sent\S2A_OPER_PRD_MSIL1C_PDMC_20160901T172819_R079_V20160831T095032_20160831T095217.SAFE\GRANULE\S2A_OPER_MSI_L1C_TL_MPS__20160831T133451_A006225_T33UYQ_N02.04

Operation mode PDGS is not supported for Product version 13.1.
Operation mode will be reset to TOOLBOX.

Sentinel-2 Level 2A Processor (Sen2Cor). Version: 2.5.5, created: 2018.03.19, supporting Level-1C product version <= 14.5 started …
Product version: 13.1. Operation mode: TOOLBOX. Processing baseline: 02.04.
Selected resolution: 60 m.
Process L2A_ProcessTile-1:
Traceback (most recent call last):
File “C:\sent\Sen2Cor-02.05.05-win64\lib\multiprocessing\process.py”, line 258, in _bootstrap
self.run()
File “C:\sent\Sen2Cor-02.05.05-win64\Lib\site-packages\sen2cor\L2A_ProcessTile.py”, line 130, in run
if not self.process_60():
File “C:\sent\Sen2Cor-02.05.05-win64\Lib\site-packages\sen2cor\L2A_ProcessTile.py”, line 147, in process_60
self.tables = L2A_Tables(self.config)
File “C:\sent\Sen2Cor-02.05.05-win64\Lib\site-packages\sen2cor\L2A_Tables.py”, line 113, in init
configFn = u’\’.join([u’\\\\?’, config.configFn])
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe1 in position 14: ordinal not in range(128)

and if you only call the top folder?

C:\sent\Sen2Cor-02.05.05-win64>L2A_Process.bat --resolution 60 C:\sent\S2A_OPER_PRD_MSIL1C_PDMC_20160901T172819_R079_V20160831T095032_20160831T095217.SAFE\

Still the same, but program tried to process all 16 tiles in the folder with same error: UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe1 in position 14: ordinal not in range(128)

But I have another L1C product “S2A_MSIL1C_20180406T100031_N0206_R122_T33UXQ_20180406T110023.SAFE” and sen2cor have processed all of it. So I think the problem must be in the name of the product. I downloaded it from Open Access Hub, co I don’t know what to do now.

you should also be able to only download the single tile you need instead of the full 8GB full product.
Here you can specifically search for S2 tiles: https://peps.cnes.fr/rocket/#/search (registration is required, but free)

I run Sen2cor 2.5.5 for resolution 10m and got error:
Operation mode PDGS is not supported for Product version 13.1.
Operation mode will be reset to TOOLBOX.
Sentinel-2 Level 2A Processor (Sen2Cor). Version: 2.5.5, created: 2018.03.19, supporting Level-1C product version <= 14.5 started …
Product version: 13.1. Operation mode: TOOLBOX. Processing baseline: 02.04.
Selected resolution: 10 m.
Progress[%]: 0.06 : PID-97716, No scene classification processing for 10 m resolution in sc_only mode, elapsed time[s]: 1.372, total: 0:22:29.343000
Syntax error in metadata, see report file for details.
[ERROR] L2A_XmlParse: 120 Schema file: S2-PDGS-TAS-DI-PSD-V13.1_Schema\S2_PDI_Level-2A_Datastrip_Metadata.xsd
[ERROR] L2A_XmlParse: 120 Schema file: S2-PDGS-TAS-DI-PSD-V13.1_Schema\S2_PDI_Level-2A_Datastrip_Metadata.xsd
[ERROR] L2A_XmlParse: 121 Details: Element ‘Tile_List’: Missing child element(s). Expected is ( Tile ).
[ERROR] L2A_XmlParse: 121 Details: Element ‘Tile_List’: Missing child element(s). Expected is ( Tile ).
Parsing error:
Schema file: S2-PDGS-TAS-DI-PSD-V13.1_Schema\S2_PDI_Level-2A_Datastrip_Metadata.xsd
Details: Element ‘Tile_List’: Missing child element(s). Expected is ( Tile ).
Progress[%]: 100.00 : Application terminated with at least one error.
Finished tool execution in 10 seconds

Could you kindly let me How to fix it?

I had the same problems as all of you.
1-The filenames are stupidly long, and there are too many subfolders with long names. The result: OneDrive refuses to upload files with too long paths, even if Windows accepts them. If you change anything in the filenames, SNAP and Sen2Cor won’t work, because their code is written according to these specific file names.
Solution 1: Let’s suppose you downloaded L1C_T17SNT_A014251_20180315T160647.zip and want to unzip it in your own folder “C:…\mar 15 2018”. When you unzip it, all the data are placed in C:…\mar 15 2018\L1C_T17SNT_A014251_20180315T160647.
But all the software needs is the path to the xml file in the .SAFE folder. So put the .SAFE folder and its components directly in “C:…\mar 15 2018”. It will shorten a little the paths.
Solution 2: after you have finished your work with SNAP and Sen2Cor, if you want to use your final data in some other program, e.g. QGIS, SAGA etc. to make maps, copy the .jp2 image files and paste them in a folder of your own with a shorter path, for example in the root of C:…\mar 15 2018, and by the way, OneDrive will upload them into the cloud. Paste, don’t move the files, in case you need to work again with SNAP/Sen2Cor in the future.

2-Now the problems with Toolbox, PDGS etc and all the fatal error messages. SNAP and Sen2Cor are very messy and if you mess with them, it’s over. I don’t how exactly how Sen2Cor works. The folder C:$SEN2COR_BIN is apparently all what’s needed for command-line operation, at the condition you first created manually the folder C:\users\yourusername\Documents\sen2cor (which nobody tells you) and the environment variable (=path) associated with it (nobody clearly told you either).
When you use Sen2Cor through SNAP (which I do, because I never succeeded with the command line), you could think that the presence of the folder Sen2Cor-02.05.05-win64 within C:\Users\yourusername.snap\auxdata is enough. No: SNAP-Sen2Cor uses also C:$SEN2COR_BIN (the proof: C:$SEN2COR_BIN changes from 458MB with 6,685 files to 470MB with 7,230 files the first time you use the program) and the folder C:\users\yourusername\Documents\sen2cor and the environment variable associated with it, as above. Although the provided GIBB files, e.g. L2A_GIPP.xml, are in both locations (of course), it seems you have to run Sen2Cor with the path C:$SEN2COR_BIN\aux_data\Sen2Cor-02.05.05-win64\Lib\site-packages\sen2cor\cfg\L2A_GIPP.xml, even from SNAP.
Finally, as I said, when you have messed with messy Sen2Cor (for example switched from PDGS to Toolbox and vice-versa), Sen2Cor says anything but error messages.
The only solution I found after days of trial and error on 2 computers (Win 8.1 and Win 10): remove everything and start all over again from scratch. Myself I decided to stick with Sen2Cor integrated in SNAP, since it worked at the beginning, and not to fool around with PDGS (the default mode) and Toolbox.
I am open to the solutions and suggestions from everyone, because I’m still frustrated not to be able to use the command line.
Good luck everyone

I had this problem:
Sentinel-2 Level 2A Processor (Sen2Cor), 2.4.0, created: 2017.06.05 started …
no resolution specified, will process all resolutions.
Process L2A_ProcessTile-1:
Traceback (most recent call last):
File “C:\Users\deborah.mendes.snap\auxdata\Sen2Cor-2.4.0-win64\lib\multiprocessing\process.py”, line 258, in _bootstrap
self.run()
File “C:\Users\deborah.mendes.snap\auxdata\Sen2Cor-2.4.0-win64\Lib\site-packages\sen2cor\L2A_ProcessTile.py”, line 121, in run
if self.process_60() == False:
File “C:\Users\deborah.mendes.snap\auxdata\Sen2Cor-2.4.0-win64\Lib\site-packages\sen2cor\L2A_ProcessTile.py”, line 146, in process_60
self.tables = L2A_Tables(self.config)
File “C:\Users\deborah.mendes.snap\auxdata\Sen2Cor-2.4.0-win64\Lib\site-packages\sen2cor\L2A_Tables.py”, line 324, in init
if not ‘USER’ in tiOld.text:
AttributeError: ‘bool’ object has no attribute ‘text’