Skip to content

splitFasta silently outputs no Fasta file #6494

@muffato

Description

@muffato

Hello !

Bug report

One of our Nextflow pipeline produced no output while saying "Pipeline completed successfully" and exiting with code 0. I could trace the issue to splitFasta not outputting an empty channel despite the input Fasta file not being empty.

The way I could reproduce the issue is by not giving enough heap space to Nextflow. splitFasta makes it exit with "ERROR ~ Java heap space" but maybe it corrupts an internal cache or something ? A -resume run will make it believe it's fine and exit with code 0.
This example is slightly different from the one we faced in production because here it doesn't show "Pipeline completed successfully" but the log still says "Execution complete -- Goodbye".

Expected behavior and actual behavior

  1. Memory errors should be reported, not hidden, even in -resume mode.
  2. splitFasta shouldn't pretend it completed if it didn't.

Steps to reproduce the problem

workflow {
    Channel.fromPath(params.path)
    .splitFasta(file:true)
    .view()
}

Run with --path and a Fasta file of your choice. In the tests below, I use https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/907/269/105/GCA_907269105.1_idVolInan1.1/GCA_907269105.1_idVolInan1.1_genomic.fna.gz, which is 294 M.

Program output

With 10 GB heap space, splitFasta outputs all the chunks

$ export NXF_OPTS='-Xms64m -Xmx10240m'
$ nextflow run src/ --path https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/907/269/105/GCA_907269105.1_idVolInan1.1/GCA_907269105.1_idVolInan1.1_genomic.fna.gz
Nextflow 25.04.8 is available - Please consider updating your version to it

 N E X T F L O W   ~  version 25.04.6

Launching `src/main.nf` [sleepy_cantor] DSL2 - revision: ed0cc3113e

/lustre/scratch124/tol/teams/tolit/users/mm49/nextflow/himut/prod/test/work/7a/bd6f607c536969abb14720d3cf40fd/GCA_907269105.1_idVolInan1.1_genomic.1.fna
/lustre/scratch124/tol/teams/tolit/users/mm49/nextflow/himut/prod/test/work/7a/bd6f607c536969abb14720d3cf40fd/GCA_907269105.1_idVolInan1.1_genomic.2.fna
/lustre/scratch124/tol/teams/tolit/users/mm49/nextflow/himut/prod/test/work/7a/bd6f607c536969abb14720d3cf40fd/GCA_907269105.1_idVolInan1.1_genomic.3.fna
/lustre/scratch124/tol/teams/tolit/users/mm49/nextflow/himut/prod/test/work/7a/bd6f607c536969abb14720d3cf40fd/GCA_907269105.1_idVolInan1.1_genomic.4.fna
(...)

$ find work/
work/
work/7a
work/7a/bd6f607c536969abb14720d3cf40fd
work/7a/bd6f607c536969abb14720d3cf40fd/GCA_907269105.1_idVolInan1.1_genomic.51.fna
work/7a/bd6f607c536969abb14720d3cf40fd/GCA_907269105.1_idVolInan1.1_genomic.9.fna
work/7a/bd6f607c536969abb14720d3cf40fd/GCA_907269105.1_idVolInan1.1_genomic.6.fna
work/7a/bd6f607c536969abb14720d3cf40fd/GCA_907269105.1_idVolInan1.1_genomic.40.fna
(...)
work/7a/bd6f607c536969abb14720d3cf40fd/.chunks.GCA_907269105.1_idVolInan1.1_genomic.fna

With 1 GB heap space, it first complains about memory, then (with -resume) doesn't.

$ export NXF_OPTS='-Xms64m -Xmx1024m'
$ nextflow run src/ --path https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/907/269/105/GCA_907269105.1_idVolInan1.1/GCA_907269105.1_idVolInan1.1_genomic.fna.gz
Nextflow 25.04.8 is available - Please consider updating your version to it

 N E X T F L O W   ~  version 25.04.1

Launching `src/main.nf` [sleepy_murdock] DSL2 - revision: ed0cc3113e

ERROR ~ Java heap space

 -- Check '.nextflow.log' file for details

[ERROR 1 Mon 20 Oct 14:13:48 BST 2025]

$ find work/
work/
work/1b
work/1b/43a3561241779334e9783762e666e6
work/1b/43a3561241779334e9783762e666e6/.chunks.GCA_907269105.1_idVolInan1.1_genomic.fna

$ nextflow run src/ --path https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/907/269/105/GCA_907269105.1_idVolInan1.1/GCA_907269105.1_idVolInan1.1_genomic.fna.gz -resume
Nextflow 25.04.8 is available - Please consider updating your version to it

 N E X T F L O W   ~  version 25.04.1

Launching `src/main.nf` [serene_panini] DSL2 - revision: ed0cc3113e

[exit code 0]
$ find work/
work/
work/1b
work/1b/43a3561241779334e9783762e666e6
work/1b/43a3561241779334e9783762e666e6/.chunks.GCA_907269105.1_idVolInan1.1_genomic.fna

The .nextflow.log files for the above three runs are:

And the log from our production run: nextflow.production.log

Environment

  • Nextflow version: 25.04.6 build 5954
  • Java version: [?]Groovy 4.0.26 on OpenJDK 64-Bit Server VM 17.0.15+6-LTS
  • Operating system: Ubuntu 22.04.5 LTS, Linux 5.15.0-141-generic
  • Bash version: GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)

Kind regards,
Matthieu

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions