Sen2Cor freezes sometimes

I use sen2cor in a Unix environment with Docker in order to generate L2 products.

Most of the time everything goes well, but sometimes the process freezes and sen2cor keeps hanging without reporting any error, making my whole process get stuck.

I noticed that when I run a sen2cor process, a second sen2cor process is created which seemingly does most of the job (I wonder why it’s necessary to have this second process).
See below:

root 9272 0.2 0.8 648172 285472 ? Sl 09:44 0:02 /Sen2Cor-02.05.05-Linux64/bin/python2.7 -s /Sen2Cor-02.05.05-Linux64/lib /python2.7/site-packages/sen2cor/L2A_Process.py /app/in/S2B_MSIL1C_20171211T085339_N0206_R107_T35SQD_20171211T114119.SAFE
root 9281 96.5 6.7 2902088 2217724 ? Rl 09:45 14:11 /Sen2Cor-02.05.05-Linux64/bin/python2.7 -s /Sen2Cor-02.05.05-Linux64/lib /python2.7/site-packages/sen2cor/L2A_Process.py /app/in/S2B_MSIL1C_20171211T085339_N0206_R107_T35SQD_20171211T114119.SAFE

I believe the first line corresponds to the process I create when I run sen2cor, and the second line is the other process created by sen2cor. First process ran only 2 seconds before spawning the other process which ran for 14 minutes.

Now, this is a case where second process actually runs. Sometimes, this second line does not appear whereas the first one does and never ends. It seems like this child process is killed somehow and the parent process is not notified and thus keeps waiting indefinitely.

I don’t think it’s a memory issue since I have 32 GB on my machine.

Has anyone ever had this issue?

Hi,

Are you executing sen2cor from SNAP or directly from the console?
What exactly is the command that you run?

Cheers,
Martino

Hi,

I run the command in a script as follows:

/Sen2Cor-02.05.05-Linux64/bin/L2A_Process /path/to/safe/folder/

Thanks

And you installed using SNAP or standalone? Also, could you give me some more information about your system configuration?

Cheers,
Martino

Below are the instructions in my Dockerfile which have to do with SNAP installation, I hope it answers your question

RUN wget http://step.esa.int/downloads/6.0/installers/esa-snap_sentinel_unix_6_0.sh
RUN chmod a+x esa-snap_sentinel_unix_6_0.sh
RUN ./esa-snap_sentinel_unix_6_0.sh -q
RUN ln -s /opt/snap/bin/gpt /usr/bin/gpt
RUN ln -s /opt/snap/bin/pconvert /usr/bin/pconvert

RUN snap --nosplash --nogui --modules --update-all

RUN wget http://step.esa.int/thirdparties/sen2cor/2.5.5/Sen2Cor-02.05.05-Linux64.run
RUN chmod +x Sen2Cor-02.05.05-Linux64.run
RUN ./Sen2Cor-02.05.05-Linux64.run 
RUN ln -s /Sen2Cor-02.05.05-Linux64/bin/L2A_Process /usr/bin/sen2cor

I use a miniconda3 image (continuumio/miniconda3:4.6.14) which is based on Debian.

Thanks

Hi,

I tried to reproduce the problem, and for the moment I was not able, could it be product dependent? Do you experience the same problem with the same products?

Cheers,
M.

Hi,

It might be since I’ve been able to properly reprocess some products, yet others keep failing and I cannot find a way to process them. See these for example:

S2A_MSIL1C_20170316T112101_N0204_R037_T32WNT_20170316T112104
S2A_MSIL1C_20170626T140101_N0205_R067_T21NZE_20170626T140059
S2A_MSIL1C_20160906T082602_N0204_R021_T36SXJ_20160906T083437
S2A_MSIL1C_20160831T113322_N0204_R080_T29UPB_20160831T113319
S2B_MSIL1C_20171229T095359_N0206_R079_T33UWP_20171229T103604
S2A_MSIL1C_20160427T093042_N0201_R136_T35TLM_20160427T093037
S2A_MSIL1C_20160803T084602_N0204_R107_T36TUM_20160803T085152
S2A_MSIL1C_20160730T105032_N0204_R051_T30SWE_20160730T105338
S2A_MSIL1C_20160824T115222_N0204_R123_T28SCB_20160824T115221
S2A_MSIL1C_20160716T125302_N0204_R138_T28WEU_20160716T125305
S2A_MSIL1C_20160730T105032_N0204_R051_T30SXF_20160730T105338

Thanks