Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improper error message returned with malformed outputs #3835

Closed
BeyondTheProof opened this issue Apr 4, 2023 · 2 comments
Closed

Improper error message returned with malformed outputs #3835

BeyondTheProof opened this issue Apr 4, 2023 · 2 comments

Comments

@BeyondTheProof
Copy link

BeyondTheProof commented Apr 4, 2023

Bug report

Expected behavior and actual behavior

When outputting a malformed tuple (in this case, without commas separating), NF raises cryptic errors such as No such variable: sample and Process 'PRINT_INPUTS' has been already used -- If you need to reuse the same component, include it with a different name or include it in a different workflow context

Steps to reproduce the problem

print_inputs.nf:

nextflow.enable.dsl=2

process PRINT_INPUTS {
    input:
        tuple val(chrom), val(sample)
    output:
        tuple val(chrom), val(sample)

    script:
    """
    echo $chrom
    """
}

main.nf:

nextflow.enable.dsl = 2

include {PRINT_INPUTS} from './modules/print_inputs.nf'

workflow {
    chroms = Channel.from(1..3)
    samples = Channel.from("A", "B")
    input_channels = chroms.combine( samples )
    output = PRINT_INPUTS (input_channels)
}

Program output

...
Apr-04 22:51:12.576 [main] DEBUG nextflow.cli.CmdRun -
  Version: 23.01.0-edge build 5834
  Created: 14-01-2023 17:31 UTC
  System: Linux 5.15.0-1030-gcp
  Runtime: Groovy 3.0.14 on OpenJDK 64-Bit Server VM 17.0.6+10-Ubuntu-0ubuntu120.04.1
  Encoding: UTF-8 (UTF-8)
  Process: 129513@rome-repeat-genetics-jupyter-1 [10.128.0.3]
  CPUs: 16 - Mem: 102.2 GB (78.9 GB) - Swap: 0 (0)
Apr-04 22:51:12.642 [main] DEBUG nextflow.Session - Work-dir: /home/jupyter/work [ext2/ext3]
Apr-04 22:51:12.643 [main] DEBUG nextflow.Session - Script base path does not exist or is not a directory: /home/jupyter/project/new-targets/twas/nf_pipeline/bin
Apr-04 22:51:12.663 [main] DEBUG nextflow.executor.ExecutorFactory - Extension executors providers=[]
Apr-04 22:51:12.686 [main] DEBUG nextflow.Session - Observer factory: DefaultObserverFactory
Apr-04 22:51:12.761 [main] DEBUG nextflow.cache.CacheFactory - Using Nextflow cache factory: nextflow.cache.DefaultCacheFactory
Apr-04 22:51:12.780 [main] DEBUG nextflow.util.CustomThreadPool - Creating default thread pool > poolSize: 17; maxThreads: 1000
Apr-04 22:51:12.881 [main] DEBUG nextflow.Session - Session start
Apr-04 22:51:13.289 [main] DEBUG nextflow.script.ScriptRunner - > Launching execution
Apr-04 22:51:13.763 [main] DEBUG nextflow.Session - Session aborted -- Cause: Unknown variable 'sample'
Apr-04 22:51:13.794 [main] DEBUG nextflow.Session - The following nodes are still active:
  [operator] combine

Apr-04 22:51:13.806 [main] ERROR nextflow.cli.Launcher - @unknown
groovy.lang.MissingPropertyException: Unknown variable 'sample'
...

Environment

  • Nextflow version: 23.01.0-edge build 5834
  • Java version: openjdk version "17.0.6" 2023-01-17
  • Operating system: Linux
  • Bash version: GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)

Additional context

In the test case, I was unable to reproduce the original error I was getting -- Process 'PRINT_INPUTS' has been already used -- If you need to reuse the same component, include it with a different name or include it in a different workflow context. I ran into that error in my own work, which I can't share, but it was caused by a missing comma between outputs in a tuple

@adamrtalbot
Copy link
Collaborator

Slack thread: https://nextflow.slack.com/archives/C02T98A23U7/p1686842054188879

Thanks to Clare Pacini and Alexander Nater for finding this issue. I was able to reproduce this like so:

Steps to reproduce the problem

sneakyerror.nf:

process SNEAKYERROR {

    input:
        tuple val(x) val(y)

    output:
        val z

    exec:
    z = x + y
}

workflow {
    ch_x = Channel.of("x")
    ch_y = Channel.of("y")

    SNEAKYERROR(ch_x, ch_y)
}
nextflow run sneakyerror.nf

Program output

N E X T F L O W  ~  version 23.04.1
Launching `sneakyerror.nf` [wise_cray] DSL2 - revision: 58faa1f628
Process 'SNEAKYERROR' has been already used -- If you need to reuse the same component, include it with a different name or include it in a different workflow context

 -- Check script 'misleading_error.nf' at line: 17 or see '.nextflow.log' file for more details

Environment

  • Nextflow version: 23.04.1
  • Java version: 17.0.7
  • Operating system: Ubuntu 20.04.2 LTS
  • Bash version: zsh 5.9 (x86_64-pc-linux-gnu)

@bentsherman
Copy link
Member

Fixed by #4085

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants