Qsiprep bug? resample_skulled_to_reference failed due to path issue

Summary of what happened:

I keep getting this error during the resample_skulled_to_reference node:

traits.trait_errors.TraitError: The ‘output_image’ trait of an ApplyTransformsOutputSpec instance must be a pathlike object or string representing an existing file, but a value of ‘/tmp/work/qsiprep_wf/single_subject_001_wf/anat_preproc_wf/pad_anat_reference_wf/resample_skulled_to_reference/sub-001_T1w_lps_trans.nii.gz’ <class ‘str’> was specified.

Additional error output is below. I’ve tried with two datasets collected on two different scanners with the same result. Is this a possible bug? I attached a json (as a txt) for one of my scans and the crash log.
sub-cima_acq-16mm_dir-RL_run-1_dwi.txt (3.0 KB)
crash-20240413-145358-root-resample_skulled_to_reference-741a0ab4-047b-40c5-9d9f-514649894042.txt (3.6 KB)

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

docker run --rm -it -v /Users/joseph.orr/Documents/Orr_Diffusion_PILOT/bids/:/data:ro -v /Users/joseph.orr/Documents/Orr_Diffusion_PILOT/derivatives:/out pennbbl/qsiprep:0.20.0 /data /out participant --output-resolution 1.2 --participant-label sub-001 --fs-license-file /out/license.txt

Version:

qsiprep v 0.20.0

Environment (Docker, Singularity / Apptainer, custom installation):

docker

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

Making sure the input data is BIDS compliant (warnings can be ignored in most cases).
bids-validator@1.8.4

	1: [WARN] The recommended file /README is missing. See Section 03 (Modality agnostic files) of the BIDS specification. (code: 101 - README_FILE_MISSING)

	Please visit https://neurostars.org/search?q=README_FILE_MISSING for existing conversations about this issue.

        Summary:               Available Tasks:        Available Modalities:
        35 Files, 848MB                                MRI
        2 - Subjects
        1 - Session


	If you have any questions, please post on https://neurostars.org/tags/bids.

Relevant log outputs (up to 20 lines):

	 Node resample_skulled_to_reference failed to run on host 4144e338150b.
240413-14:29:34,478 nipype.workflow ERROR:
	 Saving crash info to /out/qsiprep/sub-001/log/20240413-142855_eb85b3fc-3b95-4052-ba28-5381892b482e/crash-20240413-142934-root-resample_skulled_to_reference-ca69d006-c0cb-4cc4-a4e3-fc6b7d656063.txt
Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node resample_skulled_to_reference.

Cmdline:
	antsApplyTransforms --default-value 0 --dimensionality 3 --float 0 --input /tmp/work/qsiprep_wf/single_subject_001_wf/anat_preproc_wf/anat_template_wf/anat_conform/mapflow/_anat_conform0/sub-001_T1w_lps.nii.gz --interpolation BSpline --output sub-001_T1w_lps_trans.nii.gz --reference-image /tmp/work/qsiprep_wf/single_subject_001_wf/anat_preproc_wf/pad_anat_reference_wf/prepare_synthstrip_reference/sub-001_T1w_lps_resample_autobox_SynthStripGrid.nii --transform identity
Stdout:

Stderr:
	Illegal instruction
Traceback:
	Traceback (most recent call last):
	  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 453, in aggregate_outputs
	    setattr(outputs, key, val)
	  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/interfaces/base/traits_extension.py", line 330, in validate
	    value = super(File, self).validate(objekt, name, value, return_pathlike=True)
	  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/interfaces/base/traits_extension.py", line 135, in validate
	    self.error(objekt, name, str(value))
	  File "/usr/local/miniconda/lib/python3.10/site-packages/traits/base_trait_handler.py", line 74, in error
	    raise TraitError(
	traits.trait_errors.TraitError: The 'output_image' trait of an ApplyTransformsOutputSpec instance must be a pathlike object or string representing an existing file, but a value of '/tmp/work/qsiprep_wf/single_subject_001_wf/anat_preproc_wf/pad_anat_reference_wf/resample_skulled_to_reference/sub-001_T1w_lps_trans.nii.gz' <class 'str'> was specified.

Hi @Joseph_Orr,

How much memory/cpu are you giving to the job?

Best,
Steven

Would you happen to be running this on a non-Intel Mac?

I was running on a M1 mac with 14GB of RAM and 4GB Swap, with 8 cores. I re-ran the jobs on a HPC through Singularity and that completed. There were no figures in the report or the figures folder, but I see previous reports noting this as well. I have an Ubuntu workstation I’ll try on Monday. It has 32GB of RAM and 10-12 cores I think.

In your singuarity run did you specify a working directory? Currently there is a bug where if you don’t specify a working directory the figures don’t end up in the derivatives

I had not specified a working directory. Adding one worked.