nipreps / fmriprep

fMRIPrep is a robust and easy-to-use pipeline for preprocessing of diverse fMRI data. The transparent workflow dispenses of manual intervention, thereby ensuring the reproducibility of the results.
https://fmriprep.org
Apache License 2.0
634 stars 293 forks source link

FileExistsError #2505

Open jbwexler opened 3 years ago

jbwexler commented 3 years ago

What version of fMRIPrep are you using?

20.2.3

What kind of installation are you using? Containers (Singularity, Docker), or "bare-metal"?

Singularity

What is the exact command-line you used?

code/containers/scripts/singularity_cmd run code/containers/images/bids/bids-fmriprep--20.2.3.sing sourcedata/ds001734 /scratch1/03201/jbwexler/openneuro_derivatives_tests/derivatives/fmriprep/ds001734-fmriprep participant --participant-label '001' -w '/scratch1/03201/jbwexler/work_dir/fmriprep//ds001734_sub-001' -vv --output-spaces MNI152NLin2009cAsym:res-2 anat func fsaverage5 --nthreads 14 --omp-nthreads 7 --skip-bids-validation --notrack --fs-license-file /home1/03201/jbwexler/.freesurfer.txt --use-aroma --ignore slicetiming --output-layout bids --cifti-output --resource-monitor --skull-strip-t1w force --use-syn-sdc --mem_mb 38400 --bids-database-dir /tmp

Have you checked that your inputs are BIDS valid?

Yes

Did fMRIPrep generate the visual report for this particular subject? If yes, could you share it?

no

Can you find some traces of the error reported in the visual report (at the bottom) or in crashfiles?

Traceback (most recent call last):
  File "/usr/local/miniconda/bin/fmriprep", line 6, in <module>
    from fmriprep.cli.run import main
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/cli/run.py", line 4, in <module>
    from .. import config
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/config.py", line 96, in <module>
    from templateflow import __version__ as _tf_ver
  File "/usr/local/miniconda/lib/python3.7/site-packages/templateflow/__init__.py", line 19, in <module>
    from . import api
  File "/usr/local/miniconda/lib/python3.7/site-packages/templateflow/api.py", line 7, in <module>
    from .conf import TF_LAYOUT, TF_S3_ROOT, TF_USE_DATALAD
  File "/usr/local/miniconda/lib/python3.7/site-packages/templateflow/conf/__init__.py", line 42, in <module>
    _update_s3(TF_HOME, local=True, overwrite=True)
  File "/usr/local/miniconda/lib/python3.7/site-packages/templateflow/conf/_s3.py", line 20, in update
    retval = _update_skeleton(skel_file, dest, overwrite=overwrite, silent=silent)
  File "/usr/local/miniconda/lib/python3.7/site-packages/templateflow/conf/_s3.py", line 55, in _update_skeleton
    zipref.extractall(str(dest))
  File "/usr/local/miniconda/lib/python3.7/zipfile.py", line 1616, in extractall
    self._extract_member(zipinfo, path, pwd)
  File "/usr/local/miniconda/lib/python3.7/zipfile.py", line 1666, in _extract_member
    os.mkdir(targetpath)
FileExistsError: [Errno 17] File exists: '/scratch1/03201/jbwexler/openneuro_derivatives_tests/derivatives/fmriprep/ds001734-fmriprep/code/containers/binds/HOME/.cache/templateflow/tpl-Fischer344'

Are you reusing previously computed results (e.g., FreeSurfer, Anatomical derivatives, work directory of previous run)?

no

fMRIPrep log

If you have access to the output logged by fMRIPrep, please make sure to attach it as a text file to this issue.

Note: I linked to this issue on the template flow github: https://github.com/templateflow/templateflow/issues/93

jbwexler commented 3 years ago

@effigies

mgxd commented 3 years ago

Are you running multiple jobs in parallel? This looks like 2 conflicting templateflow update calls.

Can you clear your templateflow cache (/scratch1/03201/jbwexler/openneuro_derivatives_tests/derivatives/fmriprep/ds001734-fmriprep/code/containers/binds/HOME/.cache/templateflow/) and retry with a single job?

effigies commented 3 years ago

Yes, it's a race, but we should be resilient to those. For fMRIPrep, we should check again that we're prefetching all default templates. For templateflow we should catch the error and validate the newly found file.