fMRIprep JSON error

I am using fMRIprep singularity image on HPC.
It was running just fine before, but it stopped working after installing R and AFNI on HPC. (I am just guessing it has to do with installing them cause it was working before :frowning: )
I am getting the error below.
I tried running with different datasets, and it was the same.
Does anyone have any idea?
Thank you.


/usr/local/miniconda/lib/python3.7/site-packages/bids/layout/ UserWarning: The ability to pass arguments to BIDSLayout that control indexing is likely to be removed in future; possibly as early as PyBIDS 0.14. This includes the config_filename, ignore, force_index, and index_metadata arguments. The recommended usage pattern is to initialize a new BIDSLayoutIndexer with these arguments, and pass it to the BIDSLayout via the indexer argument.
warnings.warn("The ability to pass arguments to BIDSLayout that control "
Traceback (most recent call last):
File “/usr/local/miniconda/lib/python3.7/site-packages/bids/layout/”, line 280, in _index_metadata
payload = json.load(handle)
File “/usr/local/miniconda/lib/python3.7/json/”, line 296, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File “/usr/local/miniconda/lib/python3.7/json/”, line 348, in loads
return _default_decoder.decode(s)
File “/usr/local/miniconda/lib/python3.7/json/”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/local/miniconda/lib/python3.7/json/”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 2 (char 1)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/usr/local/miniconda/bin/fmriprep”, line 10, in
File “/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/cli/”, line 17, in main
File “/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/cli/”, line 592, in parse_args
File “/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/”, line 612, in from_dict
File “/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/”, line 218, in load
File “/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/”, line 448, in init
File “/usr/local/miniconda/lib/python3.7/site-packages/bids/layout/”, line 155, in init
File “/usr/local/miniconda/lib/python3.7/site-packages/bids/layout/”, line 111, in call
File “/usr/local/miniconda/lib/python3.7/site-packages/bids/layout/”, line 284, in _index_metadata
raise IOError(msg) from e
OSError: Error occurred while trying to decode JSON from file ‘/home/orkdir/BIDS_tutorial/fmriprep_wf/single_subject_01_wf/func_preproc_task_bart_run_01_wf/bold_confounds_wf/acc_masks/_0x65a9610e76f6bf056d6d6ae849e9f08d.json’.


Hi, a few things that can help us help you,

  1. What version fMRIPrep are you using? Based on the PyBIDS warning, it looks like it is not the most current version (21.0.0), try updating.
  2. Are you reusing any previous results (same work directory, previous freesurfer results. etc). Sometimes just trying a new work directory can help, especially since this error is based off of a JSON file in the work directory.
  3. What command are you using to run fMRIPrep? If you are concerned about your local installations messing with fMRIPrep, you can run singularity with the -e flag to clear the Singularity environment (that is, not bring local installations to the container environment).
  4. Is your dataset BIDS valid?

Hope we can get to the bottom of this,

Hi @Steven,
Thank you for the help.
I have managed to solve the problem.
I am not sure about the logic behinds it, but once I deleted the mriqc results from the derivates folder, it started working again.
As you suggested, reusing the same directory may have caused the problem.
Thank you a lot:)