C-PAC run error, no crash log, no errors, only reports missing expected outputs

Summary of what happened:

I’m attempting to run C-PAC on a validated BIDS formatted dataset, containing only minimal data (1x of T1w, bold, sbref, and blip up/down).

I’ve tried it with the default pipeline (that is, specifying no pipeline) and a slightly modified “minimal” version of that with some extra options turned off. In both cases - C-PAC goes through intial stages and the long nipype.workflow INFO process, and reaches this point and stops

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

I used the following command:

cpac --platform singularity -v \
-B /home/naxos2-raid34/logan-data/NeurInsight/outputs:/outputs \
run /home/naxos2-raid34/logan-data/NeurInsight/bids_HCP25/ /home/naxos2-raid34/logan-data/NeurInsight/outputs participant \
--pipeline_file /home/naxos2-raid34/logan-data/NeurInsight/cpac/pipeline_config_minimal.yml

Version:

1.8.6

Environment (Docker, Singularity / Apptainer, custom installation):

I’m using python 3.10 with cpac version 1.8.6 in a singularity container.

> cpac version
Loading \U0001f433 Docker
Loading \u24c8 Singularity
singularity pull --name /home/naxos2-raid34/logan-data/NeurInsight/c-pac:latest.sif docker://fcpindi/c-pac:latest
FATAL:   Image file already exists: "/home/naxos2-raid34/logan-data/NeurInsight/c-pac:latest.sif" - will not overwrite
FATAL:   Image file already exists: "/home/naxos2-raid34/logan-data/NeurInsight/c-pac:latest.sif" - will not overwrite
/home/naxos2-raid34/logan-data/NeurInsight/c-pac:latest.sif
Loading \u24c8 /home/naxos2-raid34/logan-data/NeurInsight/c-pac:latest.sif as "logan (3978)" with these directory bindings:
  local                                       Singularity                                 mode
  ------------------------------------------  ------------------------------------------  ------
  /etc/passwd                                 /etc/passwd                                 ro
  /home/stone-ext4/logan/.cpac                /home/stone-ext4/logan/.cpac                rw
  /home/naxos2-raid34/logan-data/NeurInsight  /home/naxos2-raid34/logan-data/NeurInsight  rw
  /home/naxos2-raid34/logan-                  /home/naxos2-raid34/logan-                  rw
  data/NeurInsight/log                        data/NeurInsight/log
  /home/naxos2-raid34/logan-                  /home/naxos2-raid34/logan-                  rw
  data/NeurInsight/working                    data/NeurInsight/working
  /home/naxos2-raid34/logan-                  /home/naxos2-raid34/logan-                  rw
  data/NeurInsight/outputs                    data/NeurInsight/outputs
Logging messages will refer to the Singularity paths.

cpac (convenience wrapper) version 1.8.6
C-PAC version v1.8.6.dev1 running on Singularity version 1.2.5-1.el7

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

(thanks for edits - hopefully this is what you meant…)

Relevant log outputs (up to 20 lines):

[...]
240227-15:53:46,402 nipype.workflow INFO:
	 Connecting network_centrality...
240227-15:53:49,518 nipype.workflow INFO:
	 Workflow cpac_sub-100307_ses-ses01 settings: ['check', 'execution', 'logging', 'monitoring']
240227-15:53:49,804 nipype.workflow INFO:


Error of subject workflow cpac_sub-100307_ses-ses01

CPAC run error:

    Pipeline configuration: cpac-default-pipeline-NeurInsight
    Subject workflow: cpac_sub-100307_ses-ses01
    Elapsed run time (minutes): 0.10266321897506714
    Timing information saved in /home/naxos2-raid34/logan-data/NeurInsight/outputs/log/cpac_individual_timing_cpac-default-pipeline-NeurInsight.csv
    System time of start:      2024-02-27 15:53:47
    Missing expected outputs:
anat:
- sub-100307*_ses-ses01*_desc-brain*_T1w*
- sub-100307*_ses-ses01*_desc-brain*_mask*
- sub-100307*_ses-ses01*_desc-head*_T1w*
[...]

What follows after this is a further list of the expected outputs it is missing - which of course it is, it never ran any part of the workflow. Concludes with this

- sub-100307*_ses-ses01*_space-T1w*_sbref*

Missing outputs have been logged in /home/naxos2-raid34/logan-data/NeurInsight/outputs/log/pipeline_cpac-default-pipeline-NeurInsight/sub-100307_ses-ses01/sub-100307_ses-ses01_missingOutputs.yml
Tip: Look for "crash-*.txt" files in the log directory
for more information. Usually the chronological first 
crash file is the most informative.                  

It then goes to the next subject and does this again. No crash file is generated, and log files only show config options, etc - nothing useful. Turning on debugging (in pipeline file) does not help - reaches same point and produces the same output there.

The only difference if I use the default pipelines is that the list of missing expected outputs is much longer.

Screenshots / relevant information:


The bids dataset consist of symlinks to files that are located one directory up - these directories are bound when the singularity container starts up.

Is there an obvious mistake I am making? I will say that if I use --pipeline_config anat-only C-PAC will actually start processing things, but fails to find the FSLDIR, despite its location being set in my terminal (and of course being within the container) - so I know what it is kind of suppose to look like when active. Feels like I have missed something essential and simple but I’m at a loss.

Thanks!

Hi, thank you for reaching out! It looks like your data isn’t being loaded properly. Could you send the beginning of the run log, up until the python packages list?

Absolutely, here is the log right up until the list of python packages.

Loading \u24c8 Singularity
singularity pull --name /home/naxos2-raid34/logan-data/NeurInsight/c-pac:latest.sif docker://fcpindi/c-pac:latest
FATAL:   Image file already exists: "/home/naxos2-raid34/logan-data/NeurInsight/c-pac:latest.sif" - will not overwrite
FATAL:   Image file already exists: "/home/naxos2-raid34/logan-data/NeurInsight/c-pac:latest.sif" - will not overwrite
/home/naxos2-raid34/logan-data/NeurInsight/c-pac:latest.sif
Loading \u24c8 /home/naxos2-raid34/logan-data/NeurInsight/c-pac:latest.sif as "logan (3978)" with these directory bindings:
  local                                       Singularity                                 mode
  ------------------------------------------  ------------------------------------------  ------
  /etc/passwd                                 /etc/passwd                                 ro
  /home/stone-ext4/logan/.cpac                /home/stone-ext4/logan/.cpac                rw
  /home/naxos2-raid34/logan-data/NeurInsight  /home/naxos2-raid34/logan-data/NeurInsight  rw
  /home/naxos2-raid34/logan-                  /home/naxos2-raid34/logan-                  rw
  data/NeurInsight/outputs                    data/NeurInsight/outputs
  /home/naxos2-raid34/logan-                  /outputs                                    rw
  data/NeurInsight/outputs
  /home/naxos2-raid34/logan-                  /home/naxos2-raid34/logan-                  ro
  data/NeurInsight/bids_HCP25                 data/NeurInsight/bids_HCP25/
  /home/naxos2-raid34/logan-                  /home/naxos2-raid34/logan-                  rw
  data/NeurInsight/log                        data/NeurInsight/log
  /home/naxos2-raid34/logan-                  /home/naxos2-raid34/logan-                  rw
  data/NeurInsight/working                    data/NeurInsight/working
Logging messages will refer to the Singularity paths.

singularity run -B /etc/passwd:/etc/passwd:ro,/home/stone-ext4/logan/.cpac:/home/stone-ext4/logan/.cpac:rw,/home/naxos2-raid34/logan-data/NeurInsight:/home/naxos2-raid34/logan-data/NeurInsight:rw,/home/naxos2-raid34/logan-data/NeurInsight/outputs:/home/naxos2-raid34/logan-data/NeurInsight/outputs:rw,/home/naxos2-raid34/logan-data/NeurInsight/outputs:/outputs:rw,/home/naxos2-raid34/logan-data/NeurInsight/bids_HCP25:/home/naxos2-raid34/logan-data/NeurInsight/bids_HCP25/:ro,/home/naxos2-raid34/logan-data/NeurInsight/log:/home/naxos2-raid34/logan-data/NeurInsight/log:rw,/home/naxos2-raid34/logan-data/NeurInsight/working:/home/naxos2-raid34/logan-data/NeurInsight/working:rw instance://faux-signal-2510 /home/naxos2-raid34/logan-data/NeurInsight/bids_HCP25/ /home/naxos2-raid34/logan-data/NeurInsight/outputs participant --participant-label 100307 --mem-gb 30

Running BIDS validator
#### Running C-PAC for 100307
Number of participants to run in parallel: 1
Input directory: /home/naxos2-raid34/logan-data/NeurInsight/bids_HCP25
Output directory: /home/naxos2-raid34/logan-data/NeurInsight/outputs/output
Working directory: /home/naxos2-raid34/logan-data/NeurInsight/outputs/working
Log directory: /home/naxos2-raid34/logan-data/NeurInsight/outputs/log
Remove working directory: True
Available memory: 30.0 (GB)
Available threads: 1
Number of threads for ANTs: 1
Parsing /home/naxos2-raid34/logan-data/NeurInsight/bids_HCP25..
Did not receive any parameters for sub-100307/ses-ses01/anat/sub-100307_ses-ses01_run-01_T1w.nii.gz, is this a problem?
Starting participant level processing
Run called with config file /home/naxos2-raid34/logan-data/NeurInsight/outputs/log/pipeline_cpac-default-pipeline/sub-100307_ses-ses01/cpac_pipeline_config_c63327bd_2024-03-05T12-23-54Z.yml
240305-12:23:58,831 nipype.workflow INFO:
	 
    Environment
    ===========
    AFNI: 23.3.09:linux_universal
    ldd: (Ubuntu GLIBC 2.35-0ubuntu3.1) 2.35
    Python: 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:36:39) [GCC 10.4.0]
      Python packages

Great, thank you! I noticed some potential errors in your run script. You’re binding the output directory to the container as /outputs, but in the custom bindings you posted above the run command, the outputs folder is bound with the full path. If you change the run script to contain the full path it will be consistent, i.e. -B /home/naxos2-raid34/logan-data/NeurInsight/outputs:/home/naxos2-raid34/logan-data/NeurInsight/outputs. Also, the extra slash at the end of your BIDS directory may cause problems. If that doesn’t help, please let me know!

Thanks for taking a look - I’ll try and and see where it gets me. I was following the details provided in the pipeline config files:

 # Directory where C-PAC should write out processed data, logs, and crash reports.
    # - If running in a container (Singularity/Docker), you can simply set this to an arbitrary
    #   name like '/outputs', and then map (-B/-v) your desired output directory to that label.
    # - If running outside a container, this should be a full path to a directory.
    path: /outputs

But I guess I misunderstood that. Should I change the path in the pipeline_config, assuming I get it running with a custom (more minimal) pipeline?

No luck, errors are identical when trying to run default pipeline

 cpac --platform singularity -v \                                                                                                                                                                                 (py310) 
      -B /home/naxos2-raid34/logan-data/NeurInsight/outputs:/home/naxos2-raid34/logan-data/NeurInsight/outputs \
      run /home/naxos2-raid34/logan-data/NeurInsight/bids_HCP25 /home/naxos2-raid34/logan-data/NeurInsight/outputs participant \
        --participant-label 100307 --mem-gb 30

Produces

Loading \u24c8 Singularity
singularity pull --name /home/naxos2-raid34/logan-data/NeurInsight/c-pac:latest.sif docker://fcpindi/c-pac:latest
FATAL:   Image file already exists: "/home/naxos2-raid34/logan-data/NeurInsight/c-pac:latest.sif" - will not overwrite
FATAL:   Image file already exists: "/home/naxos2-raid34/logan-data/NeurInsight/c-pac:latest.sif" - will not overwrite
/home/naxos2-raid34/logan-data/NeurInsight/c-pac:latest.sif
Loading \u24c8 /home/naxos2-raid34/logan-data/NeurInsight/c-pac:latest.sif as "logan (3978)" with these directory bindings:
  local                                       Singularity                                 mode
  ------------------------------------------  ------------------------------------------  ------
  /etc/passwd                                 /etc/passwd                                 ro
  /home/stone-ext4/logan/.cpac                /home/stone-ext4/logan/.cpac                rw
  /home/naxos2-raid34/logan-data/NeurInsight  /home/naxos2-raid34/logan-data/NeurInsight  rw
  /home/naxos2-raid34/logan-                  /home/naxos2-raid34/logan-                  rw
  data/NeurInsight/outputs                    data/NeurInsight/outputs
  /home/naxos2-raid34/logan-                  /home/naxos2-raid34/logan-                  ro
  data/NeurInsight/bids_HCP25                 data/NeurInsight/bids_HCP25
  /home/naxos2-raid34/logan-                  /home/naxos2-raid34/logan-                  rw
  data/NeurInsight/log                        data/NeurInsight/log
  /home/naxos2-raid34/logan-                  /home/naxos2-raid34/logan-                  rw
  data/NeurInsight/working                    data/NeurInsight/working
Logging messages will refer to the Singularity paths.

singularity run -B /etc/passwd:/etc/passwd:ro,/home/stone-ext4/logan/.cpac:/home/stone-ext4/logan/.cpac:rw,/home/naxos2-raid34/logan-data/NeurInsight:/home/naxos2-raid34/logan-data/NeurInsight:rw,/home/naxos2-raid34/logan-data/NeurInsight/outputs:/home/naxos2-raid34/logan-data/NeurInsight/outputs:rw,/home/naxos2-raid34/logan-data/NeurInsight/bids_HCP25:/home/naxos2-raid34/logan-data/NeurInsight/bids_HCP25:ro,/home/naxos2-raid34/logan-data/NeurInsight/log:/home/naxos2-raid34/logan-data/NeurInsight/log:rw,/home/naxos2-raid34/logan-data/NeurInsight/working:/home/naxos2-raid34/logan-data/NeurInsight/working:rw instance://ornery-knife-6151 /home/naxos2-raid34/logan-data/NeurInsight/bids_HCP25 /home/naxos2-raid34/logan-data/NeurInsight/outputs participant --participant-label 100307 --mem-gb 30

Running BIDS validator
#### Running C-PAC for 100307
Number of participants to run in parallel: 1
Input directory: /home/naxos2-raid34/logan-data/NeurInsight/bids_HCP25
Output directory: /home/naxos2-raid34/logan-data/NeurInsight/outputs/output
Working directory: /home/naxos2-raid34/logan-data/NeurInsight/outputs/working
Log directory: /home/naxos2-raid34/logan-data/NeurInsight/outputs/log
Remove working directory: True
Available memory: 30.0 (GB)
Available threads: 1
Number of threads for ANTs: 1
Parsing /home/naxos2-raid34/logan-data/NeurInsight/bids_HCP25..
Did not receive any parameters for sub-100307/ses-ses01/anat/sub-100307_ses-ses01_run-01_T1w.nii.gz, is this a problem?
Starting participant level processing
Run called with config file /home/naxos2-raid34/logan-data/NeurInsight/outputs/log/pipeline_cpac-default-pipeline/sub-100307_ses-ses01/cpac_pipeline_config_c63327bd_2024-03-05T15-28-26Z.yml
240305-15:28:30,845 nipype.workflow INFO:
	 
    Environment
    ===========

With same complaints about missing outputs.

I was following the details provided in the pipeline config files

Yeah that’s exactly right, I just wanted to check that there weren’t two paths in the container for output directories, since in the output of your cpac version command the output directory path in the container was the full path.

Since it looks like it’s not a run command / binding issue, there are a few things I would like to check. First, if you run the command with the --save-working-dir flag, is there anything in the workdir? Also, could you attach the cpac-generated data config file? It should be called cpac_data_config_{...} in the /log/pipeline_name/sub_id subdirectory.

Alrighty, bit of a delay, but ran things with working directory flag and I can report that it is totally empty - absolutely nothing in the working directory (and I double checked - it was created at the time I ran the command and matches what was printed to screen saying where the working directory would be).

I did notice some oddities in the data_config file, but maybe thats the expected format? Attached as text file.

The jsons are very minimal here - this project is effectively testing various processing approaches, and at this stage, you could call it piloting. But the TR is there, and the nii headers contain valid voxel resolution information so I expected that not to be a major problem.

cpac_data_config_c63327bd_2024-03-12T16-43-26Z.txt (763 Bytes)

json text copied below, this is the minimal file specified at the top level (thus applying to all subjects).
task-REST_bold.json

{
    "RepetitionTime": 0.72,
    "EchoTime": 0.033,
    "EffectiveEchoSpacing": 0.00058,
    "MagneticFieldStrength": 3.0,
    "TaskName": "REST",
    "Manufacturer": "Siemens",
    "ManufacturerModelName": "Skyra",
    "PhaseEncodingDirection": "i"
}

Thank you for sending that over! It’s interesting that your data config file shows valid paths because it seems like the data isn’t getting pulled in properly. If you run the tree command in the folder containing your data, are there any sym links?

They are in fact symlinks - but I copied things locally, and had the same issue (unless I made another mistake there). I could try converting these symlinks, but I was under the impression that symlinks were ok now (though, seemed there may have been difficulties in the past…).

I’ll see if I can get one subject to work after converting the symlinks, its at least a direction to check.

(I’m jumping in quick since Elizabeth’s out of the office the rest of the week)

There’s no real issue with using symlinks, but cpac doesn’t (yet) automatically bind the real paths.

You should be able to add bindings for wherever the symlinks point (like if /home/naxos2-raid34/logan-data/NeurInsight/bids_HCP25/sub-100307/ses-ses01/anat/sub-100307_ses-ses01_run-01_T1w.nii.gz --> /home/naxos2-raid34/shared-data/bids_HCP25/sub-100307/ses-ses01/anat/sub-100307_ses-ses01_run-01_T1w.nii.gz you can just update your run call to something like

cpac --platform singularity -v \
-B /home/naxos2-raid34/shared-data/bids_HCP25:/home/naxos2-raid34/shared-data/bids_HCP25 \
run /home/naxos2-raid34/logan-data/NeurInsight/bids_HCP25/ /home/naxos2-raid34/logan-data/NeurInsight/outputs participant \
--pipeline_file /home/naxos2-raid34/logan-data/NeurInsight/cpac/pipeline_config_minimal.yml

You don’t need the -B /home/naxos2-raid34/logan-data/NeurInsight/outputs:/outputs since cpac will do that one automatically, but it doesn’t hurt anything to leave it in there.
)

If all the real paths have a common anscestor path, the simplest thing is to just bind that common anscestor. If they’re in different places, you can just bind as many paths as you need.