Fmriprep FileNotFoundError

Hi all,

I’m having the following error for a few subjects in a dataset that I have already processed before.

FileNotFoundError: /working/tinnitus_scratch30/fmriprep/work/fmriprep_wf/single_subject_MINN188_wf/anat_preproc_wf/surface_recon_wf/autorecon_resume_wf/parcstats/mapflow/_parcstats1/result__parcstats1.pklz

Does anyone have any idea of what could be causing it? I’m running fMRIPrep-20.1.0rc3

Thank you.

Here is the crash file output:

Node: fmriprep_wf.single_subject_MINN188_wf.anat_preproc_wf.surface_recon_wf.autorecon_resume_wf.parcstats
Working directory: /working/tinnitus_scratch30/fmriprep/work/fmriprep_wf/single_subject_MINN188_wf/anat_preproc_wf/surface_recon_wf/autorecon_resume_wf/parcstats

Node inputs:

FLAIR_file = <undefined>
T1_files = <undefined>
T2_file = <undefined>
args = <undefined>
big_ventricles = <undefined>
brainstem = <undefined>
directive = autorecon-hemi
environ = {}
expert = <undefined>
flags = ['-nohyporelabel']
hemi = ['lh', 'rh']
hippocampal_subfields_T1 = <undefined>
hippocampal_subfields_T2 = <undefined>
hires = <undefined>
mprage = <undefined>
mri_aparc2aseg = <undefined>
mri_ca_label = <undefined>
mri_ca_normalize = <undefined>
mri_ca_register = <undefined>
mri_edit_wm_with_aseg = <undefined>
mri_em_register = <undefined>
mri_fill = <undefined>
mri_mask = <undefined>
mri_normalize = <undefined>
mri_pretess = <undefined>
mri_remove_neck = <undefined>
mri_segment = <undefined>
mri_segstats = <undefined>
mri_tessellate = <undefined>
mri_watershed = <undefined>
mris_anatomical_stats = <undefined>
mris_ca_label = <undefined>
mris_fix_topology = <undefined>
mris_inflate = <undefined>
mris_make_surfaces = <undefined>
mris_register = <undefined>
mris_smooth = <undefined>
mris_sphere = <undefined>
mris_surf2vol = <undefined>
mrisp_paint = <undefined>
openmp = 3
parallel = <undefined>
steps = <undefined>
subject_id = recon_all
subjects_dir = <undefined>
talairach = <undefined>
use_FLAIR = <undefined>
use_T2 = <undefined>
xopts = <undefined>

Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/utils.py", line 94, in nodelist_runner
    result = node.run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 493, in run
    emptydirs(outdir, noexist_ok=True)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/utils/filemanip.py", line 802, in emptydirs
    os.makedirs(path)
  File "/usr/local/miniconda/lib/python3.7/os.py", line 221, in makedirs
    mkdir(name, mode)
FileExistsError: [Errno 17] File exists: '/working/tinnitus_scratch30/fmriprep/work/fmriprep_wf/single_subject_MINN188_wf/anat_preproc_wf/surface_recon_wf/autorecon_resume_wf/parcstats/mapflow/_parcstats1'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 516, in run
    result = self._run_interface(execute=True)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 1386, in _run_interface
    self.config["execution"]["stop_on_first_crash"]
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 1250, in _collate_results
    for i, nresult, err in nodes:
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/utils.py", line 99, in nodelist_runner
    result = node.result
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 217, in result
    op.join(self.output_dir(), "result_%s.pklz" % self.name)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/utils.py", line 291, in load_resultfile
    raise FileNotFoundError(results_file)
FileNotFoundError: /working/tinnitus_scratch30/fmriprep/work/fmriprep_wf/single_subject_MINN188_wf/anat_preproc_wf/surface_recon_wf/autorecon_resume_wf/parcstats/mapflow/_parcstats1/result__parcstats1.pklz

Please try upgrading to 21.0.1 with a new work directory and try again.

Hi Steven,
Thank you for your prompt reply. The reason why I haven’t upgrated fmriprep is because I’m running in a big dataset which I’ve run 80% of the subjects already. Would upgrading be the best option even though some subjects were processed with a different version?

If you haven’t already began to analyze data, which seems to be the case for you, I would personally upgrade. Make sure you do not reuse any derivatives or working directories from older runs (besides FreeSurfer, if it is version 6).

For this issue, it appears to be a filesystem synchronization issue, a race condition (is it possible you were running this same subject on multiple nodes?), or possibly the disk has run out of space. I would try re-running before scrapping and starting over.

If that fails, then I would try re-running this subject with 20.1.4, which should be able to reuse the working directory from 20.1.0rc3.

If that fails, then I would try using 21.0.1 on this subject with a new working directory. And if that succeeds, I would strongly consider re-running all of your subjects.

Thanks @Steven and @effigies for the help! I will try that.