Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ajmaurais opened this issue Apr 18, 2025 · 1 comment · May be fixed by #5988
Open

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

ajmaurais opened this issue Apr 18, 2025 · 1 comment · May be fixed by #5988
Labels

Comments

@ajmaurais
Copy link

ajmaurais commented Apr 18, 2025

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

@ajmaurais
Copy link
Author

ajmaurais commented Apr 18, 2025

The reason I want to get the default executor is that when I run a workflow under a profile where the default process executor is awsbatch, I need to run a process that adds an API key managed by nextflow's secrets manager to the aws secrets manager or get the name of the secret in the aws secret manager if it already exists. Currently the way we are checking if the aws secret process needs to be run is by checking if the workflow.profile is named aws. Checking if the profile is named aws is not ideal because it is possible to have a profile named something other that aws where the executor is still awsbatch. If there is a way to get the executor at the workflow scope that would be very useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants