Fmriprep recon-all finding old files - how to remove

Hello,

I have been attempting to run fmriprep with ICA-AROMA on a dataset. In my first attempt, I ran my same fmriprep command with the added -use-aroma flag. This resulted in an error saying that I was trying to rerun fmriprep on a subject that had already been processed. I thought that the error was obvious - I cleared my working dir w/ rm -r as well as the old fmriprep outputs (they had backups elsewhere). I tried again and ran into the same error at the freesurfer recon-all step:

  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 479, in run
    result = self._run_interface(execute=True)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 585, in _run_interface
    return self._run_command(execute)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 678, in _run_command
    result = self._interface.run(cwd=outdir)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 382, in run
    runtime = self._run_interface(runtime)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 767, in _run_interface
    self.raise_exception(runtime)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 704, in raise_exception
    ).format(**runtime.dictcopy()))
RuntimeError: Command:
recon-all -autorecon1 -i /scratch1/06914/henrymj/uh2_workdir/fmriprep_wf/single_subject_s061_wf/anat_preproc_wf/anat_validate/sub-s061_ses-1_T1w_ras_valid.nii.gz -T2 /scratch1/06914/henrymj/BIDS_scans/sub-s061/ses-2/anat/sub-s061_ses-2_T2w.nii.gz -noskullstrip -hires -openmp 16 -subjid sub-s061 -sd /scratch1/06914/henrymj/BIDS_scans/derivatives/freesurfer -expert /scratch1/06914/henrymj/uh2_workdir/fmriprep_wf/single_subject_s061_wf/anat_preproc_wf/surface_recon_wf/autorecon1/expert.opts
Standard output:
INFO: hi-res volumes are conformed to the min voxel size
ERROR: You are trying to re-run an existing subject with (possibly)
 new input data (-i). If this is truly new input data, you should delete
 the subject folder and re-run, or specify a different subject name.
 If you are just continuing an analysis of an existing subject, then 
 omit all -i flags.
Standard error:
Return code: 1

This indicates that I somehow missed original files in my clearing efforts, or I never fully understood the error. Below is my fmriprep command:

fMRIPrep version: 1.5.4
fMRIPrep command: /usr/local/miniconda/bin/fmriprep /scratch1/06914/henrymj/BIDS_scans /scratch1/06914/henrymj/BIDS_scans/derivatives participant --participant_label sub-s251 --mem-mb 180000 --nthreads 20 --omp-nthreads 16 --ignore sbref -vv -w /scratch1/06914/henrymj/uh2_workdir --fs-license-file /work/06914/henrymj/frontera/fslicense.txt --use-aroma
Date preprocessed: 2020-05-18 19:31:29 -0500

To be totally ran the following commands before attempting to rerun fmriprep:

rm -rf /scratch1/06914/henrymj/BIDS_scans/derivatives/fmriprep
mkdir /scratch1/06914/henrymj/BIDS_scans/derivatives/fmriprep
rm -rf /scratch1/06914/henrymj/uh2_workdir
mkdir /scratch1/06914/henrymj/uh2_workdir

Any guidance/explanations would be greatly appreciated.
Sincerely,
Henry

It might be a problem of FreeSurfer not finding a valid license file (see https://github.com/poldracklab/smriprep/issues/43).

The issue is partly covered in the end of this piece of documentation: https://www.nipreps.org/apps/singularity/#handling-environment-variables

@henrymj did you try clearing your subject’s recon-all isRunning files? They can be found at:

<freesurfer-subjects-dir>/<subject>/scripts/*IsRunning*