Fmriprep error: "Interface ReconAllRPT failed to run."

I am running the latest version of fmriprep, on macOS 10.11.6 using the default settings. It crashes with an error, apparently after successfully running freesurfer recon-all. Any idea what I could be doing wrong? I’ve set Docker so it uses 4 core and 8 GB of RAM.

Error message:

recon-all -s sub-sid000198 exited with ERRORS at Sat Apr  1 00:54:03 UTC 2017

For more details, see the log file /out/out/freesurfer/sub-sid000198/scripts/recon-all.log
To report a problem, see http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting


Standard error:

Return code: 1
Interface ReconAllRPT failed to run. 

170401-00:54:04,285 workflow INFO:
	 ***********************************
170401-00:54:04,285 workflow ERROR:
	 could not run node: workflow_enumerator.sid000080.t1w_preprocessing.Reconstruction2
170401-00:54:04,285 workflow INFO:
	 crashfile: /out/out/fmriprep/sub-sid000080/log/20170330-235106_1babf002-9211-4023-9532-b9cd50ed974a/crash-20170331-122539-root-Reconstruction2-c8afe603-bb79-43c5-b91e-c9a63de72b79.pklz
170401-00:54:04,287 workflow ERROR:
	 could not run node: workflow_enumerator.sid000198.t1w_preprocessing.Reconstruction2
170401-00:54:04,287 workflow INFO:
	 crashfile: /out/out/fmriprep/sub-sid000198/log/20170330-235106_1babf002-9211-4023-9532-b9cd50ed974a/crash-20170401-005404-root-Reconstruction2-25adc201-e030-493b-aa11-dbe155edd363.pklz
170401-00:54:04,288 workflow INFO:
	 ***********************************

Info from fmriprep HTML report:

Node Name: workflow_enumerator.sid000080.t1w_preprocessing.Reconstruction2
File: crash-20170331-122539-root-Reconstruction2-c8afe603-bb79-43c5-b91e-c9a63de72b79.pklz
Working Directory: /root/src/fmriprep/work/workflow_enumerator/sid000080/t1w_preprocessing/Reconstruction2
Inputs: 
T1_files:
T2_file:
args:
compress_report: auto
directive: all
environ: {}
expert:
flags: -noskullstrip
generate_report: True
hemi:
hires:
ignore_exception: False
mri_aparc2aseg:
mri_ca_label:
mri_ca_normalize:
mri_ca_register:
mri_edit_wm_with_aseg:
mri_em_register:
mri_fill:
mri_mask:
mri_normalize:
mri_pretess:
mri_remove_neck:
mri_segment:
mri_segstats:
mri_tessellate:
mri_watershed:
mris_anatomical_stats:
mris_ca_label:
mris_fix_topology:
mris_inflate:
mris_make_surfaces:
mris_register:
mris_smooth:
mris_sphere:
mris_surf2vol:
mrisp_paint:
openmp: 4
out_report: reconall.svg
parallel: True
subject_id: sub-sid000080
subjects_dir: /out/out/freesurfer
talairach:
terminal_output: stream
use_T2: False
 Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/pipeline/plugins/multiproc.py", line 52, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 366, in run
    self._run_interface()
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 476, in _run_interface
    self._result = self._run_command(execute)
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 607, in _run_command
    result = self._interface.run()
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/interfaces/base.py", line 1085, in run
    runtime = self._run_wrapper(runtime)
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/interfaces/base.py", line 1728, in _run_wrapper
    runtime = self._run_interface(runtime)
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/common/report.py", line 52, in _run_interface
    ReportCapableInterface, self)._run_interface(runtime)
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/interfaces/base.py", line 1762, in _run_interface
    self.raise_exception(runtime)
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/interfaces/base.py", line 1686, in raise_exception
    **runtime.dictcopy()))
RuntimeError: Command:
recon-all -all -noskullstrip -openmp 4 -parallel -subjid sub-sid000080 -sd /out/out/freesurfer -nomotioncor -notalairach -nonuintensitycor -nonormalization

Could you share the content of out/freesurfer/sub-sid000198/scripts/recon-all.log ?

No problem. The file out/freesurfer/sub-sid000198/scripts/recon-all.log is too large to post here, so I’ve uploaded here: http://beausievers.com/neurostars/sub-sid000198-recon-all.log

This is weird. Even though the log mentions that FreeSurfer exited with errors it does not mention any details. It might be worth sharing this on the FreeSurfer mailing list.

Does this happen for consistently across subjects?

I’ve tried it on two subjects (data collected and organized the same way for both subjects) and it happened for both. It is weirdβ€”to my (admittedly non-expert) eye, it looks like recon-all ran successfully, insofar as it created the following files (in the freesurfer subdirectory of /out):

sub-sid000198
β”œβ”€β”€ label
β”‚   β”œβ”€β”€ aparc.annot.DKTatlas.ctab
β”‚   β”œβ”€β”€ aparc.annot.a2009s.ctab
β”‚   β”œβ”€β”€ aparc.annot.ctab
β”‚   β”œβ”€β”€ lh.aparc.DKTatlas.annot
β”‚   β”œβ”€β”€ lh.aparc.a2009s.annot
β”‚   β”œβ”€β”€ lh.aparc.annot
β”‚   β”œβ”€β”€ lh.cortex.label
β”‚   β”œβ”€β”€ rh.aparc.DKTatlas.annot
β”‚   β”œβ”€β”€ rh.aparc.a2009s.annot
β”‚   β”œβ”€β”€ rh.aparc.annot
β”‚   └── rh.cortex.label
β”œβ”€β”€ mri
β”‚   β”œβ”€β”€ T1.mgz
β”‚   β”œβ”€β”€ aparc+aseg.mgz
β”‚   β”œβ”€β”€ aparc.a2009s+aseg.mgz
β”‚   β”œβ”€β”€ aseg.auto.mgz
β”‚   β”œβ”€β”€ aseg.auto_noCCseg.label_intensities.txt
β”‚   β”œβ”€β”€ aseg.auto_noCCseg.mgz
β”‚   β”œβ”€β”€ aseg.presurf.hypos.mgz
β”‚   β”œβ”€β”€ aseg.presurf.mgz
β”‚   β”œβ”€β”€ brain.finalsurfs.mgz
β”‚   β”œβ”€β”€ brain.mgz
β”‚   β”œβ”€β”€ brainmask.auto.mgz
β”‚   β”œβ”€β”€ brainmask.mgz
β”‚   β”œβ”€β”€ ctrl_pts.mgz
β”‚   β”œβ”€β”€ filled.mgz
β”‚   β”œβ”€β”€ lh.ribbon.mgz
β”‚   β”œβ”€β”€ mri_nu_correct.mni.log
β”‚   β”œβ”€β”€ mri_nu_correct.mni.log.bak
β”‚   β”œβ”€β”€ norm.mgz
β”‚   β”œβ”€β”€ nu.mgz
β”‚   β”œβ”€β”€ orig
β”‚   β”‚   └── 001.mgz
β”‚   β”œβ”€β”€ orig.mgz
β”‚   β”œβ”€β”€ orig_nu.mgz
β”‚   β”œβ”€β”€ rawavg.mgz
β”‚   β”œβ”€β”€ rh.ribbon.mgz
β”‚   β”œβ”€β”€ ribbon.mgz
β”‚   β”œβ”€β”€ segment.dat
β”‚   β”œβ”€β”€ talairach.label_intensities.txt
β”‚   β”œβ”€β”€ talairach.log
β”‚   β”œβ”€β”€ transforms
β”‚   β”‚   β”œβ”€β”€ bak
β”‚   β”‚   β”œβ”€β”€ cc_up.lta
β”‚   β”‚   β”œβ”€β”€ talairach.auto.xfm
β”‚   β”‚   β”œβ”€β”€ talairach.auto.xfm.lta
β”‚   β”‚   β”œβ”€β”€ talairach.lta
β”‚   β”‚   β”œβ”€β”€ talairach.m3z
β”‚   β”‚   β”œβ”€β”€ talairach.xfm
β”‚   β”‚   β”œβ”€β”€ talairach_avi.log
β”‚   β”‚   β”œβ”€β”€ talairach_avi_QA.log
β”‚   β”‚   └── talsrcimg_to_711-2C_as_mni_average_305_t4_vox2vox.txt
β”‚   β”œβ”€β”€ wm.asegedit.mgz
β”‚   β”œβ”€β”€ wm.mgz
β”‚   └── wm.seg.mgz
β”œβ”€β”€ scripts
β”‚   β”œβ”€β”€ build-stamp.txt
β”‚   β”œβ”€β”€ expert-options
β”‚   β”œβ”€β”€ lastcall.build-stamp.txt
β”‚   β”œβ”€β”€ patchdir.txt
β”‚   β”œβ”€β”€ pctsurfcon.log
β”‚   β”œβ”€β”€ pctsurfcon.log.old
β”‚   β”œβ”€β”€ ponscc.cut.log
β”‚   β”œβ”€β”€ recon-all-status.log
β”‚   β”œβ”€β”€ recon-all.cmd
β”‚   β”œβ”€β”€ recon-all.done
β”‚   β”œβ”€β”€ recon-all.env
β”‚   β”œβ”€β”€ recon-all.env.bak
β”‚   β”œβ”€β”€ recon-all.error
β”‚   β”œβ”€β”€ recon-all.local-copy
β”‚   └── recon-all.log
β”œβ”€β”€ stats
β”‚   β”œβ”€β”€ lh.aparc.DKTatlas.stats
β”‚   β”œβ”€β”€ lh.aparc.a2009s.stats
β”‚   β”œβ”€β”€ lh.aparc.pial.stats
β”‚   β”œβ”€β”€ lh.aparc.stats
β”‚   β”œβ”€β”€ lh.curv.stats
β”‚   β”œβ”€β”€ lh.w-g.pct.stats
β”‚   β”œβ”€β”€ rh.aparc.DKTatlas.stats
β”‚   β”œβ”€β”€ rh.aparc.a2009s.stats
β”‚   β”œβ”€β”€ rh.aparc.pial.stats
β”‚   β”œβ”€β”€ rh.aparc.stats
β”‚   β”œβ”€β”€ rh.curv.stats
β”‚   └── rh.w-g.pct.stats
β”œβ”€β”€ surf
β”‚   β”œβ”€β”€ lh.area
β”‚   β”œβ”€β”€ lh.area.mid
β”‚   β”œβ”€β”€ lh.area.pial
β”‚   β”œβ”€β”€ lh.avg_curv
β”‚   β”œβ”€β”€ lh.curv
β”‚   β”œβ”€β”€ lh.curv.pial
β”‚   β”œβ”€β”€ lh.defect_borders
β”‚   β”œβ”€β”€ lh.defect_chull
β”‚   β”œβ”€β”€ lh.defect_labels
β”‚   β”œβ”€β”€ lh.inflated
β”‚   β”œβ”€β”€ lh.inflated.H
β”‚   β”œβ”€β”€ lh.inflated.K
β”‚   β”œβ”€β”€ lh.inflated.nofix
β”‚   β”œβ”€β”€ lh.jacobian_white
β”‚   β”œβ”€β”€ lh.orig
β”‚   β”œβ”€β”€ lh.orig.nofix
β”‚   β”œβ”€β”€ lh.pial
β”‚   β”œβ”€β”€ lh.qsphere.nofix
β”‚   β”œβ”€β”€ lh.smoothwm
β”‚   β”œβ”€β”€ lh.smoothwm.BE.crv
β”‚   β”œβ”€β”€ lh.smoothwm.C.crv
β”‚   β”œβ”€β”€ lh.smoothwm.FI.crv
β”‚   β”œβ”€β”€ lh.smoothwm.H.crv
β”‚   β”œβ”€β”€ lh.smoothwm.K.crv
β”‚   β”œβ”€β”€ lh.smoothwm.K1.crv
β”‚   β”œβ”€β”€ lh.smoothwm.K2.crv
β”‚   β”œβ”€β”€ lh.smoothwm.S.crv
β”‚   β”œβ”€β”€ lh.smoothwm.nofix
β”‚   β”œβ”€β”€ lh.sphere
β”‚   β”œβ”€β”€ lh.sphere.reg
β”‚   β”œβ”€β”€ lh.sulc
β”‚   β”œβ”€β”€ lh.thickness
β”‚   β”œβ”€β”€ lh.volume
β”‚   β”œβ”€β”€ lh.w-g.pct.mgh
β”‚   β”œβ”€β”€ lh.white
β”‚   β”œβ”€β”€ lh.white.H -> lh.white.preaparc.H
β”‚   β”œβ”€β”€ lh.white.K -> lh.white.preaparc.K
β”‚   β”œβ”€β”€ lh.white.preaparc
β”‚   β”œβ”€β”€ lh.white.preaparc.H
β”‚   β”œβ”€β”€ lh.white.preaparc.K
β”‚   β”œβ”€β”€ rh.area
β”‚   β”œβ”€β”€ rh.area.mid
β”‚   β”œβ”€β”€ rh.area.pial
β”‚   β”œβ”€β”€ rh.avg_curv
β”‚   β”œβ”€β”€ rh.curv
β”‚   β”œβ”€β”€ rh.curv.pial
β”‚   β”œβ”€β”€ rh.defect_borders
β”‚   β”œβ”€β”€ rh.defect_chull
β”‚   β”œβ”€β”€ rh.defect_labels
β”‚   β”œβ”€β”€ rh.inflated
β”‚   β”œβ”€β”€ rh.inflated.H
β”‚   β”œβ”€β”€ rh.inflated.K
β”‚   β”œβ”€β”€ rh.inflated.nofix
β”‚   β”œβ”€β”€ rh.jacobian_white
β”‚   β”œβ”€β”€ rh.orig
β”‚   β”œβ”€β”€ rh.orig.nofix
β”‚   β”œβ”€β”€ rh.pial
β”‚   β”œβ”€β”€ rh.qsphere.nofix
β”‚   β”œβ”€β”€ rh.smoothwm
β”‚   β”œβ”€β”€ rh.smoothwm.BE.crv
β”‚   β”œβ”€β”€ rh.smoothwm.C.crv
β”‚   β”œβ”€β”€ rh.smoothwm.FI.crv
β”‚   β”œβ”€β”€ rh.smoothwm.H.crv
β”‚   β”œβ”€β”€ rh.smoothwm.K.crv
β”‚   β”œβ”€β”€ rh.smoothwm.K1.crv
β”‚   β”œβ”€β”€ rh.smoothwm.K2.crv
β”‚   β”œβ”€β”€ rh.smoothwm.S.crv
β”‚   β”œβ”€β”€ rh.smoothwm.nofix
β”‚   β”œβ”€β”€ rh.sphere
β”‚   β”œβ”€β”€ rh.sphere.reg
β”‚   β”œβ”€β”€ rh.sulc
β”‚   β”œβ”€β”€ rh.thickness
β”‚   β”œβ”€β”€ rh.volume
β”‚   β”œβ”€β”€ rh.w-g.pct.mgh
β”‚   β”œβ”€β”€ rh.white
β”‚   β”œβ”€β”€ rh.white.H -> rh.white.preaparc.H
β”‚   β”œβ”€β”€ rh.white.K -> rh.white.preaparc.K
β”‚   β”œβ”€β”€ rh.white.preaparc
β”‚   β”œβ”€β”€ rh.white.preaparc.H
β”‚   └── rh.white.preaparc.K
β”œβ”€β”€ tmp
β”œβ”€β”€ touch
β”‚   β”œβ”€β”€ aparc.DKTatlas2aseg.touch
β”‚   β”œβ”€β”€ aparc.a2009s2aseg.touch
β”‚   β”œβ”€β”€ asegmerge.touch
β”‚   β”œβ”€β”€ ca_label.touch
β”‚   β”œβ”€β”€ ca_normalize.touch
β”‚   β”œβ”€β”€ ca_register.touch
β”‚   β”œβ”€β”€ conform.touch
β”‚   β”œβ”€β”€ cortical_ribbon.touch
β”‚   β”œβ”€β”€ em_register.touch
β”‚   β”œβ”€β”€ fill.touch
β”‚   β”œβ”€β”€ inorm1.touch
β”‚   β”œβ”€β”€ inorm2.touch
β”‚   β”œβ”€β”€ lh.aparc.touch
β”‚   β”œβ”€β”€ lh.aparc2.touch
β”‚   β”œβ”€β”€ lh.aparcstats.touch
β”‚   β”œβ”€β”€ lh.aparcstats2.touch
β”‚   β”œβ”€β”€ lh.aparcstats3.touch
β”‚   β”œβ”€β”€ lh.avgcurv.touch
β”‚   β”œβ”€β”€ lh.curvstats.touch
β”‚   β”œβ”€β”€ lh.final_surfaces.touch
β”‚   β”œβ”€β”€ lh.inflate.H.K.touch
β”‚   β”œβ”€β”€ lh.inflate1.touch
β”‚   β”œβ”€β”€ lh.inflate2.touch
β”‚   β”œβ”€β”€ lh.jacobian_white.touch
β”‚   β”œβ”€β”€ lh.pctsurfcon.touch
β”‚   β”œβ”€β”€ lh.pial_surface.touch
β”‚   β”œβ”€β”€ lh.qsphere.touch
β”‚   β”œβ”€β”€ lh.smoothwm1.touch
β”‚   β”œβ”€β”€ lh.smoothwm2.touch
β”‚   β”œβ”€β”€ lh.sphmorph.touch
β”‚   β”œβ”€β”€ lh.sphreg.touch
β”‚   β”œβ”€β”€ lh.surfvolume.touch
β”‚   β”œβ”€β”€ lh.tessellate.touch
β”‚   β”œβ”€β”€ lh.topofix.touch
β”‚   β”œβ”€β”€ lh.white.H.K.touch
β”‚   β”œβ”€β”€ lh.white_surface.touch
β”‚   β”œβ”€β”€ nu.touch
β”‚   β”œβ”€β”€ relabelhypos.touch
β”‚   β”œβ”€β”€ rh.aparc.touch
β”‚   β”œβ”€β”€ rh.aparc2.touch
β”‚   β”œβ”€β”€ rh.aparcstats.touch
β”‚   β”œβ”€β”€ rh.aparcstats2.touch
β”‚   β”œβ”€β”€ rh.aparcstats3.touch
β”‚   β”œβ”€β”€ rh.avgcurv.touch
β”‚   β”œβ”€β”€ rh.curvstats.touch
β”‚   β”œβ”€β”€ rh.final_surfaces.touch
β”‚   β”œβ”€β”€ rh.inflate.H.K.touch
β”‚   β”œβ”€β”€ rh.inflate1.touch
β”‚   β”œβ”€β”€ rh.inflate2.touch
β”‚   β”œβ”€β”€ rh.jacobian_white.touch
β”‚   β”œβ”€β”€ rh.pctsurfcon.touch
β”‚   β”œβ”€β”€ rh.pial_surface.touch
β”‚   β”œβ”€β”€ rh.qsphere.touch
β”‚   β”œβ”€β”€ rh.smoothwm1.touch
β”‚   β”œβ”€β”€ rh.smoothwm2.touch
β”‚   β”œβ”€β”€ rh.sphmorph.touch
β”‚   β”œβ”€β”€ rh.sphreg.touch
β”‚   β”œβ”€β”€ rh.surfvolume.touch
β”‚   β”œβ”€β”€ rh.tessellate.touch
β”‚   β”œβ”€β”€ rh.topofix.touch
β”‚   β”œβ”€β”€ rh.white.H.K.touch
β”‚   β”œβ”€β”€ rh.white_surface.touch
β”‚   β”œβ”€β”€ rusage.mri_ca_register.dat
β”‚   β”œβ”€β”€ rusage.mri_em_register.dat
β”‚   β”œβ”€β”€ rusage.mris_fix_topology.lh.dat
β”‚   β”œβ”€β”€ rusage.mris_fix_topology.rh.dat
β”‚   β”œβ”€β”€ rusage.mris_inflate.lh.dat
β”‚   β”œβ”€β”€ rusage.mris_inflate.rh.dat
β”‚   β”œβ”€β”€ rusage.mris_register.lh.dat
β”‚   β”œβ”€β”€ rusage.mris_register.rh.dat
β”‚   β”œβ”€β”€ rusage.mris_sphere.lh.dat
β”‚   β”œβ”€β”€ rusage.mris_sphere.rh.dat
β”‚   β”œβ”€β”€ talairach.touch
β”‚   └── wmsegment.touch
└── trash

Could you share the HTML reports created by FMRIPREP? What happens when you run it on the same subject again using the same output folder?

I’ve (temporarily) uploaded the HTML report here: http://beausievers.com/neurostars/sub-sid000198.html

I’m currently reinstalling Docker (to deal with a separate, unrelated issue), and will try running fmriprep again with the same output directory. I’ll reply to this issue after that’s finished (it may take quite some time).

Thanks this was very useful.

I found the error message

/opt/freesurfer/bin/reconbatchjobs: line 81: 19146 Killed exec $JOB >> $LOG 2>&1

It’s possible you are running out of memory.

What is the resolution of your T1s? Did you make sure in the docker settings that it can access enough of your hist system memory?

1 Like

This is difficult to track down and hard to interpret for an out-of-memory errorβ€”thanks for your help.

Docker was set to use 8GB of system RAM. The T1s were .9mm x .938mm x .938mmβ€”the fmriprep manual mentions that this should kick in Freesurfer’s submillimeter reconstruction. Is this an unusually memory-intensive process? And if so, is there an option to turn it off?

Currently you can only turn off FreeSurfer completely. We’ll try to add a flag for turning off the submillimiter pipeline in the next release.

Hi @beau. I’ve submitted a patch to let you turn off sub-millimeter reconstruction using the --no-submm-recon flag: https://github.com/poldracklab/fmriprep/pull/422

If you’re comfortable running from a git branch, could you see if this resolves your issue? (If you’re not sure how, we can walk you through it.)

@ChrisGorgolewski Running FMRIPREP on the same subject using the same output folder does not fix the problem, but results in a different error:

ERROR: there is a pre-existing expert options file and
you have specified an expert options file on the command-line.
If you want to use the file specified on the command-line,
you must run with -xopts-overwrite, or you may edit the 
existing file /root/src/fmriprep/work/workflow_enumerator/sid000080/t1w_preprocessing/Reconstruction/expert.opts (and not use the -expert option).

Standard error:

Return code: 1
Interface ReconAll failed to run. 

@effigies Thanks! This is very helpful. For now I’m going to use --no-freesurfer, but the --nosubmm-recon flag will be useful in the future.

Hi @beau. To fix your expert options issue, delete, in the output directory: freesurfer/sub-sid000080/scripts/expert-options.

The issue is that our autorecon1 step creates an expert options file, which gets copied into the subject directory on the first run. We didn’t account for this step crashing and trying to re-copy it, which FreeSurfer (rightly, most of the time) warns you about.

I’m working on figuring out the best way to handle this behavior. Please feel free to comment at https://github.com/poldracklab/fmriprep/issues/425 as we work through this.