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

Invalid error on missing include in nested workflow #1719

Closed
maxbates opened this issue Aug 27, 2020 · 3 comments
Closed

Invalid error on missing include in nested workflow #1719

maxbates opened this issue Aug 27, 2020 · 3 comments
Labels
Milestone

Comments

@maxbates
Copy link

maxbates commented Aug 27, 2020

Bug report

When a process has not been included in a nested workflow, the error message complains that the first process in the workflow has already been used, but says nothing about the missing process or import.

Expected behavior and actual behavior

Expected: An error message that sleeper_2 has not been defined

Actual: Error message that the first process has already been used:

Process sleeper has been already used -- If you need to reuse the same component include it with a different name or include in a different workflow context

In my case, I had not included the required file in a many-process workflow, and it took quite some time to identify the problematic processes. Additionally, it doesn't appear the expression parsing / linking phase is blocking, and the workflow would sometimes begin executing before throwing the error.

Steps to reproduce the problem

main.nf

nextflow.enable.dsl=2

process sleeper {
	exec:
	"""
	sleep 5
	"""
}

workflow nested {
    main:
    	sleeper()
        sleeper_2()      
}

workflow{
    nested()
}

Program output

N E X T F L O W  ~  version 20.07.1
Launching `workflows/master.nf` [happy_liskov] - revision: f673c391b0
Process sleeper has been already used -- If you need to reuse the same component include it with a different name or include in a different workflow context

Environment

  • Nextflow version:20.07.1
  • Java version: 14.0.1
  • Operating system: macOS
  • Bash version: 3.2.57(1)-release
@jeanmanguy
Copy link

Hi, I also have this error with missing include and also when I make a mistake because of copy/pasting/deleting in the input section like such:

input:
tuple path(reference)

I thought I was losing my mind until I saw my mistake because I was sure I didn't use the same process twice.

@pditommaso pditommaso added the bug label Sep 20, 2020
@pditommaso pditommaso changed the title Irrelevant error on missing include in nested workflow Invalid error on missing include in nested workflow Sep 20, 2020
@pditommaso
Copy link
Member

Thanks for reporting this issue. It was quite tricky but I've managed to add a much more sensible message:

Missing process or function with name 'sleeper_2' -- Did you mean 'sleeper' instead?

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

@pditommaso pditommaso added this to the v20.10.0 milestone Sep 20, 2020
@charlotte-west
Copy link

charlotte-west commented Mar 26, 2021

Hey @pditommaso, I've updated nextflow to v20.10.0.5430 and I'm still getting an invalid error similar to @jeanmanguy. When I have this in my main script:

ch_1 = Channel.empty()
ch_2 = Channel.empty()
ch_3 = Channel.empty()

 /*
* MODULE: DESeq2 QC Analysis
 */
DESEQ2_DIFF (
      ch_1,
      ch_2,
      ch_3
)

and inside the DESEQ2_DIFF module I have

input:
    val groups
    tuple val(meta) path (peak_beds)
    tuple val(meta) path (bams)

You can see that the channel input structure is different than expected for the module, but I get the error:

Process 'DESEQ2_DIFF' has been already used -- If you need to reuse the same component include it with a different name or include in a different workflow context

Where I would expect an error about channel structure instead. When I change the expected inputs in DESEQ2_DIFF to

input:
    val groups
    val x
    val y

I no longer get the error, because the channel structure is compatible.

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

No branches or pull requests

4 participants