Your recon-all errors are a duplicate of Could not read error : while file ":/out/freesurfer/sub-001/mri/T2.prenorm.mgz" exist
I believe you may be hitting memory limitations. Can you try the following sbatch config? I modified your $SUBJ variable to contain two subjects each with one or the other error you are getting.
#!/bin/bash
#SBATCH --job-name=limited_mindfcomp_22_03
#SBATCH --output=limited_mindfcomp_22_03.txt
#SBATCH --error=limited_mindfcomp_22_03.err
#SBATCH -n 1
#SBATCH --cpus-per-task=12
#SBATCH --mem-per-cpu=4G
#SBATCH --array=1-2
SUBJ=(002 004)
singularity run --cleanenv -B /mnt:/mnt /mnt/data/singularity_images/fmriprep-latest.simg \
/mnt/data/loic2/RSBIDS4 /mnt/data/loic2/fmriprep_output_tw_less participant \
--participant-label ${SUBJ[$SLURM_ARRAY_TASK_ID-1]} --low-mem --stop-on-first-crash \
--medial-surface-nan --use-aroma --cifti-output --notrack \
--output-space template fsaverage5 --fs-license-file /mnt/data/loic2/license.txt \
--omp-nthreads 8 --nthreads 12 --mem_mb 30000
Before running that, please make sure you run:
find /mnt/data/loic2/fmriprep_output_tw_less/freesurfer -name "*IsRunning*" -delete
to get rid of all the IsRunning files.