Fmriprep / freesurfer error: midthickness file not found, multiband data (x4)

I’m having errors using version 1.1.2. The BIDS folder has been validated. This is happening to all participants (including those in another study with different parameters) and the error goes away by turning off reconstruction (–fs-no-reconall). Error is pasted below. I have checked and the files do not exist in the working directory, although it is populated with other files. Anyone having a similar issue?

I’m running the subjects based on this command and have the variables populated within the script I use:

srun singularity run $image $bidsdir $outdir participant -w $workdir --participant_label $subject --nthreads 14 --omp-nthreads 14 --mem-mb 56000 --output-space {T1w,template,fsnative} --low-mem --use-aroma --fs-license-file $outdir/license.txt --no-submm-recon --write-graph

Errors

Node Name: _midthickness1
File: /fdata/scratch/bryjack0890/lcmn/CBLM2/fmriprep/output/fmriprep/sub-OA1/log/20180817-171433_2b17487a-7b30-4149-a710-0ba5d2241dfe/crash-20180817-172118-bryjack0890-_midthickness1-a4298bb2-1ec2-49de-bb1e-5185addcdf59.txt
Working Directory: /fdata/scratch/bryjack0890/lcmn/CBLM2/fmriprep/work/fmriprep_wf/single_subject_OA1_wf/anat_preproc_wf/surface_recon_wf/gifti_surface_wf/midthickness/mapflow/_midthickness1
Inputs:
    args: <undefined>
    distance: 0.5
    dt: <undefined>
    environ: {'SUBJECTS_DIR': '/opt/freesurfer/subjects'}
    graymid: ['/fdata/scratch/bryjack0890/lcmn/CBLM2/fmriprep/output/freesurfer/sub-OA1/surf/lh.midthickness', '/fdata/scratch/bryjack0890/lcmn/CBLM2/fmriprep/output/freesurfer/sub-OA1/surf/rh.midthickness']
    in_file: /fdata/scratch/bryjack0890/lcmn/CBLM2/fmriprep/output/freesurfer/sub-OA1/surf/lh.smoothwm
    nsurfaces: <undefined>
    out_name: midthickness
    pial: <undefined>
    smooth_averages: <undefined>
    sphere: sphere
    spring: <undefined>
    subjects_dir: /opt/freesurfer/subjects
    thickness: True
    thickness_name: <undefined>
    write_iterations: <undefined>

Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/pipeline/plugins/multiproc.py", line 69, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 480, in run
    result = self._run_interface(execute=True)
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 564, in _run_interface
    return self._run_command(execute)
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 644, in _run_command
    result = self._interface.run(cwd=outdir)
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/interfaces/freesurfer/base.py", line 144, in run
    return super(FSCommand, self).run(**inputs)
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/interfaces/base/core.py", line 521, in run
    runtime = self._run_interface(runtime)
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/interfaces/base/core.py", line 1033, in _run_interface
    self.raise_exception(runtime)
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/interfaces/base/core.py", line 970, in raise_exception
    ).format(**runtime.dictcopy()))
RuntimeError: Command:
cp /fdata/scratch/bryjack0890/lcmn/CBLM2/fmriprep/output/freesurfer/sub-OA1/surf/lh.midthickness /fdata/scratch/bryjack0890/lcmn/CBLM2/fmriprep/work/fmriprep_wf/single_subject_OA1_wf/anat_preproc_wf/surface_recon_wf/gifti_surface_wf/midthickness/mapflow/_midthickness1/lh.midthickness
Standard output:

Standard error:
cp: cannot stat '/fdata/scratch/bryjack0890/lcmn/CBLM2/fmriprep/output/freesurfer/sub-OA1/surf/lh.midthickness': No such file or directory
Return code: 1

Node Name: _midthickness0
File: /fdata/scratch/bryjack0890/lcmn/CBLM2/fmriprep/output/fmriprep/sub-OA1/log/20180817-171433_2b17487a-7b30-4149-a710-0ba5d2241dfe/crash-20180817-172116-bryjack0890-_midthickness0-273cb394-5c33-4b66-9248-617bfbfb18f8.txt
Working Directory: /fdata/scratch/bryjack0890/lcmn/CBLM2/fmriprep/work/fmriprep_wf/single_subject_OA1_wf/anat_preproc_wf/surface_recon_wf/gifti_surface_wf/midthickness/mapflow/_midthickness0
Inputs:
    args: <undefined>
    distance: 0.5
    dt: <undefined>
    environ: {'SUBJECTS_DIR': '/opt/freesurfer/subjects'}
    graymid: ['/fdata/scratch/bryjack0890/lcmn/CBLM2/fmriprep/output/freesurfer/sub-OA1/surf/lh.midthickness', '/fdata/scratch/bryjack0890/lcmn/CBLM2/fmriprep/output/freesurfer/sub-OA1/surf/rh.midthickness']
    in_file: /fdata/scratch/bryjack0890/lcmn/CBLM2/fmriprep/output/freesurfer/sub-OA1/surf/rh.smoothwm
    nsurfaces: <undefined>
    out_name: midthickness
    pial: <undefined>
    smooth_averages: <undefined>
    sphere: sphere
    spring: <undefined>
    subjects_dir: /opt/freesurfer/subjects
    thickness: True
    thickness_name: <undefined>
    write_iterations: <undefined>

Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/pipeline/plugins/multiproc.py", line 69, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 480, in run
    result = self._run_interface(execute=True)
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 564, in _run_interface
    return self._run_command(execute)
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 644, in _run_command
    result = self._interface.run(cwd=outdir)
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/interfaces/freesurfer/base.py", line 144, in run
    return super(FSCommand, self).run(**inputs)
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/interfaces/base/core.py", line 521, in run
    runtime = self._run_interface(runtime)
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/interfaces/base/core.py", line 1033, in _run_interface
    self.raise_exception(runtime)
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/interfaces/base/core.py", line 970, in raise_exception
    ).format(**runtime.dictcopy()))
RuntimeError: Command:
cp /fdata/scratch/bryjack0890/lcmn/CBLM2/fmriprep/output/freesurfer/sub-OA1/surf/rh.midthickness /fdata/scratch/bryjack0890/lcmn/CBLM2/fmriprep/work/fmriprep_wf/single_subject_OA1_wf/anat_preproc_wf/surface_recon_wf/gifti_surface_wf/midthickness/mapflow/_midthickness0/rh.midthickness
Standard output:

Standard error:
cp: cannot stat '/fdata/scratch/bryjack0890/lcmn/CBLM2/fmriprep/output/freesurfer/sub-OA1/surf/rh.midthickness': No such file or directory
Return code: 1

I suspect this is a permissions issue. Does your user have write access to the FreeSurfer directory?

Do you mean the fs output directory or the fs bin? The output directory is in my scratch folder and I’m initiating the process so those permissions should be set correctly. I’m not sure if I have write access to the fs app itself - I would need to check.

The FreeSurfer output folder.

It’s saying that it cannot stat /fdata/scratch/bryjack0890/lcmn/CBLM2/fmriprep/output/freesurfer/sub-OA1/surf/lh.midthickness, which suggests it believes the file should already be there. So either it’s there and you don’t have permission to read, or it’s not, which probably means an earlier step failed to write it.

Can you verify whether the file exists and what its permissions are?

No, the files do not exist. They’re never created.

Hmm. Are you reusing a scratch directory, by chance? Possibly removing /fdata/scratch/bryjack0890/lcmn/CBLM2/fmriprep/work/fmriprep_wf/single_subject_OA1_wf/anat_preproc_wf/surface_recon_wf/gifti_surface_wf/ will resolve the issue?