Using fMRIPrep 20.0.6, via docker (fmriprep-docker) with the -u $UID flag. During at the start of FreeSurfer processing, fMRIPrep crashes with what appears to be a permissions error. No other preceding errors and everything to that point comes out owned by my user account (as desired).
Node: fmriprep_wf.fsdir_run_20200424_173701_c73b53cd_29a6_4755_b77b_ac5e10a68752
Working directory: /tmp/work/fmriprep_wf/fsdir_run_20200424_173701_c73b53cd_29a6_4755_b77b_ac5e10a68752
Node inputs:
derivatives = /out
freesurfer_home = /opt/freesurfer
overwrite_fsaverage = False
spaces = []
subjects_dir = freesurfer
Traceback (most recent call last):
File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 344, in _send_procs_to_workers
self.procs[jobid].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 635, in _run_interface
return self._run_command(execute)
File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 741, in _run_command
result = self._interface.run(cwd=outdir)
File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 397, in run
runtime = self._run_interface(runtime)
File "/usr/local/miniconda/lib/python3.7/site-packages/niworkflows/interfaces/bids.py", line 684, in _run_interface
copytree(source, dest)
File "/usr/local/miniconda/lib/python3.7/shutil.py", line 359, in copytree
raise Error(errors)
shutil.Error: [('/opt/freesurfer/subjects/fsaverage/label', '/out/freesurfer/fsaverage/label', "[Errno 1] Operation not permitted: '/out/freesurfer/fsaverage/label'"), ......]
(ellipses added at the end)
can you share the full command you are using? and verify that /out/freesurfer/fsaverage/label is owned by the same UID you are passing in?
The fsaverage folder and contents aren't owned by the UID I'm passing (they're owned by root), which appears to be the problem. My command is below...
fmriprep-docker --fs-license-file ~/license.txt ./BIDS_Master/ ./fmriprep/ participant --ignore fieldmaps --n_cpus 32 -u $UID
@mgxd with that command line (without --fs-subjects-dir), should not the freesurfer folder be pointing to $PWD/fmriprep/freesurfer ?
@oesteban the output directory, in this case ./fmriprep, is remapped to /out within the container, so /out/freesurfer seems correct.
@jrussell9000 did the output folder exist before running the wrapper? this looks similar to https://github.com/poldracklab/fmriprep/issues/2098
in any case, we could add a check to the wrapper warning users about permission issues when mounting non-existing directories.
In this case the output directory structure did not exist prior to starting the wrapper. I'd second a permissions check...I didn't realize I needed to create those directories. I'll create the fmriprep and freesurfer directories (owned by my UID) before running again and update this issue with the results.
This should be fixed in #2106
Most helpful comment
@oesteban the output directory, in this case
./fmriprep, is remapped to/outwithin the container, so/out/freesurferseems correct.@jrussell9000 did the output folder exist before running the wrapper? this looks similar to https://github.com/poldracklab/fmriprep/issues/2098
in any case, we could add a check to the wrapper warning users about permission issues when mounting non-existing directories.