Alec Wysoker
03/11/2026, 3:45 PMnf-core pipeline create into my baby workflow. I'm getting a stack overflow. I tried debugging using these instructions and I could connect to the process but IntelliJ doesn't stop at my breakpoint. Via many log messages and gradual incorporation of changes, I've narrowed my problem down to the following:
Having
params {
validate_params = true
}
in my nextflow.config. If I comment this line out, problem does not occur. Then, even if I pass --validate_params false on the command line. with setting confirmed by
Other parameters
...
validate_params : false
I've added log messages to subworkflows/nf-core/utils_nfschema_plugin/main.nf
<http://log.info|log.info>("Before validateParameters: validate_params=${validate_params}, parameters_schema=${parameters_schema}")
if(validate_params) {
validateOptions = [:]
if(parameters_schema) {
validateOptions << [parametersSchema: parameters_schema]
}
<http://log.info|log.info>("Before validateParameters")
validateParameters(validateOptions)
<http://log.info|log.info>("After validateParameters")
}
And I get
Before validateParameters: validate_params=false, parameters_schema=null
Before validateParameters
ERROR ~ Unexpected error [StackOverflowError]
So it's weird that despite validate_params being false, the if statement is executed. Log file contains the stack trace, which is lots of
at groovy.json.DefaultJsonGenerator.writeIterator(DefaultJsonGenerator.java:416)
at groovy.json.DefaultJsonGenerator.writeObject(DefaultJsonGenerator.java:206)
at groovy.json.DefaultJsonGenerator.writeObject(DefaultJsonGenerator.java:168)
at groovy.json.DefaultJsonGenerator.writeIterator(DefaultJsonGenerator.java:416)
at groovy.json.DefaultJsonGenerator.writeObject(DefaultJsonGenerator.java:206)
at groovy.json.DefaultJsonGenerator.writeObject(DefaultJsonGenerator.java:168)
at groovy.json.DefaultJsonGenerator.writeIterator(DefaultJsonGenerator.java:416)
Given that nf-schema is a plugin that I guess is downloaded on demand, I don't even see how to debug with log message. Help!mashehu
03/11/2026, 8:07 PMmashehu
03/11/2026, 8:07 PMAlec Wysoker
03/11/2026, 8:12 PM{"plugins":[{"id":"nf-schema","releases":[{"version":"2.6.1"
nf-core 3.5.2mashehu
03/11/2026, 8:14 PMnextflow.config but doesn't matter. could you try with a non-edge version (NXF_EDGE=1 nextflow self-update)Nicolas Vannieuwkerke
03/11/2026, 8:17 PMAlec Wysoker
03/11/2026, 8:25 PMvalidate_params causes --validate_params false to be respected. However if I leave it as the default of true, I still get the stack overflow. And IntelliJ doesn't work to set breakpoints.Nicolas Vannieuwkerke
03/11/2026, 8:27 PMAlec Wysoker
03/11/2026, 8:29 PMnf-core pipelines create has lots of stuff that is not created by nf-core pipelines schema build. I'm going to try including all that gorp and see what happens.mashehu
03/11/2026, 8:33 PMAlec Wysoker
03/12/2026, 6:13 PMpath inputs:
process MAPMYCELLS_FROMSPECIFIEDMARKERS {
label 'process_medium'
label 'mapmycells'
container 'us-docker.pkg.dev/mccarroll-scrna-seq/us.gcr.io/mapmycells:current'
memory '16 GB'
scratch true // use local disk for input files because sqlite is slow over gcsfuse
stageInMode 'copy' // ensure files are copied to local scratch, rather than symlinked
input:
path query_markers_json
path precomputed_stats_h5ad
path dge_h5ad
path gene_mapping
val mmc_args
val analysis_identifier
When I run with the debugger, I can see that the stack overflow is when precomputed_stats_h5ad value is being converted to json. If I change the process definition so that input param is no longer a path, then I get the stack overflow for the next path.
Stack trace:
"main" #1 [4867] prio=5 os_prio=31 cpu=2580.15ms elapsed=143.14s tid=0x000000012c008200 nid=4867 at breakpoint [0x000000016b8d5000]
java.lang.Thread.State: RUNNABLE
at groovy.json.DefaultJsonGenerator.writeIterator(DefaultJsonGenerator.java:408)
at groovy.json.DefaultJsonGenerator.writeObject(DefaultJsonGenerator.java:206)
at groovy.json.DefaultJsonGenerator.writeObject(DefaultJsonGenerator.java:168)
at groovy.json.DefaultJsonGenerator.toJson(DefaultJsonGenerator.java:102)
at groovy.json.JsonOutput.toJson(JsonOutput.java:146)
at nextflow.trace.ResourcesAggregator.renderSummaryJson(ResourcesAggregator.groovy:120)
at nextflow.trace.ReportObserver.renderSummaryJson(ReportObserver.groovy:201)
at nextflow.trace.ReportObserver.renderPayloadJson(ReportObserver.groovy:205)
at nextflow.trace.ReportObserver.renderHtml(ReportObserver.groovy:216)
at nextflow.trace.ReportObserver.onFlowComplete(ReportObserver.groovy:129)
at nextflow.Session$_notifyFlowComplete_lambda38.doCall(Session.groovy:1082)
at nextflow.Session$$Lambda/0x0000000800729a08.accept(Unknown Source)
at nextflow.Session.notifyEvent(Session.groovy:1112)
at nextflow.Session.notifyFlowComplete(Session.groovy:1082)
at nextflow.Session.shutdown0(Session.groovy:779)
at nextflow.Session.abort(Session.groovy:834)
at nextflow.script.ScriptRunner.execute(ScriptRunner.groovy:139)
at nextflow.cli.CmdRun.run(CmdRun.groovy:435)
at nextflow.cli.Launcher.run(Launcher.groovy:515)
at nextflow.cli.Launcher.main(Launcher.groovy:675)Alec Wysoker
03/12/2026, 6:13 PMAlec Wysoker
03/12/2026, 6:22 PMimport groovy.json.JsonOutput;
import java.nio.file.Path;
public class reproduce_bug
{
public static void main(String[] args) {
final Path path = Path.of("/Users/alecw");
System.out.println(JsonOutput.toJson(path));
}
}
That looks like this:
/Users/alecw/.sdkman/candidates/java/21-tem/bin/java -javaagent:/Applications/IntelliJ IDEA 3.app/Contents/lib/idea_rt.jar=49471 -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath /Users/alecw/Documents/work/mccarroll_nextflow/out/production/mccarroll_nextflow:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-cli-commons-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-astbuilder-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-cli-picocli-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-dateutil-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-datetime-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-contracts-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-groovydoc-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-docgenerator-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-ant-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-jmx-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-ginq-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-jsr223-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-json-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-console-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-groovysh-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-macro-library-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-macro-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-sql-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-nio-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-swing-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-typecheckers-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-templates-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-test-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-testng-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-toml-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-test-junit5-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-xml-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-5.0.0.jar:/Users/alecw/Documents/work/mccarroll_nextflow/lib/groovy-servlet-5.0.0.jar:/Users/alecw/.nextflow/framework/26.02.0-edge/nextflow-26.02.0-edge-one.jar reproduce_bug
Exception in thread "main" java.lang.StackOverflowError
at java.base/sun.nio.fs.UnixPath.getNameCount(UnixPath.java:303)
at java.base/java.nio.file.Path$1.next(Path.java:930)
at java.base/java.nio.file.Path$1.next(Path.java:920)
at groovy.json.DefaultJsonGenerator.writeIterator(DefaultJsonGenerator.java:414)
at groovy.json.DefaultJsonGenerator.writeObject(DefaultJsonGenerator.java:206)
<clip>
I believe this is a bug in groovy.json.JsonOutput.toJson(). One work-around would be to convert Paths to Files before converting to json.Alec Wysoker
03/12/2026, 6:24 PMNicolas Vannieuwkerke
03/13/2026, 8:33 AMPath objects for file path validation as these use the extended classes built-in to NextflowNicolas Vannieuwkerke
03/13/2026, 8:34 AMAlec Wysoker
03/13/2026, 11:24 AMnf-core pipelines create. It generates 160 files. I'm a nextflow novice so I don't think I'd be able to prune that down. If ~160 files is considered a small workflow, maybe I could do it.
I'm not suggesting you don't use Path. Rather, I'm suggesting that Paths be converted to strings in nextflow.trace.ResourcesAggregator.renderSummaryJson.
Also, I'm new to groovy. I don't know how to report bugs in the groovy library nor see if a bug has been fixed. It's obviously a groovy library bug,. Is nextflow using the latest groovy library? Maybe it's already been fixed.Nicolas Vannieuwkerke
03/13/2026, 12:13 PMNicolas Vannieuwkerke
03/13/2026, 12:13 PMAlec Wysoker
03/13/2026, 1:52 PMNicolas Vannieuwkerke
03/13/2026, 2:07 PM