File naming error within fmirprep

I am running into naming errors, and was hoping someone with more familiarity of Linux systems might be able to help.

Our root directory, which is /home/, has an alias which is /gs/gsfs0/users/. No matter what I do, fmriprep seems to be setting the bids directory with the latter name, even though I pass the former name in as the BIDS directory in the fmriprep call. This then runs into problems within a piece of nipype related to the naming of my T1 image, because the name is /home/… and it’s expecting /gs/gsfs0/users/…

Any thoughts about what’s going on here, and how to solve this issue? Thanks so much for any advice.


Can you pass your command here? Folder links/aliases should not be a problem (assuming the paths all exist). If I had to guess what is happening, you may be using a container to run fmriprep, but may only have /home/ bound to the container (-B singularity argument). That is, even though /home = /gs/gsfs0/users/, fMRIPrep will not be able to find /gs since it isn’t explicitly bound to the Singularity command.


This sounds like an issue where the path is resolved in one case but not another, but without a traceback (and the command being run), it’s going to be hard to diagnose.

Thanks. But what I can’t figure out is why it’s changing the explicit path which I feed in, i.e. when I feed in /home/… as the bids path in the call to fmriprep, it immediately reports the bids directory as /gs/gsfs0/…

I’ve reached out to my IT folks, hopefully they can give me some insight.

The more important question is – what is this messing up with respect to my outputs. Fmriprep continues and give me all of the expected output, how do I diagnose what this step is failing to do correctly?

Here is the full crash log:

Node: fmriprep_wf.single_subject_006_wf.anat_preproc_wf.anat_derivatives_wf.raw_ sources
Working directory: /gs/gsfs0/users/mrrc-all/PROJECTS/P65-ALL/work/fmriprep_wf/si ngle_subject_006_wf/anat_preproc_wf/anat_derivatives_wf/raw_sources

Node inputs:

bids_root = /gs/gsfs0/users/mrrc-all/PROJECTS/P65-ALL/BIDS/NIFTI
function_str = def _bids_relative(in_files, bids_root):
from pathlib import Path
if not isinstance(in_files, (list, tuple)):
in_files = [in_files]
in_files = [str(Path§.relative_to(bids_root)) for p in in_files]
return in_files

in_files = /home/mrrc-all/PROJECTS/P65-ALL/BIDS/NIFTI/sub-006/ses-1/anat/sub-006 _ses-1_acq-3D_T1w.nii.gz

Traceback (most recent call last):
File “/gs/gsfs0/users/mwagshul/.local/lib/python3.7/site-packages/nipype/pipel ine/plugins/”, line 67, in run_node
result[“result”] =
File “/gs/gsfs0/users/mwagshul/.local/lib/python3.7/site-packages/nipype/pipel ine/engine/”, line 516, in run
result = self._run_interface(execute=True)
File “/gs/gsfs0/users/mwagshul/.local/lib/python3.7/site-packages/nipype/pipel ine/engine/”, line 635, in _run_interface
return self._run_command(execute)
File “/gs/gsfs0/users/mwagshul/.local/lib/python3.7/site-packages/nipype/pipel ine/engine/”, line 741, in _run_command
result =
File “/gs/gsfs0/users/mwagshul/.local/lib/python3.7/site-packages/nipype/inter faces/base/”, line 434, in run
runtime = self._run_interface(runtime)
File “/gs/gsfs0/users/mwagshul/.local/lib/python3.7/site-packages/nipype/inter faces/utility/”, line 142, in _run_interface
out = function_handle(**args)
File “”, line 5, in _bids_relative
File “”, line 5, in
File “/gs/gsfs0/users/mwagshul/.conda/envs/my-conda-env/lib/python3.7/pathlib. py”, line 895, in relative_to
.format(str(self), str(formatted)))
ValueError: ‘/home/mrrc-all/PROJECTS/P65-ALL/BIDS/NIFTI/sub-006/ses-1/anat/sub-0 06_ses-1_acq-3D_T1w.nii.gz’ does not start with ‘/gs/gsfs0/users/mrrc-all/PROJECTS/P65-ALL/BIDS/NIFTI’