fmriprep icon indicating copy to clipboard operation
fmriprep copied to clipboard

ERROR: Label BA1_exvivo does not exist in SUBJECTS_DIR fsaverage! The fsaverage link probably points to an older freesurfer version

Open WangYunHong98 opened this issue 1 year ago • 8 comments

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

WangYunHong98 avatar Mar 22 '24 06:03 WangYunHong98

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.

effigies avatar Mar 22 '24 20:03 effigies

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.

tsalo avatar Apr 02 '24 12:04 tsalo

Is it possible there's a race and two processes are creating the freesurfer/ directory?

effigies avatar Apr 02 '24 13:04 effigies

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.

tsalo avatar Apr 02 '24 14:04 tsalo

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?

tsalo avatar Apr 03 '24 17:04 tsalo

Hi @tsalo

I cleaned out all directories and added --fs-subjects-dir /output/freesurfer. It works for me.

WangYunHong98 avatar Apr 05 '24 12:04 WangYunHong98

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

WangYunHong98 avatar Apr 19 '24 07:04 WangYunHong98

If you're submitting FreeSurfer and fMRIPrep jobs that both use the same subject directory, yes, I would expect conflicts.

effigies avatar Apr 19 '24 13:04 effigies