nextflow-io / nextflow-io/nextflow

Eval outputs not captured if process exits early

Open
#6,315 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

lang/processes software/bash triage/investigate
Dominant language
Groovy
Stars
3.5k
Forks
811
Avg merge
2d 11h
Merged PRs (30d)
61

Description

Bug report

When running a test expression in a process that contains an eval output, I get an error.

Steps to reproduce the problem

The module file that causes the error is available at:
https://github.com/OlivierCoen/nf-chimera-detector/blob/2ed14de596506c016b62b11edb1f47736727d086/modules/local/find_chimeras/main.nf

Here is a test workflow that can reproduce the error.

process FOO {

    input:
    path file

    output:
    eval("ls")


    script:
    """
    [ -s $file ] || exit 0

    echo "I exist"
    """
}

workflow {

    main:

    ch_x = Channel.fromPath( 'myfile.txt' )
    FOO ( ch_x )


}
Program output

If myfile.txt exists and is not empty, I get no error.

Otherwise, I get:
ERROR ~ No such file or directory: <process workdir>/.command.env

Environment
nextflow info

  Version: 25.04.6 build 5954
  Created: 01-07-2025 11:27 UTC (13:27 CEST)
  System: Linux 6.1.0-37-amd64
  Runtime: Groovy 4.0.26 on OpenJDK 64-Bit Server VM 17.0.15-internal+0-adhoc..src
  Encoding: UTF-8 (UTF-8)
  • Bash version: GNU bash, version 5.2.15(1)-release (x86_64-pc-linux-gnu)
    (I get the same with zsh 5.9)

Thanks in advance :)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided FOO workflow with an empty or missing input, then inspect the referenced modules/local/find_chimeras/main.nf example and the process-output handling it exercises. Compare the early-exit path with the successful path, focusing on the missing .command.env error. Done means an eval output is captured without an error when the process exits early.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.