Summary of what happened:
I am using my university’s HPC to run fMRIprep on BIDS formatted data. I encountered this Read-only file
error that says the path to our lab’s scratch place cannot be found. I looked through many posts but couldn’t figure out why exactly this happened. It could be due to the templateflow, or lack of space. Could I ask your help to go through my code?
Command used (and if a helper script was used, a link to the helper script or the command generated):
# Prepare computing environment
export LABROOT=/lab_scratch_place
export SCRATCH=/personal_scratch_place
export BIDS_DIR=$LABROOT/BIDS/sub-1
export DERIVS_DIR=$BIDS_DIR/derivatives/fmriprep
export WORK_DIR=$BIDS_DIR/fmriprep_work_dir
export TAG="24.1.0rc2"
export FMRIPREP_IMAGE=$LABROOT/apptainer/.apptainer/fmriprep_${TAG}.sif
export TEMPLATEFLOW_HOST_HOME=$SCRATCH/fMRIPrep-example/apptainer/templateflow
export FMRIPREP_HOST_CACHE=$SCRATCH/.cache/fmriprep
export FS_LICENSE=$LABROOT/apptainer/bin/license.txt
export BIDS_FILTER_FILE=./bids_filter_file.json
mkdir -p $DERIVS_DIR
mkdir -p $WORK_DIR
# Prepare apptainer/singularity command line
APPTAINER_CMD="apptainer run --home $HOME --cleanenv -B $BIDS_DIR:/data -B ${TEMPLATEFLOW_HOST_HOME}:/templateflow -B $WORK_DIR:/work -B $FS_LICENSE:/license -B $BIDS_FILTER_FILE:/filter $FMRIPREP_IMAGE"
# Compose subject ID for each array task
SUBJECT="sub-1"
# Compose the command line with flags for fMRIPrep
cmd="$APPTAINER_CMD /data $DERIVS_DIR participant --participant-label $SUBJECT -w /work --nthreads 16 --mem_mb 256000 --output-spaces MNI152NLin2009cAsym:res-2 func --fs-license-file /license --bids-filter-file /filter --skip_bids_validation --verbose"
Version:
24.1.0rc2
Environment (Docker, Singularity / Apptainer, custom installation):
Apptainer
Data formatted according to a validatable standard? Please provide the output of the validator:
PASTE VALIDATOR OUTPUT HERE
Error log (up to 20 lines):
Traceback (most recent call last):
File "/opt/conda/envs/fmriprep/lib/python3.11/pathlib.py", line 1116, in mkdir
os.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '.../sub-1/derivatives/fmriprep/logs'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/conda/envs/fmriprep/lib/python3.11/pathlib.py", line 1116, in mkdir
os.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '.../sub-1/derivatives/fmriprep'
Then I have many iterations of “another exception occurred”, until
File "/opt/conda/envs/fmriprep/lib/python3.11/pathlib.py", line 1116, in mkdir
os.mkdir(self, mode)
OSError: [Errno 30] Read-only file system: '/root_of_lab_scratch'
I would very much appreciate your help!!! Thanks!