fMRI preprocessing

Hello fMRI prep community,
I am new to the fMRI prep pipeline and having an error while running my first participant on the portal.
RuntimeError: Command:
recon-all -autorecon1 -noskullstrip -openmp 3 -subjid sub-AS03 -sd /data/ndas/00012976-norest/derivatives/sourcedata/freesurfer -nomotioncor -notalairach -nonuintensitycor
Standard output:
Subject Stamp: freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1-f53a55a
Current Stamp: freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1-f53a55a
INFO: SUBJECTS_DIR is /data/ndas/00012976-norest/derivatives/sourcedata/freesurfer
Actual FREESURFER_HOME /opt/freesurfer
-rw-rw-r-- 1 ndas ndas 36529 Jan 28 23:38 /data/ndas/00012976-norest/derivatives/sourcedata/freesurfer/sub-AS03/scripts/recon-all.log
Linux node1 3.10.0-1127.8.2.el7.x86_64 #1 SMP Thu May 7 19:30:37 EDT 2020 x86_64 x86_64 x86_64 GNU/Linux

ERROR: it appears that recon-all is already running
for sub-AS03 based on the presence of /data/ndas/00012976-norest/derivatives/sourcedata/freesurfer/sub-AS03/scripts/IsRunning.lh+rh. It could
also be that recon-all was running at one point but
died in an unexpected way. If it is the case that there
is a process running, you can kill it and start over or
just let it run. If the process has died, you should type:

rm /data/ndas/00012976-norest/derivatives/sourcedata/freesurfer/sub-AS03/scripts/IsRunning.lh+rh

and re-run. Or you can add -no-isrunning to the recon-all
command-line. The contents of this file are:

I am not sure how to debug this error.
Any insights from the community will help to understand the error and debug the problem.
Thank you,


Remove all IsRunning Scripts from FreeSurfer outputs. To do this, you can go to your terminal, cd to your Freesurfer output directory, and run rm */scripts/*Running*. Then you can restart fmriprep.


Thank you for your reply. As per your suggestion ran the following cd and rm in the command lines with no resolution

$ cd /data/ndas/00012976-norest/derivatives/sourcedata/freesurfer/

$ rm */scripts/*Running

rm: No match.

I am not sure, how to resolve the problem?

Thank you,

You need the star after Running too.


Thank you for the inputs. However, I tried a different path to analyse the data using fMRI prep, that worked. And now have a different issue. Let me explain a bit about the data structure I have.

  1. Functional data includes both task based FMRI (2 different tasks) and resting state data.
    The thickness of the slice for task based fMRI versus resting state data are different. So, basically for fMRIprep analysis has been approached using the different command lines. For example
    a) iris-fmriprep --config /data/ndas/config/rest.yaml --subject WG11V1 --session V1rest /data/ndas/00025832-rest
    b)iris-fmriprep --config /data/ndas/config/norest.yaml --subject WG11V1 --session V1norest /data/ndas/00025832-norest

Once, I run the above lines one after the other the error as posted before shows up. So, as a solution, I just ran the resting state data using the (a) command line.

Is there a solution to run the (b) command line of fMRIprep simultaneously or should it be run separately once the resting state data analysis is completed?

Any suggestions will help in resolving the issue?

Thank you,

I do not know what iris-fmriprep is, nor do I know the contents of your config file, so I cannot speak to the specifics of that program.

Does this mean you analyzed a different dataset?

Running two instances of fMRIPrep on the same subject will result in race conditions, which will cause errors. However, you should should be able to run all data from a subject with a single fmriprep call.

It would be good to know

  1. what verison of fmriprep you are using (if not the most recent version, 21.0.1, try updating to that)?
  2. are you reusing any pre-computed derivatives/work directory (try using a clean work directory, reusing freesurfer outputs should be fine as long as it is freesurfer version 6)?
  3. are the data bids valid (if not, change them to be valid)?
  4. is the error subject specific?
  5. how much memory / cpu are you devoting to the task?


I am running the fMRI-prep on the work cluster i.e., iris.
For the config folder following are the content

ls config
example.yaml norest.yaml rest.yaml

Thank you,

I do not belong to this work cluster, so I cannot see what is going on under the hood and how the config file is used.