Fmriprep: traits.trait_errors.TraitError: The 'run' trait of a ReadSidecarJSONOutputSpec instance must be a unicode string, but a value of 1 <class 'int'> was specified

Hi,

fmriprep 1.3.0 and earlier fails preprocessing for subjects with multiple fieldmaps with the following error:

Node: fmriprep_wf.single_subject_100009_wf.func_preproc_task_machinegame_run_02_wf.sdc_wf.phdiff_wf.meta
Working directory: /tmp/work/fmriprep_wf/single_subject_100009_wf/func_preproc_task_machinegame_run_02_wf/sdc_wf/phdiff_wf/meta

Node inputs:

bids_dir = None
bids_validate = False
fields = <undefined>
in_file = sub-100009/fmap/sub-100009_run-01_phasediff.nii.gz
undef_fields = False

Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 69, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 473, in run
    result = self._run_interface(execute=True)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 557, in _run_interface
    return self._run_command(execute)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 637, in _run_command
    result = self._interface.run(cwd=outdir)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 371, in run
    outputs = self.aggregate_outputs(runtime)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 472, in aggregate_outputs
    raise error
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 465, in aggregate_outputs
    setattr(outputs, key, val)
  File "/usr/local/miniconda/lib/python3.7/site-packages/traits/trait_handlers.py", line 172, in error
    value )
traits.trait_errors.TraitError: The 'run' trait of a ReadSidecarJSONOutputSpec instance must be a unicode string, but a value of 1 <class 'int'> was specified.

Hi @zenkavi

Thanks for reporting this. We addressed this problem with https://github.com/poldracklab/niworkflows/pull/307, and as long as your niworkflows version is 0.7.1.post1 or above this should work.

Since you are using containers, then fmriprep>=1.3.0.post2 should work out for you.

Please let us know whether the upgrade indeed solved the problem.

Yes it did! Thank you!

1 Like