Init_anat_preproc_wf gives error when running autorecon1

Hi Nipype Guru,

I am trying to run the init_anat_preproc_wf with similar input options as used in fmriprep anat processing workflow. However, i got an error as soon as my workflow starts to run the autorecon1 node. the error complains about not being able to read mgh file:
error: mghRead(/Users/abdollahis2/Desktop/fcd_nipype/derivatives/freesurfer/sub-03/mri/brainmask.mgz, -1): could not open file
looking at this directory, i can see that brainmask.mgz has not been created. I have tried tracing back the previous node outputs but i am getting so confused on which part has creates this file. this is how i am calling this function:

subj_infosource = pe.Node(interface=niu.IdentityInterface(fields=[‘subject_id’]), name=“subject_info”)
subj_infosource.iterables = (‘subject_id’, [‘03’])

subject_data = collect_data(raw_mri_dir, ‘03’ , bids_validate=True)[0]
bidssrc = pe.Node(BIDSDataGrabber(subject_data=subject_data, anat_only=True), name=‘bidssrc’)

anat_preproc_wf = init_anat_preproc_wf(
bids_root=raw_mri_dir,
omp_nthreads=1,
output_dir=outputs_dir,
spaces=SpatialReferences(spaces=[‘anat’, ‘fsnative’, ‘MNI152NLin2009cAsym’,
‘MNI152NLin6Asym’]),
skull_strip_template=Reference(‘OASIS30ANTs’),
skull_strip_mode=‘force’,
freesurfer=True,
hires=True,
longitudinal=False,
t1w=subject_data[‘t1w’],
debug=False
)
anat_preproc_wf.inputs.inputnode.subjects_dir = ‘path/to/freesurfer/’

workflow.connect(subj_infosource, ‘subject_id’, bidssrc, ‘subject_id’)
workflow.connect(subj_infosource, (‘subject_id’, _prefix),anat_preproc_wf, ‘inputnode.subject_id’)
workflow.connect(bidssrc, ‘t1w’, anat_preproc_wf, ‘inputnode.t1w’)
workflow.connect(bidssrc, ‘t2w’, anat_preproc_wf, ‘inputnode.t2w’)
workflow.connect(bidssrc, ‘flair’, anat_preproc_wf, ‘inputnode.flair’)

I would appreciate any suggestion on how i can solve this bug?

Thanks
Shervin