Error running sec2cor in Sentinel 2 toolbox

I am trying to use the sen2cor within the toolbox but I keep getting this message,
“It seems there was an error on execution or the defined tool output error pattern was found.Please consult the SNAP log file.”

Which says,
nap]: Executing tool ‘Sen2Cor 2.11.0’ with command line: ‘C:\Users\boxer.snap\auxdata\Sen2Cor-02.11.00-win64\L2A_Process.bat E:\Dropbox\Arras\Sent2\S2_T43UDT_20220918\S2_T43UDT_MSIL1C_20220918\GRANULE\L1C_T43UDT_A028903_20220918T061158 --resolution 10 --datastrip E:\Dropbox\Arras\Sent2\S2_T43UDT_20220918\S2_T43UDT_MSIL1C_20220918\DATASTRIP --tile E:\Dropbox\Arras\Sent2\S2_T43UDT_20220918 --output_dir E:\Dropbox\Arras\Sent2\S2_T43UDT_20220918 --GIP_L2A C:\Users\boxer.snap\auxdata\Sen2Cor-02.11.00-win64\L2A-GIPP211-custom.xml --GIP_L2A_SC C:\Users\boxer.snap\auxdata\Sen2Cor-02.11.00-win64\L2A_CAL_SC_GIPP211-custom.xml --GIP_L2A_AC C:\Users\boxer.snap\auxdata\Sen2Cor-02.11.00-win64\L2A_CAL_AC_GIPP211-custom.xml --GIP_L2A_PB C:\Users\boxer.snap\auxdata\Sen2Cor-02.11.00-win64\L2A-PB-GIPP211-custom.xml’
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]: Traceback (most recent call last):
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]: File “C:\Users\boxer.snap\auxdata\Sen2Cor-02.11.00-win64\Lib\site-packages\sen2cor\L2A_Process.py”, line 734, in
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]: sys.exit(main())
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]: File “C:\Users\boxer.snap\auxdata\Sen2Cor-02.11.00-win64\Lib\site-packages\sen2cor\L2A_Process.py”, line 500, in main
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]: datastrip_generated = os.path.exists(os.path.join(config.output_dir,‘temp’,‘DATASTRIP’))
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]: File “C:\Users\boxer.snap\auxdata\Sen2Cor-02.11.00-win64\lib\ntpath.py”, line 65, in join
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]: result_drive, result_path = splitdrive(path)
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]: File “C:\Users\boxer.snap\auxdata\Sen2Cor-02.11.00-win64\lib\ntpath.py”, line 115, in splitdrive
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]: if len(p) > 1:
SEVERE [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]: TypeError: object of type ‘NoneType’ has no len()
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]: Finished tool execution in 0 seconds
WARNING [org.esa.snap]: Tool may not have produced an output
INFO [org.netbeans.ui.metrics.javahelp]: Showing help ID: sen2cor211
INFO [org.netbeans.core.network.proxy.NbProxySelector]: Timeout when waiting for DNS response. (step.esa.int)
INFO [null]: Last record repeated again.
INFO [null]: Last record repeated again.
INFO [null]: Last record repeated again.
INFO [org.esa.snap.rcp.SnapApp]: Request to stop SNAP Desktop
INFO [org.esa.snap.rcp.SnapApp]: Stopping SNAP Desktop

Anyone has any suggestions on how to fix this?

Cheers Grant

Dear @grantboxer,

We performed some testing with the Sen2Cor 2.11.00 (Windows version) and the following End-User-Product (EUP): S2B_MSIL1C_20220918T060639_N0400_R134_T43UDT_20220918T080618.SAFE

available here: https://zipper.dataspace.copernicus.eu/odata/v1/Products(c904df26-eec9-533a-8522-5d29b77180b6)/$value

using the following command line on a terminal:

C:\Users\Dev\Sen2Cor_testing\Sen2Cor-02.11.00-win64\L2A_Process.bat
C:\Users\Dev\Sen2Cor_testing\Sen2Cor-02.11.00-win64\S2B_MSIL1C_20220918T060639_N0400_R134_T43UDT_20220918T080618.SAFE
–GIP_L2A C:\Users\Dev\Sen2Cor_testing\GIPP\L2A_GIPP.xml

We were able to process the L1C product without error:

Sen2Cor. Version: 02.11.00, created: 2022.10.20, supporting Level-1C product version 14.2 - 14.9 started …
Product version: 14.9
Operation mode: TOOLBOX
Processing baseline: 99.99
Progress[ ]: 0.00 : Generating datastrip metadata
L2A datastrip successfully generated
No resolution specified, will process 20 and 10 m resolution
20 m resolution will be downsampled to 60 m
Progress[]: 0.05 : PID-2860, L2A_ProcessTile: processing with resolution 20 m, elapsed time[s]: 1.343, total: 0:00:05.382000
Progress[]: 0.05 : PID-2860, L2A_ProcessTile: start of pre processing, elapsed time[s]: 0.000, total: 0:00:05.382000
Progress[]: 0.05 : PID-2860, L2A_Tables: start import, elapsed time[s]: 0.065, total: 0:00:05.447000
Progress[]: 0.06 : PID-2860, L2A_Tables: band B01 imported, elapsed time[s]: 0.285, total: 0:00:05.732000

Progress[]: 51.88 : PID-2860, L2A_Tables: band B08 exported, elapsed time[s]: 24.041, total: 0:23:04.430000
Progress[]: 52.06 : PID-2860, L2A_Tables: band DEM exported, elapsed time[s]: 4.726, total: 0:23:09.156000
Progress[]: 52.16 : PID-2860, L2A_Tables: band AOT exported, elapsed time[s]: 2.653, total: 0:23:11.809000
Progress[]: 52.84 : PID-2860, L2A_Tables: band WVP exported, elapsed time[s]: 18.009, total: 0:23:29.818000
Progress[]: 54.65 : PID-2860, L2A_Tables: band TCI exported, elapsed time[s]: 48.134, total: 0:24:17.952000
Progress[]: 54.65 : PID-2860, L2A_Tables: stop export, elapsed time[s]: 0.069, total: 0:24:18.021000
Progress[]: 100.00 : Application terminated successfully.

We were also able to run the Sen2Cor processing within the SNAP’s Sen2Cor window by setting, in the Processing Parmeters Window:

Mode: TOOLBOX
Resolution: ALL
Tile: path to the .SAFE Product: C:\Users\Dev\Sen2Cor_testing\Sen2Cor-02.11.00-win64\S2B_MSIL1C_20220918T060639_N0400_R134_T43UDT_20220918T080618.SAFE
L2A_GIPP file: C:\Users\Dev\Sen2Cor_testing\GIPP\L2A_GIPP.xml

If there is the need to set the working dir, you can create one, something like: C:\Users\Dev\Sen2Cor_testing\Sen2Cor-02.11.00-win64\working dir.

If your L1C product is an End User (.SAFE) Product you may be able to process it with the setting above. You could then specify other custom GIPPs by setting the respective entries.

We thus suggest to:

  • try the command lines above from a terminal.
  • double check the configurations in the SNAP-Toolbox as we can see, in your command lines, some setting with references for example, to -datastrip.
    These are command lines usually operated by the Production Service.

Cheers,
@Sen2cor_dev_team