nf-core / nf-core/modules

Seqkit_pair unknown recognition error type: groovyjarjarantlr4.v4.runtime.LexerNoViableAltException

Open Beginner friendly
#11,090 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Nextflow
Stars
429
Forks
1.1k
Avg merge
1d 6h
Merged PRs (30d)
153

Description

Have you checked the docs?
Description of the bug

Problem

Pipeline launch produced two identical warnings to stderr:

unknown recognition error type: groovyjarjarantlr4.v4.runtime.LexerNoViableAltException
unknown recognition error type: groovyjarjarantlr4.v4.runtime.LexerNoViableAltException

The warnings were non-fatal — the pipeline ran successfully — but they cluttered output and raised concerns about code correctness.

Location

File: modules/nf-core/seqkit/pair/main.nf, line 33

find . -maxdepth 1 -name "*.fastq" -exec gzip {} \;

Root Cause

The \; sequence sits inside a Groovy triple-double-quoted GString ("""..."""). Groovy's ANTLR4-based lexer only recognizes specific escape sequences in GStrings: \n, \t, \r, \b, \f, \\, \", \', \$, \uXXXX, and octal escapes. The semicolon is not in that set, so \; is an invalid escape sequence.

When the lexer encounters \;, it cannot match any token rule and throws a LexerNoViableAltException. ANTLR4 recovers and continues parsing (which is why the pipeline still runs), but the recovery emits the "unknown recognition error type" warning to stderr.

Two warnings appear because Nextflow parses the config and script files in two passes during startup (profile resolution and script compilation), triggering the same lexer error each time.

This is a known Nextflow/Groovy issue documented in:

Fix

Changed \; to \\; so Groovy interprets the double backslash as a literal backslash character, correctly passing \; to bash at runtime:

- find . -maxdepth 1 -name "*.fastq" -exec gzip {} \;
+ find . -maxdepth 1 -name "*.fastq" -exec gzip {} \\;

This is consistent with all other backslash usages in the pipeline's GString script blocks (e.g., \\t, \\n, \\$), where backslashes intended for bash are always double-escaped.

Command used and terminal output

Relevant files
Image Image
System information

Nextflow Version: 25.04.6
Executor: awsbatch
Seqkit_pair sha: 41dfa3f7c0ffabb96a6a813fe321c6d1cc5b6e46

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

Read modules/nf-core/seqkit/pair/main.nf at line 33 and compare its backslash escaping with the other GString script usages in the module. Verify the module or pipeline launches without the repeated LexerNoViableAltException warnings; the reported fix provides the expected escaped command form.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
75/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.