Skip to content

Stack overflow error when referencing workflow constant that does not exist #5986

Open
@ajmaurais

Description

@ajmaurais

Bug report

Expected behavior and actual behavior

I attempted to get the default workflow process executor by referencing workflow.executor which I am now aware is not an existent global constant.

Actual behavior: Nonspecific stack overflow error: ERROR ~ Unexpected error [StackOverflowError]

Expected behavior: raise an error with a more helpful error message like ERROR ~ No such variable: workflow.executor

Steps to reproduce the problem

main.nf

#!/usr/bin/env nextflow
nextflow.enable.dsl=2

workflow {
    main:
        println("Printing workflow profile")
        println("Workflow profile is ${workflow.profile}")
        println("Finished printing workflow profile")

        println("Printing workflow executor")
        println("Workflow profile is ${workflow.executor}")
        println("Finished printing workflow executor")
}

Program output

$ nextflow run main.nf

 N E X T F L O W   ~  version 24.10.5

Launching `main.nf` [focused_agnesi] DSL2 - revision: e44878bfec

Printing workflow profile
Workflow profile is standard
Finished printing workflow profile
Printing workflow executor
ERROR ~ Unexpected error [StackOverflowError]

 -- Check '.nextflow.log' file for details

Environment

  • Nextflow version: 24.10.5
  • Java version: openjdk 21.0.6 2025-01-21
  • Operating system: Ubuntu 24.04.2 LTS
  • Bash version: GNU bash, version 5.2.21(1)-release (x86_64-pc-linux-gnu)

nextflow.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions