Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Debug & Troubleshoot


Step 1: Identify Which Subjects Failed

Run Post-Run Verification first. Use check-outputs to see which subjects are missing expected output files, and the job database for exit codes and error messages. Once you know which subjects and tasks need attention, come back here to diagnose why.


Step 2: Read the SLURM Logs

SLURM output and error files are in {work_dir}/log/{task_name}/:

{work_dir}/log/{task_name}/{task_name}_{job_id}.out
{work_dir}/log/{task_name}/{task_name}_{job_id}.err

The detailed per-subject execution log (stdout + stderr combined) is written by the wrapper:

# Array jobs
{work_dir}/log/{task_name}/sub-{subject}/{task_name}_{job_id}_{array_task_id}_{timestamp}.log

# Non-array jobs
{work_dir}/log/{task_name}/{task_name}_{job_id}_{timestamp}.log

Step 3: Inspect the Wrapper Script

The generated wrapper script shows exactly what ran on the compute node:

cat /data/work/my_study/log/wrapper/afni_cards_preprocessing_*.sh

Verify:


Step 4: Test the Module Environment

SSH to a compute node (or use srun) and manually load the modules:

srun --pty bash
ml AFNI/24.3.06-foss-2023a
afni_proc.py --help     # should print help if loaded correctly

Step 5: Check Script Line Endings

Windows line endings cause $'\r': command not found errors:

file src/neuro_pipeline/pipeline/scripts/branch/afni_cards_preprocessing.sh
# Should say "POSIX shell script" or "Bourne-Again shell script", NOT "CRLF"

# Fix if needed:
dos2unix src/neuro_pipeline/pipeline/scripts/branch/*.sh

Database Shows Incomplete Records?

If the database is missing jobs (e.g., after a cluster crash), merge the raw JSONL logs manually:

neuropipe merge-logs /data/work/my_study

JSONL event logs in {work_dir}/database/json/ accumulate independently of the SQLite database. Merging re-processes any unarchived files and fills in gaps.

If the JSONL files were already archived by a previous merge and the database is still incomplete (e.g., after restoring from backup), use force-rebuild to create a fresh database from all logs including archived ones:

neuropipe force-rebuild /data/work/my_study
# → writes pipeline_jobs_rebuild_{timestamp}.db next to the original

Quick Diagnosis Checklist


Error Reference

Setup & Configuration

“No subjects found”

“Project configuration not found”

“Task not found” / task name mismatch

GUI won’t start

SLURM & Job Submission

module: command not found in job logs

SLURM Job ID: N/A in database

Jobs are queued but never start

Python Environment

ModuleNotFoundError: No module named 'typer'

Resume & Output Checks

--resume does not skip any subjects

check-outputs reports unexpected failures