Skip to content
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

Usage of secrets in Workflow Script on AWS Batch and Platform #5943

Open
FriederikeHanssen opened this issue Apr 3, 2025 · 1 comment
Open

Comments

@FriederikeHanssen
Copy link

Bug report

  • Calling workflow secrets in the onComplete block does not work locally and on AWS Batch (submitted with Platform)
  • Calling workflow secrets in the workflow body does not appear to work on AWS Batch (submitted with Platform)

Expected behavior and actual behavior

I would like to use secrets as described here in both the workflow and onComplete block.

Steps to reproduce the problem

I created a small example here: https://github.com/FriederikeHanssen/mre/blob/secrets/main.nf

For testing locally:

  1. Set a secret: nextflow secrets set RIKE_SECRET "Hello world"
  2. Run pipeline: (tested with both, version that originally released it and newer version):
    - NXF_VER=24.03.0-edge nextflow run main.nf
    - NXF_VER=24.10.5 nextflow run .

For testing on Platform + AWS Batch

  1. Set up a workspace etc. Define a RIKE_SECRET. Add the pipeline to the launchpad, ensure it is part of the Workflow secrets.
  2. Run pipeline

Program output

Locally:

❯ nextflow run .

 N E X T F L O W   ~  version 24.10.5

Launching `./main.nf` [special_montalcini] DSL2 - revision: d462ac85b4

The secret in Workflow is: Hello world
ERROR ~ Failed to invoke `workflow.onComplete` event handler

 -- Check script 'main.nf' at line: 6 or see '.nextflow.log' file for more details

AWS Batch & platform:

The secret in Workflow is: null

ERROR ~ Failed to invoke `workflow.onComplete` event handler
-- Check script '.nextflow/assets/FriederikeHanssen/mre/main.nf' at line: 6 or see 'nf-1Sc7D9V8WrFVRF.log' file for more details

Environment

  • Nextflow version: 24.10.5 & 24.03.0-edge
  • Java version: [?]
  • Operating system: macOS & AWS Batch
  • Bash version: zsh 5.9 (arm64-apple-darwin24.0)

Additional context

@jpfeuffer
Copy link

jpfeuffer commented Apr 4, 2025

Related to #5312 and the associated community feature request. We are also desperately looking for that functionality.
I think at least the docs should be fixed in the meantime.

Edit: wrong issue number

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

No branches or pull requests

2 participants