ERROR: Label BA1_exvivo does not exist in SUBJECTS_DIR fsaverage! The fsaverage link probably points to an older freesurfer version
What happened?
I am running fmriprep-23.2.1 with singularity on Slurm and am getting the error described in the title. This error occurs for most subjects. What should I do about it?
What command did you use?
TEMPLATEFLOW_HOST_HOME=$HOME/.cache/templateflow
FMRIPREP_HOST_CACHE=$HOME/.cache/fmriprep
export SINGULARITYENV_TEMPLATEFLOW_HOME="/templateflow"
export SINGULARITYENV_FS_LICENSE="/share/apps/imaging/freesurfer-7.3.2/license.txt"
singularity run \
--cleanenv \
-B $PROJECT:/rootdir \
-B $BIDS_DIR:/data \
-B $DERIVS_DIR:/output \
-B $WORK_DIR:/work \
-B ${TEMPLATEFLOW_HOST_HOME}:${SINGULARITYENV_TEMPLATEFLOW_HOME} \
-B ${SINGULARITYENV_FS_LICENSE}:/freesurfer_license \
${FMRIPREP} /data /output \
participant --participant_label $subject \
-w /work \
-vv \
--fs-license-file /freesurfer_license \
--mem-mb 32000 \
--n-cpus 8 \
--write-graph \
--output-spaces MNI152NLin2009cAsym:res-2 \
--return-all-components
exitcode=$?
What version of fMRIPrep are you running?
23.2.1
How are you running fMRIPrep?
Singularity
Is your data BIDS valid?
Yes
Are you reusing any previously computed results?
No
Please copy and paste any relevant log output.
/output/sourcedata/freesurfer/sub-023023/label
#--------------------------------------------
#@# BA_exvivo Labels lh Thu Mar 21 08:20:45 EDT 2024
-------------------------------------------------------------------------
ERROR: Label BA1_exvivo does not exist in SUBJECTS_DIR fsaverage!
The fsaverage link probably points to an older freesurfer version
-------------------------------------------------------------------------
Additional information / screenshots
No response
So the issue is that in your $DERIVS_DIR/freesurfer, there's a copy of fsaverage that comes from an older FreeSurfer version. You probably just want to delete that.
I just got the same error with 23.2.1. I used empty output and working directories, so I don't think there's an old fsaverage copy in $DERIVS_DIR/freesurfer in my case.
Is it possible there's a race and two processes are creating the freesurfer/ directory?
I'm running fMRIPrep with a job array (one job for each of 8 subjects), but that's all that's writing to the freesurfer/ directory. I did just clear out the working and output directories and resubmitted my jobs with --contain-all, so maybe that will fix it. If it doesn't I'll follow up here.
Adding --contain-all seems to have resolved the issue for me.
@WangYunHong98 did clearing out the working and output directories fix the problem for you?
Hi @tsalo
I cleaned out all directories and added --fs-subjects-dir /output/freesurfer. It works for me.
Hi @effigies
Is there a possibility that if I first submit the fmriprep job for dataset 1 in slurm, and at the same time I submit another freesurfer job in terminal (no it's with slurm), setting the environment variable $SUBJECTS_DIR. So would this situation cause this error to be reported?
Best, Yunhong
If you're submitting FreeSurfer and fMRIPrep jobs that both use the same subject directory, yes, I would expect conflicts.