[Help!] modelestimate node error in the First Level univariate analysis using Nipype

Summary of what happened:

Hi everyone, I am Chengsi, and I am very new to processing fMRI data. Now, I bumped into some bugs I couldn’t solve when I ran the first-level analysis of our fMRI data using nipype via the Jupyter Notebooks. Things went well until the script executed ‘modelestimate’ nodes, which constantly reported warnings about “Storing result file without outputs” following crashes like “xxx instance must be a pathlike object or string representing an existing file, but a value of [path to a file] was specified.” We checked that the space allocated to run this script is adequate, but such errors occur. Now I am kind of desperate and have no idea where to look at, so I pasted some code and log I thought might be relevant to this error here. Please let me know if any additional information is needed.

Much Thanks!
Chengsi

Command used:

modelestimate = pe.MapNode(
    interface=fsl.FILMGLS(smooth_autocorr=True),
    name='modelestimate',
    iterfield=['design_file', 'in_file', 'tcon_file'])

Version:

Python 3.10.6
Nipype 1.8.6

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

Running the script on Jupyter Notebook (Jupyter Lab) from the HPC.

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

BIDS

Relevant log outputs (up to 20 lines):

Traceback:
	Traceback (most recent call last):
...
	  File "/home/yic/.local/lib/python3.10/site-packages/traits/base_trait_handler.py", line 74, in error
	    raise TraitError(
	traits.trait_errors.TraitError: Each element of the 'tstats' trait of a FILMGLSOutputSpec507 instance must be a pathlike object or string representing an existing file, but a value of '/blue/.../code/fsl/workingdir/level1/modelfit/_run_id_1_session_id_1_subject_id_22014/modelestimate/mapflow/_modelestimate0/results/tstat1.nii.gz' <class 'str'> was specified.

	During handling of the above exception, another exception occurred:

	Traceback (most recent call last):
	  File "/home/yic/.local/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 400, in run
	    outputs = self.aggregate_outputs(runtime)
	  File "/home/yic/.local/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 460, in aggregate_outputs
	    raise FileNotFoundError(msg)
	FileNotFoundError: No such file or directory '['/blue/.../code/fsl/workingdir/level1/modelfit/_run_id_1_session_id_1_subject_id_22014/modelestimate/mapflow/_modelestimate0/results/tstat1.nii.gz']' for output 'tstats' of a FILMGLS interface

Problem solved by allocating more cores and RAMs to the Jupyter Notebook. I ended up with 4 cores and 16GB of RAM for each cores.