Running cpac run: instance not found

Summary of what happened:

Hello,
I am trying to run cpac for the first time to do preprocessing with a custom pipeline_config.yml file, I am using ubuntu without sudo priviliges, and using cpac together with singularity.

When I run cpac run it produces an error related to instance not found.

note that in the command below, /ritter/share/data/HBN/EEG/BIDS/release_1 is a directory that follows BIDS format.
and /home/ammar/git_repos/test_cpac is also the folder where I pulled the singularity image and where I have my pipeline_config.yml file.

finally, please note that running cpac run --help produces the same error, plus some errors because I do not have docker, which can be ommited if I use cpac run --platform singularity --help

I am not sure which parts are relevant, so I tried to provide you with a full picture.
thanks in advance for help, it is much appreciated.

Command used (and if a helper script was used, a link to the helper script or the command generated):

cpac run  /ritter/share/data/HBN/EEG/BIDS/release_1 /home/ammar/cpac_outputs participant --pipeline-file /home/ammar/git_repos/test_cpac/pipeline_config.yml --platform singularity

Version:

cpac version 1.8.6

Environment (Singularity):

running CPAC with cpac, installed cpac using pip install cpac without sudo previliges, and asked the admin to install singularity.

Data formatted according to a validatable standard? Please provide the output of the validator:

PASTE VALIDATOR OUTPUT HERE

Relevant log outputs (up to 20 lines):

Loading Ⓢ Singularity
singularity pull --name /home/ammar/git_repos/test_cpac/c-pac:latest.sif docker://fcpindi/c-pac:latest
/usr/share/modules/init/bash: line 58: export: _moduleraw: not a function
/usr/share/modules/init/bash: line 58: export: _moduleraw: not a function
WARNING: pull for Docker Hub is not guaranteed to produce the
WARNING: same image on repeated pull. Use Singularity Registry
WARNING: (shub://) to pull exactly equivalent images.
ERROR: Image file exists, not overwriting.
/usr/share/modules/init/bash: line 58: export: _moduleraw: not a function
/usr/share/modules/init/bash: line 58: export: _moduleraw: not a function
WARNING: pull for Docker Hub is not guaranteed to produce the
WARNING: same image on repeated pull. Use Singularity Registry
WARNING: (shub://) to pull exactly equivalent images.
ERROR: Image file exists, not overwriting.
/home/ammar/git_repos/test_cpac/c-pac:latest.sif
Loading Ⓢ /home/ammar/git_repos/test_cpac/c-pac:latest.sif as "ammar (3037)" with these directory bindings:
  local                                       Singularity                                 mode
  ------------------------------------------  ------------------------------------------  ------
  /etc/passwd                                 /etc/passwd                                 ro
  /home/ammar/.cpac                           /home/ammar/.cpac                           rw
  /home/ammar/git_repos/test_cpac/pipeline_c  /home/ammar/git_repos/test_cpac/pipeline_c  ro
  onfig.yml                                   onfig.yml
  /home/ammar/git_repos/test_cpac             /home/ammar/git_repos/test_cpac             rw
  /home/ammar/cpac_outputs                    /home/ammar/cpac_outputs                    rw
  /ritter/share/data/HBN/EEG/BIDS/release_1   /ritter/share/data/HBN/EEG/BIDS/release_1   ro
  /home/ammar/git_repos/test_cpac/log         /home/ammar/git_repos/test_cpac/log         rw
  /home/ammar/git_repos/test_cpac/working     /home/ammar/git_repos/test_cpac/working     rw
  /home/ammar/git_repos/test_cpac/outputs     /home/ammar/git_repos/test_cpac/outputs     rw
Logging messages will refer to the Singularity paths.

No instances found.
singularity run -B /etc/passwd:/etc/passwd:ro,/home/ammar/.cpac:/home/ammar/.cpac:rw,/home/ammar/git_repos/test_cpac/pipeline_config.yml:/home/ammar/git_repos/test_cpac/pipeline_config.yml:ro,/home/ammar/git_repos/test_cpac:/home/ammar/git_repos/test_cpac:rw,/home/ammar/cpac_outputs:/home/ammar/cpac_outputs:rw,/ritter/share/data/HBN/EEG/BIDS/release_1:/ritter/share/data/HBN/EEG/BIDS/release_1:ro,/home/ammar/git_repos/test_cpac/log:/home/ammar/git_repos/test_cpac/log:rw,/home/ammar/git_repos/test_cpac/working:/home/ammar/git_repos/test_cpac/working:rw,/home/ammar/git_repos/test_cpac/outputs:/home/ammar/git_repos/test_cpac/outputs:rw instance://expensive-frito-1989 /ritter/share/data/HBN/EEG/BIDS/release_1 /home/ammar/cpac_outputs participant --pipeline-file /home/ammar/git_repos/test_cpac/pipeline_config.yml
ERROR: A daemon process is not running with this name: expensive-frito-1989
ABORT: Aborting with RETVAL=255

Traceback (most recent call last):
  File "/home/ammar/anaconda3/bin/cpac", line 8, in <module>
    sys.exit(run())
  File "/home/ammar/anaconda3/lib/python3.10/site-packages/cpac/__main__.py", line 445, in run
    main(parsed)
  File "/home/ammar/anaconda3/lib/python3.10/site-packages/cpac/__main__.py", line 347, in main
    Backends(**arg_vars).run(flags=args.extra_args, **arg_vars)
  File "/home/ammar/anaconda3/lib/python3.10/site-packages/cpac/backends/singularity.py", line 165, in run
    [
  File "/home/ammar/anaconda3/lib/python3.10/site-packages/cpac/backends/singularity.py", line 165, in <listcomp>
    [
  File "/home/ammar/anaconda3/lib/python3.10/site-packages/cpac/backends/singularity.py", line 149, in _try_to_stream
    for line in self.container:
  File "/home/ammar/anaconda3/lib/python3.10/site-packages/spython/utils/terminal.py", line 155, in stream_command
    raise subprocess.CalledProcessError(return_code, cmd)
subprocess.CalledProcessError: Command '['singularity', 'run', '-B', '/etc/passwd:/etc/passwd:ro,/home/ammar/.cpac:/home/ammar/.cpac:rw,/home/ammar/git_repos/test_cpac/pipeline_config.yml:/home/ammar/git_repos/test_cpac/pipeline_config.yml:ro,/home/ammar/git_repos/test_cpac:/home/ammar/git_repos/test_cpac:rw,/home/ammar/cpac_outputs:/home/ammar/cpac_outputs:rw,/ritter/share/data/HBN/EEG/BIDS/release_1:/ritter/share/data/HBN/EEG/BIDS/release_1:ro,/home/ammar/git_repos/test_cpac/log:/home/ammar/git_repos/test_cpac/log:rw,/home/ammar/git_repos/test_cpac/working:/home/ammar/git_repos/test_cpac/working:rw,/home/ammar/git_repos/test_cpac/outputs:/home/ammar/git_repos/test_cpac/outputs:rw', 'instance://expensive-frito-1989', '/ritter/share/data/HBN/EEG/BIDS/release_1', '/home/ammar/cpac_outputs', 'participant', '--pipeline-file', '/home/ammar/git_repos/test_cpac/pipeline_config.yml']' returned non-zero exit status 255.

Screenshots / relevant information:


Sorry you’re having trouble with cpac. What does

singularity --version

tell you?

thanks for the speedy response!
the output is:
2.6.1-dist

:thinking: Can you check if you’re able to open a container like

singularity shell /home/ammar/git_repos/test_cpac/c-pac:latest.sif

?

Hi, I work in the same group as Ammar (and use the same HPC). Thank you for your help!

Manually running a shell seems to work fine:


singularity shell c-pac:latest.sif
Singularity: Invoking an interactive shell within container...

Singularity c-pac:latest.sif:~>
Singularity c-pac:latest.sif:~> help
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
These shell commands are defined internally.  Type `help' to see this list.
Type `help name' to find out more about the function `name'.
...

Perhaps it is useful to note that when a ‘No instance found’ error occurs and it additionally outputs that
“ERROR: A daemon process is not running with this name: faux-toaster-1197”,

I can use e.g. htop to see that such an instance seems to have been launched:

Okay, thanks for the info. It looks like there’s probably some compatablity issues with the Singularity Python API and Singularity < 3.0, with spython dropping support in version 0.3.0. On our end, we’ll update the documentation for cpac to reflect this drop in supported versions.

Unfortunately for your use case, I think this means you’ll either need to run C-PAC in Singularity without the Python wrapper or upgrade Singularity/Apptainer. Fortunately, running without the wrapper isn’t too bad; you just have to be verbose in which paths need to be accessible in the container.