[RESOLVED] Create_study and multiple sessions error

I am getting an error when trying to run the “create_study” command using qunex_container. It is exactly the same error described in this post from June 2021: [RESOLVED] Create_study multiple sessions error

I downloaded today the qunex_container script following the steps described in quick start, so it should be the most current version, correct? Please advise. Thank you.

Commands to download qunex_container

wget --no-check-certificate -r 'https://drive.google.com/uc?export=download&id=1wdWgKvr67yX5J8pVUa6tBGXNAg3fssWs' -O ${HOME}/qunex/qunex_container
chmod 770 ${HOME}/qunex/qunex_container

Commands to run “create_study”

cn2107:~ moana004$ qunex_container create_study --studyfolder=${study_sharedfolder} --container=${HOME}/qunex/qunex_suite-0.93.6.sif

--> QuNex will utilize:

    Scheduled jobs: 1 
cn2107:~ moana004$ --> unsetting the following 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 HCPCIFTIRWDIR MSMBin HCPPIPEDIR_dMRITractFull HCPPIPEDIR_dMRILegacy AutoPtxFolder FSLGPUScripts FSLGPUBinary EDDYCUDADIR USEOCTAVE QUNEXENV CONDADIR MSMBINDIR MSMCONFIGDIR R_LIBS FSL_FIX_CIFTIRW FSFAST_HOME SUBJECTS_DIR MINC_BIN_DIR MNI_DIR MINC_LIB_DIR MNI_DATAPATH FSF_OUTPUT_FORMAT
 
Generated by QuNex 
------------------------------------------------------------------------ 
Version: 0.93.6 
User: moana004 
System: cn2107 
OS: RedHat Linux #1 SMP Tue Jun 28 15:37:28 UTC 2022 
------------------------------------------------------------------------ 
 
        ██████\                  ║      ██\   ██\                        
       ██  __██\                 ║      ███\  ██ |                       
       ██ /  ██ |██\   ██\       ║      ████\ ██ | ██████\ ██\   ██\     
       ██ |  ██ |██ |  ██ |      ║      ██ ██\██ |██  __██\\██\ ██  | 
       ██ |  ██ |██ |  ██ |      ║      ██ \████ |████████ |\████  /     
       ██ ██\██ |██ |  ██ |      ║      ██ |\███ |██   ____|██  ██\      
       \██████ / \██████  |      ║      ██ | \██ |\███████\██  /\██\     
        \___███\  \______/       ║      \__|  \__| \_______\__/  \__|    
            \___|                ║                                       
 
 
                       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.93.6 ........................ 


--- Full QuNex call for command: create_study 

gmri create_study --studyfolder="/home/moanae/shared/project_FM_Gracely" --sessions="None" 

--------------------------------------------------------- 



ERROR in running create_study at gmri:
Incompatible command
Command create_study can not be run on multiple sessions!

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

qunex create_study \
    --studyfolder=/home/moanae/shared/project_FM_Gracely \
    --sessions=None 

Please run `qunex ?create_study` to get help for the failed command.

Hi Estephan,

thanks for reporting this. It seems like a bug squeezed into the latest qunex_container script. I fixed the bug and updated the script, please rerun the script download procedure and test again. Thanks!

Also, we just recently released a new version of the container (0.94.4) we advise you to always use the latest version. For the bug in question the container version should be irrelevant though.

Let me know how it goes and please contact us if you run into any other issues down the line.

Thanks for the reply. It is working now with a caveat. It is able to create the folder structure if it is located within my $HOME folder.

When I tried to create it in a shared folder within the HPC cluster, it complained about it being a “Read-only file system”. However I do have permission to write into that file system. Any ideas why would this be?

cn2107:~ moana004$ ls -d /home/moanae/shared/*
/home/moanae/shared/brain_atlases
/home/moanae/shared/disaster_recovery
/home/moanae/shared/masks
/home/moanae/shared/project_K99_ChrTMDHCP
/home/moanae/shared/thesis_scenes
cn2107:~ moana004$ mkdir /home/moanae/shared/test_folder
cn2107:~ moana004$ ls -d /home/moanae/shared/*
/home/moanae/shared/brain_atlases
/home/moanae/shared/disaster_recovery
/home/moanae/shared/masks
/home/moanae/shared/project_K99_ChrTMDHCP
/home/moanae/shared/test_folder
/home/moanae/shared/thesis_scenes
cn2107:~ moana004$ qunex_container create_study --studyfolder=/home/moanae/shared/study001 --container=${HOME}/qunex/qunex_suite-0.93.6.sif
cn2107:~ moana004$ --> unsetting the following 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 HCPCIFTIRWDIR MSMBin HCPPIPEDIR_dMRITractFull HCPPIPEDIR_dMRILegacy AutoPtxFolder FSLGPUScripts FSLGPUBinary EDDYCUDADIR USEOCTAVE QUNEXENV CONDADIR MSMBINDIR MSMCONFIGDIR R_LIBS FSL_FIX_CIFTIRW FSFAST_HOME SUBJECTS_DIR MINC_BIN_DIR MNI_DIR MINC_LIB_DIR MNI_DATAPATH FSF_OUTPUT_FORMAT
 
Generated by QuNex 
------------------------------------------------------------------------ 
Version: 0.93.6 
User: moana004 
System: cn2107 
OS: RedHat Linux #1 SMP Tue Jun 28 15:37:28 UTC 2022 
------------------------------------------------------------------------ 
 
        ██████\                  ║      ██\   ██\                        
       ██  __██\                 ║      ███\  ██ |                       
       ██ /  ██ |██\   ██\       ║      ████\ ██ | ██████\ ██\   ██\     
       ██ |  ██ |██ |  ██ |      ║      ██ ██\██ |██  __██\\██\ ██  | 
       ██ |  ██ |██ |  ██ |      ║      ██ \████ |████████ |\████  /     
       ██ ██\██ |██ |  ██ |      ║      ██ |\███ |██   ____|██  ██\      
       \██████ / \██████  |      ║      ██ | \██ |\███████\██  /\██\     
        \___███\  \______/       ║      \__|  \__| \_______\__/  \__|    
            \___|                ║                                       
 
 
                       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.93.6 ........................ 


--- Full QuNex call for command: create_study 

gmri create_study --studyfolder="/home/moanae/shared/study001" 

--------------------------------------------------------- 



--------------------==== 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=/home/moanae/shared/study001 

--------------------------------------------------------------
Here's the error as caught by python:

Traceback (most recent call last):
  File "/opt/qunex/python/qx_utilities/gmri", line 507, in <module>
    main()
  File "/opt/qunex/python/qx_utilities/gmri", line 475, in main
    runCommand(comm, opts)
  File "/opt/qunex/python/qx_utilities/gmri", line 317, in runCommand
    _, result, _, _ = gc.runWithLog(gcom.commands[command]['com'], args=args, logfile=logfile)
  File "/opt/qunex/python/qx_utilities/general/core.py", line 529, 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 1 more time]
  File "/opt/env/qunex/lib/python3.7/os.py", line 223, in makedirs
    mkdir(name, mode)
OSError: [Errno 30] Read-only file system: '/home/moanae/shared'

Glad we made some progress. It seems like the system in the container has no access to the folder. To give Singularity access to a folder (with the exception of the home folder) you usually need to bind it, you can do this through the --bind parameter. Try:

qunex_container create_study \
  --studyfolder="/shared/study001" \
  --bind="/home/moanae/shared:/shared" \
  --container="${HOME}/qunex/qunex_suite-0.93.6.sif"

/home/moanae/shared:/shared means that I am binding /home/moanae/shared to /shared. So inside container the folder will be visible as /shared, which is seen in how I set the studyfolder. Let me know if this resolved your issue.

Yes, this did trick! Thank you much.