[RESOLVED] Read-only File system error

Hi all,

When running create_study I’m getting a Python OSError and I’m not sure where to go from here. I’ll paste the error below. Thanks for any help!

qunex_container create_study --studyfolder=/autofs/cluster/bang/TAW_New/fMRI_processing/qunex --container=/autofs/space/nihilus_001/users/john/bin/qunex/qunex_suite-0.91.11.sif

→ QuNex will utilize:

Scheduled jobs: 1 

qunex :–> unsetting all environment variables: PATH MATLABPATH PYTHONPATH QUNEXVer TOOLS QUNEXREPO QUNEXPATH QUNEXLIBRARY QUNEXLIBRARYETC TemplateFolder FSL_FIXDIR FREESURFERDIR FREESURFER_HOME FREESURFER_SCHEDULER FreeSurferSchedulerDIR WORKBENCHDIR DCMNIIDIR DICMNIIDIR MATLABDIR MATLABBINDIR OCTAVEDIR OCTAVEPKGDIR OCTAVEBINDIR RDIR HCPWBDIR AFNIDIR PYLIBDIR FSLDIR FSLGPUDIR PALMDIR QUNEXMCOMMAND HCPPIPEDIR CARET7DIR GRADUNWARPDIR HCPPIPEDIR_Templates HCPPIPEDIR_Bin HCPPIPEDIR_Config HCPPIPEDIR_PreFS HCPPIPEDIR_FS HCPPIPEDIR_PostFS HCPPIPEDIR_fMRISurf HCPPIPEDIR_fMRIVol HCPPIPEDIR_tfMRI HCPPIPEDIR_dMRI HCPPIPEDIR_dMRITract HCPPIPEDIR_Global HCPPIPEDIR_tfMRIAnalysis MSMBin HCPPIPEDIR_dMRITractFull HCPPIPEDIR_dMRILegacy AutoPtxFolder FSLGPUScripts FSLGPUBinary EDDYCUDADIR USEOCTAVE QUNEXENV CONDADIR MSMBINDIR MSMCONFIGDIR R_LIBS FSL_FIX_CIFTIRW

Generated by QuNex

Version: 0.91.11
User: jj1006
System: erso.nmr.mgh.harvard.edu
OS: RedHat Linux #1 SMP Tue Jun 8 00:24:50 UTC 2021

    ██████\                  ║      ██\   ██\                        
   ██  __██\                 ║      ███\  ██ |                       
   ██ /  ██ |██\   ██\       ║      ████\ ██ | ██████\ ██\   ██\     
   ██ |  ██ |██ |  ██ |      ║      ██ ██\██ |██  __██\\██\ ██  | 
   ██ |  ██ |██ |  ██ |      ║      ██ \████ |████████ |\████  /     
   ██ ██\██ |██ |  ██ |      ║      ██ |\███ |██   ____|██  ██\      
   \██████ / \██████  |      ║      ██ | \██ |\███████\██  /\██\     
    \___███\  \______/       ║      \__|  \__| \_______\__/  \__|    
        \___|                ║                                       


                   DEVELOPED & MAINTAINED BY: 

                Anticevic Lab, Yale University 
           Mind & Brain Lab, University of Ljubljana 
                 Murray Lab, Yale University 

                  COPYRIGHT & LICENSE NOTICE: 

Use of this software is subject to the terms and conditions defined in
‘LICENSE.md’ which is a part of the QuNex Suite source code package:
https://bitbucket.org/oriadev/qunex/src/master/LICENSE.md

—> Setting up Octave

… Running QuNex v0.91.11 …

==> Note: is part of the QuNex MATLAB.

— Full QuNex call for command: create_study

gmri create_study --studyfolder="/autofs/cluster/bang/TAW_New/fMRI_processing/qunex"


--------------------==== QuNex failed! ====--------------------

ERROR: Execution of command create_study failed!
Please check documentation for the command (qunex ?create_study)!

The call received was:
(please note that when run through scheduler, all possible parameters,
even non relevant ones are passed)

qunex create_study
–studyfolder=/autofs/cluster/bang/TAW_New/fMRI_processing/qunex


Here’s the error as caught by python:

Traceback (most recent call last):
File “/opt/qunex/python/qx_utilities/gmri”, line 502, in
main()
File “/opt/qunex/python/qx_utilities/gmri”, line 470, in main
runCommand(comm, opts)
File “/opt/qunex/python/qx_utilities/gmri”, line 314, in runCommand
_, result, _, _ = gc.runWithLog(gcom.commands[command][‘com’], args=args, logfile=logfile)
File “/opt/qunex/python/qx_utilities/general/core.py”, line 504, in runWithLog
os.makedirs(logfolder)
File “/opt/env/qunex/lib/python3.7/os.py”, line 213, in makedirs
makedirs(head, exist_ok=exist_ok)
File “/opt/env/qunex/lib/python3.7/os.py”, line 213, in makedirs
makedirs(head, exist_ok=exist_ok)
File “/opt/env/qunex/lib/python3.7/os.py”, line 213, in makedirs
makedirs(head, exist_ok=exist_ok)
[Previous line repeated 5 more times]
File “/opt/env/qunex/lib/python3.7/os.py”, line 223, in makedirs
mkdir(name, mode)
OSError: [Errno 30] Read-only file system: ‘/autofs’

Hi, welcome to the QuNex forums!

I believe that the issues is that the system within the container does not have access to the folder you want QuNex to work in. With Singularity you have to explicitly give access to folders that QuNex needs. This can be done through the --bind parameter. You can bind the folder to the same name as on the system outside of the container:

qunex_container create_study \
  --studyfolder=/autofs/cluster/bang/TAW_New/fMRI_processing/qunex \
  --bind=/autofs/cluster/bang/TAW_New/fMRI_processing/qunex \
  --container=/autofs/space/nihilus_001/users/john/bin/qunex/qunex_suite-0.91.11.sif

Or you can rebind/mount a folder to a new name, and make the command more compact. If you do this, you then need to use that name in the QuNex parameters. For example, below I am binding /autofs/cluster/bang/TAW_New/fMRI_processing/qunex => /qx_study. We do this with a colon in the bind parameter, --bind=source_dir:mount_dir. In your case it could be:

qunex_container create_study \
  --studyfolder=/qx_study  \
  --bind=/autofs/cluster/bang/TAW_New/fMRI_processing/qunex:/qx_study \
  --container=/autofs/space/nihilus_001/users/john/bin/qunex/qunex_suite-0.91.11.sif

You can also bind one of the parent folders, e.g. /autofs/cluster/, all the subfolders are automatically given access in that case. Provided that your OS user has access and correct permissions of course.

See [RESOLVED] ERROR: --batchfile flag not found - #2 by demsarjure for some additional details.

Hi, thank you for the response! Bind didn’t directly fix the issue, but if I use the bind parameter like you say and also enter the QuNex container instead of using the qunex_container script then it works fine.

So, if I understand correctly, something like this gives you the an error:

qunex_container create_study \
  --studyfolder="/autofs/cluster/bang/TAW_New/fMRI_processing/qunex" \
  --bind="/autofs/cluster/bang/TAW_New/fMRI_processing/qunex" \
  --container=/autofs/space/nihilus_001/users/john/bin/qunex/qunex_suite-0.91.11.sif

It is probably because I added one folder to many to the bind parameter, the qunex directory is created by the create_study command and probably does not exist before. Sorry for this. I just tested the command below on our system and it worked perfectly (with the same logic, but different paths though):

qunex_container create_study \
  --studyfolder="/autofs/cluster/bang/TAW_New/fMRI_processing/qunex" \
  --bind="/autofs/cluster/bang/TAW_New/fMRI_processing/" \
  --container=/autofs/space/nihilus_001/users/john/bin/qunex/qunex_suite-0.91.11.sif

Ah perfect, this works now. Thanks again! How can I mark this issue resolved?

Glad it worked! Do not worry, I will mark the issue as resolved.