nextflow
nextflow copied to clipboard
Calling groupTuple triggers java.lang.NullPointerException
Bug report
Under certain conditions calling groupTuple
appears to trigger a null pointer exception. A MRE is linked below. The process to trigger the null pointer exception in this MRE can be summarised as:
- run process ONE and TWO
- create a new channel named
ch_three_input
from ONE and TWO outputs - run process THREE with input from
ch_three_input
- take process THREE output and combine with
ch_three_input
usinggroupTuple
The final step that involves the groupTuple
call triggers the exception. I don't think I'm using channels in an unintended way, so I suspect this behaviour is a bug.
Expected behavior and actual behavior
Calling groupTuple
for process THREE output and ch_three_input
should return a valid channel but instead causes a null pointer exception.
Steps to reproduce the problem
Please see the MRE here.
Program output
Error message produced in console:
Cannot invoke method add() on null object
Error message produced in .nextflow.log
:
java.lang.NullPointerException: Cannot invoke method add() on null object
See the attached .nextflow.log file for more details.
Environment
- Nextflow version 22.04.0 build 5697
- openjdk 11.0.9.1 2020-11-04 LTS
- macOS Catalina 10.15.7 (19H1824)
- GNU bash, version 5.1.16(1)-release (x86_64-apple-darwin19.6.0)
Also reproduced on Ubuntu, please see above linked GH repository containing MRE.
This might be a lighter reproducible example:
workflow {
ch_1 = Channel.of([1, '1a', '1b', '1c'], [2, '2a', '2b', '2c'])
ch_2 = Channel.of([1, '1c', '1d'], [2, '2e', '2h'])
ch_1 | mix(ch_2) | groupTuple | view
}
This example also conveniently provides a way to make the bug disappear:
workflow {
ch_1 = Channel.of([1, '1a', '1b', '1c'], [2, '2a', '2b', '2c'])
ch_2 = Channel.of([1, '1c', '1d'], [2, '2e', '2h'])
ch_1 | mix(ch_2) | groupTuple() | view
ch_1 | mix(ch_2)
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Thanks @robsyme for including a testing example. Fixed by 1d32e2c2.