Fmriprep OSError: [Errno 5] Input/output error: Node Validation

Hello everyone! I am currently trying to preprocess my 7T fMRI data and have stumbled upon the following error. I’ve been trying to see if there are solutions online but I haven’t been able to find anything helpful. If anyone could help that would be greatly appreciated! I’ve tried it with different subjects and the same error keeps on popping out.

Background Info:
fmriprep version: 20.2.6 ( I have tried to run it on other versions (21.0.2 and 1.4.1) and the same input.output error appeared)
BIDS Validation: The dataset was validated using the BIDS validator
I ran one participant at a time, which had 3 sessions. The BIDS folder is 3.10GB
Run using docker

fmriprep-docker command:

fmriprep-docker <input directory> <output directory> participant --participant label 01 --fs-license-file <location> --fs-no-reconall --low-mem -w <working directory>

Here is the error that I received for one of the sessions. This error is the same for the other two as well.

Node: fmriprep_wf.single_subject_01_wf.func_preproc_ses_03_task_letters_wf.initial_boldref_wf.val_bold
Working directory: /scratch/fmriprep_wf/single_subject_01_wf/func_preproc_ses_03_task_letters_wf/initial_boldref_wf/val_bold

Node inputs:

in_file = ['/data/sub-01/ses-03/func/sub-01_ses-03_task-letters_bold.nii.gz']

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 521, in run
    result = self._run_interface(execute=True)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 1366, 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 1275, in _collate_results
    "Subnodes of node: %s failed:\n%s" % (self.name, "\n".join(msg))
nipype.pipeline.engine.nodes.NodeExecutionError: Subnodes of node: val_bold failed:
Subnode 0 failed
Error: Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 398, in run
    runtime = self._run_interface(runtime)
  File "/usr/local/miniconda/lib/python3.7/site-packages/niworkflows/interfaces/images.py", line 579, in _run_interface
    img.to_filename(out_fname)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nibabel/filebasedimages.py", line 333, in to_filename
    self.to_file_map()
  File "/usr/local/miniconda/lib/python3.7/site-packages/nibabel/analyze.py", line 1045, in to_file_map
    hdrf.close_if_mine()
  File "/usr/local/miniconda/lib/python3.7/site-packages/nibabel/openers.py", line 183, in close_if_mine
    self.close()
  File "/usr/local/miniconda/lib/python3.7/site-packages/nibabel/openers.py", line 174, in close
    return self.fobj.close(*args, **kwargs)
  File "/usr/local/miniconda/lib/python3.7/gzip.py", line 319, in close
    myfileobj.close()
OSError: [Errno 5] Input/output error

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 521, in run
    result = self._run_interface(execute=True)

  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 639, in _run_interface
    return self._run_command(execute)

  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 751, in _run_command
    f"Exception raised while executing Node {self.name}.\n\n{result.runtime.traceback}"

nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node _val_bold0.

Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 398, in run
    runtime = self._run_interface(runtime)
  File "/usr/local/miniconda/lib/python3.7/site-packages/niworkflows/interfaces/images.py", line 579, in _run_interface
    img.to_filename(out_fname)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nibabel/filebasedimages.py", line 333, in to_filename
    self.to_file_map()
  File "/usr/local/miniconda/lib/python3.7/site-packages/nibabel/analyze.py", line 1045, in to_file_map
    hdrf.close_if_mine()
  File "/usr/local/miniconda/lib/python3.7/site-packages/nibabel/openers.py", line 183, in close_if_mine
    self.close()
  File "/usr/local/miniconda/lib/python3.7/site-packages/nibabel/openers.py", line 174, in close
    return self.fobj.close(*args, **kwargs)
  File "/usr/local/miniconda/lib/python3.7/gzip.py", line 319, in close
    myfileobj.close()
OSError: [Errno 5] Input/output error



Thank you for the help!

Hello,

A few things:

There should be a hyphen, not a space between “participant” and “label”

This flag is discouraged, see more here.

Besides, that, just make sure the input/output/work paths are specified correctly and that you have read/write permissions for all of them (input directory only needs read permissions).

If this doesn’t work, a more hands-on approach using Docker Run instead of the wrapper function may help diagnose/fix issues.

When you are trying these fixes, make sure to stay on the most recent version.

Best,
Steven

Hi Steven,

Thank you for your help! I fixed the issues as you mentioned but I’ve encountered the same errors again. I updated to 21.0.2 and removed the fs-no-reconall and fixed the participant label. I also checked the read/write properties for all the folders and the system and they are all good.

I also believe there is another error now but with freesurfer. Maybe the original errors have something to do with python or the installation? I’m not too sure. I’ve attached the error files below. Any help would be appreciated!

Best,
Akshaj J
crash-20220719-173609-root-autorecon1-e61254b6-5679-40e3-86ae-5a1c2dff0f5d.txt (4.5 KB)
crash-20220719-173449-root-val_bold-5763669c-b546-4630-ac45-440985c75599.txt (2.5 KB)

Both of those errors (the segmentation fault in FreeSurfer and input/output error in the BOLD workflow) indicate there is problem accessing a drive. It might be worth taking a more heuristic approach and using the docker run command, e.g (of course, change the command as necessary to match your processing needs and file system).

You said you ran BIDS validator, did it give any errors or warnings?

Best,
Steven

Hi Steven,

Thank you again for the help! I really appreciate it. I tried running it this time with the docker run command, and I’ve come with the following errors (attached below). I’ve double checked the access permissions and everything should be working correctly, so I’m not sure why it isn’t able to access properly.

Also yes I used the BIDS validator tool, and no errors appeared, only a warning for a suspiciously long event design, which I don’t think seems to be the issue here.

I also did notice a message pop up saying that some nodes exceed the total amount of memory available (48GB). This seems weird to me as I believed that having that much memory would be enough to run fmriprep? I was thinking maybe this could be a source of these errors?

crash-20220727-150345-root-val_bold-0b7f3886-3776-4c5f-a0af-e3be023892a6.txt (2.5 KB)
crash-20220727-150315-root-raw_sources-09472b43-05e5-49ab-8481-442bfbd6b2cf.txt (2.7 KB)
crash-20220727-150314-root-t1w_conform_check-d8094019-6898-481c-be8c-fc1ffa44a9da.txt (2.8 KB)
crash-20220727-150314-root-t1w_conform-cf20a366-03cf-43f4-a7e4-506d9ed5b526.txt (2.3 KB)

What was your full docker command?

Here is the command that I used:

docker run -ti --rm -v C:\Users\AnsariLab\Desktop\SSEFN\AJ_3:/data:ro -v C:\Users\AnsariLab\Desktop\SSEFN\derivatives_AJ3:/out -v C:\Users\AnsariLab\Desktop\SSEFN\myproject\license.txt:/opt/freesurfer/license.txt -v C:\Users\AnsariLab\Desktop\SSEFN\scratch:/work nipreps/fmriprep:21.0.2 /data /out/fmriprep-latest participant -w /work

Ah I see you are using Windows, that makes things more complicated…

I am not sure I can give you the best solution for working in the default windows shell, but I can recommend installing something like Cygwin which would give you a Unix-like shell in windows.

I’ll definitly look into Cygwin and see if that can help. For now I think I’m going to try running fmriprep on a Linux server to see if that solves anything. Thank you so much for your help Steven!