Skip to content

storeDir race condition: parallel chromosome tasks fail with "Missing output file versions.yml" on Google Cloud Batch #481

Description

@ikhrustalev

Setup

  • pgsc_calc: v2.1.0
  • Nextflow: 25.10.4
  • Profile: gcb (Google Cloud Batch)
  • Input: Per-chromosome GT VCF files (22 chromosomes, single sample from 1000 Genomes)
  • Scoring: PGS002209 with --run_ancestry

Samplesheet:

sampleset,path_prefix,chrom,format,vcf_genotype_field
HG00096,/mnt/disks/work-volume/HG00096.chr1,1,vcf,GT
HG00096,/mnt/disks/work-volume/HG00096.chr2,2,vcf,GT
...
HG00096,/mnt/disks/work-volume/HG00096.chr22,22,vcf,GT

Problem

Processes that use storeDir fail with Missing output file(s) versions.yml even though the command completes successfully (exit code 0).

This happens because all 22 chromosome tasks write versions.yml to the same storeDir path concurrently. The data files don't collide (they include chromosome in the filename), but versions.yml is always the same name. On GCS FUSE this causes stale file handles or missing files.

Retries eventually succeed (cached outputs are found in storeDir and tasks are skipped), but this adds 30+ minutes per retry and is non-deterministic.

Errors

ERROR ~ Error executing process > 'PGSCATALOG_PGSCCALC:PGSCCALC:MAKE_COMPATIBLE:PLINK2_VCF (HG00096 chromosome 2)'

Caused by:
  Missing output file(s) `versions.yml` expected by process `PGSCATALOG_PGSCCALC:PGSCCALC:MAKE_COMPATIBLE:PLINK2_VCF (HG00096 chromosome 2)'

Command exit status:
  0
ERROR ~ Error executing process > 'PGSCATALOG_PGSCCALC:PGSCCALC:ANCESTRY_PROJECT:INTERSECT_VARIANTS (HG00096 chromosome 16)'

Caused by:
  Missing output file(s) `versions.yml` expected by process `PGSCATALOG_PGSCCALC:PGSCCALC:ANCESTRY_PROJECT:INTERSECT_VARIANTS (HG00096 chromosome 16)'

Command exit status:
  0

Steps to reproduce

  1. Prepare per-chromosome VCF files for any sample
  2. Run pgsc_calc with -profile gcb on Google Cloud Batch
  3. Pipeline fails at PLINK2_VCF or ancestry modules (INTERSECT_VARIANTS, FILTER_VARIANTS, etc.)
  4. The failing chromosome varies between runs

Affected processes

All modules using storeDir where multiple chromosomes write to the same directory:

  • PLINK2_VCF, PLINK2_RELABELPVAR, PLINK2_RELABELBIM
  • INTERSECT_VARIANTS, FILTER_VARIANTS, EXTRACT_DATABASE
  • RELABEL_IDS, RELABEL_AFREQ
  • FRAPOSA_PCA, FRAPOSA_PROJECT, PLINK2_MAKEBED, INTERSECT_THINNED, PLINK2_ORIENT

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinguser-queryUser queries & requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions