Skip to content

Cannot Use params in pod directive, such as k8s.pod, process.pod. #6308

@luyang93

Description

@luyang93

Bug report

Expected behavior and actual behavior

use params in pod directive, such as k8s.pod, process.pod.

Steps to reproduce the problem

There are many places in nextflow.config where you can set up the pod configuration, so we need to discuss it in several different scenarios.

  1. set k8s.pod
    [ label: 'label', value: 'label' ], [ env: 'env', value: 'env' ], [ annotation: 'annotation', value: 'annotation' ],
  • It works well.
  1. set k8s.pod
    [ label: 'label2', value: "${params.label}" ],
  • It throws an error nextflow.exception.ProcessSubmitException: Failed to submit K8s job -- Cause: class org.codehaus.groovy.runtime.GStringImpl cannot be cast to class java.lang.String (org.codehaus.groovy.runtime.GStringImpl is in unnamed module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap')
  1. set k8s.pod
    [ label: 'label', value: 'label' ], [ env: 'env', value: 'env' ], [ annotation: 'annotation', value: 'annotation' ], [ label: 'label2', value: "${params.label}" ],
  • It throws an error nextflow.exception.ProcessSubmitException: Failed to submit K8s job -- Cause: class org.codehaus.groovy.runtime.GStringImpl cannot be cast to class java.lang.String (org.codehaus.groovy.runtime.GStringImpl is in unnamed module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap')
  1. set process.pod
    [ label: 'label', value: 'label' ], [ env: 'env', value: 'env' ], [ annotation: 'annotation', value: 'annotation' ],
  • It works well.
  1. set process.pod
    [ label: 'label2', value: "${params.label}" ],
  • It works well.
  1. set process.pod
    [ label: 'label', value: 'label' ], [ env: 'env', value: 'env' ], [ annotation: 'annotation', value: 'annotation' ], [ label: 'label2', value: "${params.label}" ],
  • It throws an error nextflow.exception.ProcessSubmitException: Failed to submit K8s job -- Cause: class org.codehaus.groovy.runtime.GStringImpl cannot be cast to class java.lang.String (org.codehaus.groovy.runtime.GStringImpl is in unnamed module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap')
  1. set process.name.pod
    pod label: 'label', value: 'label' pod env: 'env', value: 'env' pod annotation: 'annotation', value: 'annotation' pod label: 'label2', value: "${params.label}" pod label: 'label3', value: "${params.label}"
  • It works well.

In conlusion, k8s.pod cannot set params. process.pod can only set one if params is set. process.name.pod works well.

Program output

.nextflow.log

Environment

  • Nextflow version: nextflow/nextflow:25.04.6 docker image
  • Java version: openjdk 21.0.7 2025-04-15 LTS
  • Operating system: Linux
  • Bash version: GNU bash, version 5.2.15(1)-release (x86_64-amazon-linux-gnu)

Additional context

The error is throw from K8sTaskHandler.groovy

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