Skip to content

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

Open
@FriederikeHanssen

Description

@FriederikeHanssen

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions