owned this note
owned this note
Published
Linked with GitHub
---
title: "DSL2 Common Nextflow 'uninformative' errors & possible solutions"
tags: open-source, nf-core, Nextflow, DSL2, best practices, coding, guidelines, common-errors
---
# Common Nextflow 'unformative' errors & possible solutions
- [James A. Fellows Yates](https://github.com/jfy133)
- [Simon Pearce](https://github.com/sppearce)
- [Friederike Hanssen](https://github.com/FriederikeHanssen)
Despite being very powerful, Nextflow has a slightly 'infamous' habit of giving extremely generic and unclear errors that are difficult to to traceback to what the cause is.
This document is an effort to collect common errors that often trip up developers, and record possible solutions.
## Missing process or function with name 'dump'
### Issue
When using the `.dump()` function you get an error to console
```
Missing process or function with name 'dump'
```
### Possible Error Source
In many cases, the function is not _missing_, just incorrectly applied.
- Missing `tag:` before the actual tag name (e.g. `.dump('my tag') vs .dump(tag: 'my_tag')`)
- Placed on a channel-type that does not support the `.dump` function (e.g. channels with branches)
- `.dump()` was applied on a multi-channel output object without specifying which channel
## Cannot get property 'id' on null object
### Issue
Console
```
Execution aborted due to an unexpected error
-- Check script '/home/jfellows/Documents/git/nf-core/taxprofiler/./workflows/../modules/nf-core/modules/kraken2/kraken2/main.nf' at line: 2 or see '.nextflow.log' file for more details
```
Log
```
java.lang.NullPointerException: Cannot get property 'id' on null object
```
### Possible Error Source
In most cases `meta.id` does exist, it is just not accessible by Nextflow in the way it expects to.
- Input channels not correctly passed to a module
- `meta` tuple is incorrectly nested (e.g. `[[<meta>]]` vs. ``[<meta>]``)
- Other parts of an input channel are incorrectly nested e.g. `[meta] [[reads1.fq, reads2.fq]]` when should be `[meta] [reads1.fq, reads2.fq]`
- Can also occur when `meta.id` tag is specified the `tag` block of a module, but `meta` is not supplied as input.
## Missing process or function with name 'mix'
### Issue
You get the follow error when using `.mix()` on channels
```
Missing process or function with name 'mix'
```
### Possible Error Source
- You passed a multi-channel output variable to `.mix`
- e.g. this will cause the error:
```nextflow
ch_scaffolds2bin_for_dastool
.mix(DASTOOL_SCAFFOLDS2BIN_METABAT2.out.scaffolds2bin)
.mix(DASTOOL_SCAFFOLDS2BIN_MAXBIN2)
```
when you should've specified the specific `.out` channels
```nextflow
ch_scaffolds2bin_for_dastool
.mix(DASTOOL_SCAFFOLDS2BIN_METABAT2.out.scaffolds2bin)
.mix(DASTOOL_SCAFFOLDS2BIN_MAXBIN2.out.scaffolds2bin)
```
## Module compilation error
### Issue
You get the following error, connected to the whole workflow
```
- file : [PATH]
- cause: Unexpected input: '{' @ line N, column N.
- workflow [WORKFLOW] {
```
### Possible Error Source
- You put two `.` next to each other, such as at the end of the first line and the start of the second:
```nextflow
PROCESS.
.out
.bam
.set{ch_bams}
```
## DataVariable can only be assigned once
### Issue
You get the following error, connected to a process
```
Error executing process > 'PROCESS'
Caused by:
A DataflowVariable can only be assigned once. Only re-assignments to an equal value are allowed.
```
### Possible Error Source
You forgot the brackets around a function like `flatten()`:
```nextflow
PROCESS
.out
.vcfs
.flatten
```
## Multi-channel output cannot be applied to operator <x> for which argument is already provided
### Issue
You get an error such as
```
Multi-channel output cannot be applied to operator mix for which argument is already provided
```
### Possible Error Source
You likely forgot to specify the output channel of a multi-channel output module or subworkflow
Where
```
ch_output = MODULE_A ( input )
MODULE_B ( ch_output )
```
Should be
```
ch_output = MODULE_A ( input ).reads
MODULE_B ( ch_output )
```
## Unable to parse config file
### Issue
```
Unable to parse config file: 'nextflow.config'
Compile failed for sources FixedSetSources[name='/groovy/script/Script7452FB2E4729BDF4899A4D4633CAE72A']. Cause: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/groovy/script/Script7452FB2E4729BDF4899A4D4633CAE72A: 432: Unexpected input: '{' @ line 432, column 8.
process{
^
```
### Possible Error Source
Syntax error in `modules.config`, such as:
1. Missing coma in `publishDir`
2. Additional `=` after ext.<> directive
3. Missing `{` or `}`somewhere
Mentioned line numbers OR mentioned sign are not indicative of where to search for the error, i.e. in the above example the actual problem was a duplicated `=`.