Symlink permission and fmriprep (WSL)

Summary of what happened:

Hello,

I had run out of space on my last drive where I was preprocessing my data with fMRIPrep. I then switched to running fMRIPrep on a new SSD, since then I have had trouble using fMRIPrep, as it runs for about half an hour before giving the following error message regarding symlinks.

I was wondering if anyone might please know a solution for this? I am confused about this issue as I have not had this problem before when running fmriprep from a new drive.

Many thanks for any help

Command used (and if a helper script was used, a link to the helper script or the command generated):

Here is the exact code used:
docker run -ti --rm -v "/mnt/h/SPM_data/445/bids/:/data:ro" -v "/mnt/h/SPM_data/445/bids/derivatives/fmriprep:/out" -v "/mnt/h/tmp/:/work" -v "/mnt/h/SPM_data/445/:/fslic:ro" -v "/mnt/h/SPM_data/445/:/plugin:ro" nipreps/fmriprep:22.0.2 /data /out participant --participant-label 24219 -w /work --fs-license-file /fslic/license.txt --output-spaces anat MNI152NLin2009cAsym fsnative fsaverage --use-plugin /plugin/plugin_mem.yml --stop-on-first-crash --ignore sbref fieldmaps --bold2t1w-init header

Version:

fMRIPrep version 22.0.2.

Environment (Docker, Singularity, custom installation):

I am using WSL, Ubuntu and, Docker.

Data formatted according to a validatable standard? Please provide the output of the validator:

The data is BIDS valid.

Relevant log outputs (up to 20 lines):

        recon-all -s sub-24219 exited with ERRORS at Thu Jun 29 09:21:29 UTC 2023

        For more details, see the log file /out/sourcedata/freesurfer/sub-24219/scripts/recon-all-lh.log
        To report a problem, see http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting

Stderr:
        ln: failed to create symbolic link 'lh.white.H': Operation not permitted
Traceback:
        RuntimeError: subprocess exited with code 1.

230629-09:21:59,827 cli ERROR:
         Preprocessing did not finish successfully. Errors occurred while processing data from participants: 24219 (1). Check the HTML reports for details.
230629-09:21:59,827 cli ERROR:
         Preprocessing did not finish successfully. Errors occurred while processing data from participants: 24219 (1). Check the HTML reports for details.

Screenshots / relevant information:

N/A

Hi @JarrettC and welcome to neurostars!

I have relabeled your post as Software Support and reorganized your post to meet the Software Support post template. Please post software-related issues under this category in the future.

You can see that there is some requested information (whether your data are BIDS valid and the command you used) that could help us debug. Feel free to edit your post to include this information.

I am especially curious if you mounted all drives (e.g., symlink original locations AND destinations) in Docker.

Best,
Steven

Hi Steven,

Thank you very much for your reply. I have just edited the post to include the fmriprep command that I have used. My data is BIDS valid.

I seem to have mounted all drives - Everything else on the drive seems to be running normally e.g. using dcm2bids, etc. The problem only starts when trying to use fMRIPrep so I wonder if it is not a mounting drive issue.

Please let me know if I can give any further information which might be helpful and many thanks for your help.

Best regards,
Chelsea

Can you try not renaming the drives when you mount them in Docker?

Hi Steven,

Sorry, I am not sure what you mean.

When I open /etc/fstab, I can see this:

LABEL=cloudimg-rootfs / ext4 defaults 0 1
P: /mnt/p drvfs defaults 0 0
G: /mnt/g drvfs defaults 0 0
H: /mnt/h drvfs defaults 0 0

Though when I open Ubuntu, it automatically informs me that:
Processing fstab with mount -a failed.

How can I access the correct drive without mounting them first? I thought that mnt was a necessary step.

Many thanks for your help,
Chelsea

Each of these arguments is you renaming a drive when it is mounted on to Docker. I am saying, instead of renaming your drives (e.g., calling your BIDS folder /data) just mount them without renaming. That is delete everything after and including the colon in each -v instance. Then, in the rest of your command, use the full paths instead of the shortened, renamed paths.

The reason I am asking you to do this is that Docker will not change the destination of symlinks according to what you rename drives in your command. So if you symlink that maps to /mnt/h/SPM_data/445/bids and you rename that drive in Docker, Docker will think the symlink target doesn’t exist because the destination was renamed.

Best,
Steven

I think it may be that your file system does not support soft link operation, it should not be the reason for fmriprep. You can test it by creating a soft link on the current drive

docker run -ti --rm \
-v /mnt/h/SPM_data/445/bids/:/data:ro \
-v /mnt/h/SPM_data/445/bids/derivatives/fmriprep:/out \
-v /mnt/h/tmp/:/work \
-v /mnt/h/SPM_data/445/:/fslic:ro \
-v /mnt/h/SPM_data/445/:/plugin:ro \
nipreps/fmriprep:22.0.2 \
/data /out participant \
--participant-label 24219 \
-w /work \
--fs-license-file /fslic/license.txt \
--output-spaces anat MNI152NLin2009cAsym fsnative fsaverage \
--use-plugin /plugin/plugin_mem.yml \
--stop-on-first-crash \
--ignore sbref fieldmaps \
--bold2t1w-init header \

Hello, Thank you all so much for your help and I apologise for my late reply. It’s fixed, the problem was that the external drive that I was using after switching drives was configured to exFAT instead of NTFS. We switched it to NTFS and this fixed the issue. (For anyone following this with the same problem, make sure you back up everything on the external drive first as it will wipe everything when you do this).
Many thanks again