Using sen2cor to process a S2 scene and it hangs

My command and the scene name is below. I’ve run this twice, and it stalls at this step both times.

I was able to run it with the default resolution, which generated the 60 m products. Seemingly the 10 m and 20 m products are refusing to complete, and I don’t know why.

I’ll leave it running just in case it takes a really long time, but I did wait for over an hour.

docker-compose run sen2cor \
		L2A_Process /data/example/S2B_MSIL1C_20190331T000239_N0207_R030_T55GDQ_20190331T005814.SAFE \
			--resolution 20
Processing baseline 02.1 is not implemented yet.
Product version 14.5 will be used but errors during processing might occur.

Sentinel-2 Level 2A Processor (Sen2Cor). Version: 2.5.5, created: 2018.03.19, supporting Level-1C product version <= 14.5 started ...
Product version: 14.5. Operation mode: PDGS. Processing baseline: 02.07.
 Selected resolution: 20 m.
Progress[%]: 0.02 : PID-16, L2A_ProcessTile: processing with resolution 20 m, elapsed time[s]: 0.228, total: 1:46:15.937618
Progress[%]: 0.02 : PID-16, L2A_ProcessTile: start of pre processing, elapsed time[s]: 0.000, total: 1:46:15.938029
Progress[%]: 0.04 : PID-16, L2A_Tables: start import, elapsed time[s]: 0.210, total: 1:46:16.147863
Progress[%]: 0.44 : PID-16, L2A_Tables: band B01 imported, elapsed time[s]: 4.887, total: 1:46:21.034618
Progress[%]: 1.48 : PID-16, L2A_Tables: band B02 imported, elapsed time[s]: 12.418, total: 1:46:33.452235
Progress[%]: 2.65 : PID-16, L2A_Tables: band B03 imported, elapsed time[s]: 14.009, total: 1:46:47.461408
Progress[%]: 3.79 : PID-16, L2A_Tables: band B04 imported, elapsed time[s]: 13.674, total: 1:47:01.135307
Progress[%]: 4.09 : PID-16, L2A_Tables: band B05 imported, elapsed time[s]: 3.666, total: 1:47:04.801478
Progress[%]: 4.41 : PID-16, L2A_Tables: band B06 imported, elapsed time[s]: 3.798, total: 1:47:08.599261
Progress[%]: 4.85 : PID-16, L2A_Tables: band B07 imported, elapsed time[s]: 5.364, total: 1:47:13.962898
Progress[%]: 5.22 : PID-16, L2A_Tables: band B8A imported, elapsed time[s]: 4.378, total: 1:47:18.340823
Progress[%]: 5.69 : PID-16, L2A_Tables: band B09 imported, elapsed time[s]: 5.632, total: 1:47:23.972428
Progress[%]: 6.13 : PID-16, L2A_Tables: band B10 imported, elapsed time[s]: 5.291, total: 1:47:29.262965
Progress[%]: 6.46 : PID-16, L2A_Tables: band B11 imported, elapsed time[s]: 3.940, total: 1:47:33.202522
Progress[%]: 6.76 : PID-16, L2A_Tables: band B12 imported, elapsed time[s]: 3.591, total: 1:47:36.793779
Progress[%]: 6.76 : PID-16, L2A_ProcessTile: start of Scene Classification, elapsed time[s]: 0.010, total: 1:47:36.804202
Progress[%]: 6.84 : PID-16, Pre process   , elapsed time[s]: 0.978, total: 1:47:37.782367
Progress[%]: 7.29 : PID-16, L2A_SC init   , elapsed time[s]: 5.386, total: 1:47:43.168405
Progress[%]: 7.41 : PID-16, L2A_CSND_1_1  , elapsed time[s]: 1.480, total: 1:47:44.648847
Progress[%]: 7.54 : PID-16, L2A_CSND_1_2  , elapsed time[s]: 1.597, total: 1:47:46.245520
Progress[%]: 7.57 : PID-16, L2A_CSND_2_0  , elapsed time[s]: 0.322, total: 1:47:46.567126
Progress[%]: 7.71 : PID-16, L2A_CSND_2_1  , elapsed time[s]: 1.681, total: 1:47:48.247879
Progress[%]: 7.81 : PID-16, L2A_CSND_2_1_2, elapsed time[s]: 1.185, total: 1:47:49.432964
Progress[%]: 7.87 : PID-16, L2A_CSND_2_2  , elapsed time[s]: 0.776, total: 1:47:50.208583
Progress[%]: 7.93 : PID-16, L2A_CSND_2_3  , elapsed time[s]: 0.711, total: 1:47:50.919235
Progress[%]: 8.04 : PID-16, L2A_CSND_2_4  , elapsed time[s]: 1.308, total: 1:47:52.227727
Progress[%]: 8.22 : PID-16, L2A_CSND_2_5  , elapsed time[s]: 2.096, total: 1:47:54.323301
Progress[%]: 8.22 : PID-16, L2A_SnowPostProcessingCCI  , elapsed time[s]: 0.013, total: 1:47:54.336094
Progress[%]: 8.42 : PID-16, L2A_CSND_3    , elapsed time[s]: 2.406, total: 1:47:56.741633
Progress[%]: 8.60 : PID-16, L2A_CSND_5_1  , elapsed time[s]: 2.218, total: 1:47:58.959452
Progress[%]: 8.93 : PID-16, L2A_CSND_5_2  , elapsed time[s]: 3.876, total: 1:48:02.835141
Progress[%]: 9.15 : PID-16, L2A_CSND_6    , elapsed time[s]: 2.714, total: 1:48:05.549515
Progress[%]: 9.30 : PID-16, L2A_CSND_6_2  , elapsed time[s]: 1.723, total: 1:48:07.272218
Progress[%]: 9.47 : PID-16, L2A_CSND_7    , elapsed time[s]: 2.039, total: 1:48:09.310778

Turns out the issue was that I was running out of memory in my Docker environment. Processing a scene at 20m needed around 6 GB of RAM.