Skip to content

Fix IllegalArgumentException when process.resourceLabels is a closure#7068

Merged
pditommaso merged 1 commit intomasterfrom
fix-seqera-resource-labels-closure
Apr 24, 2026
Merged

Fix IllegalArgumentException when process.resourceLabels is a closure#7068
pditommaso merged 1 commit intomasterfrom
fix-seqera-resource-labels-closure

Conversation

@pditommaso
Copy link
Copy Markdown
Member

Summary

  • SeqeraExecutor.computeRunResourceLabels (introduced in Honour process.resourceLabels in nf-seqera executor #7048) reads the raw process.resourceLabels value from the session config and passes it to Labels.toStringMap. When the directive is defined dynamically (as a closure), the value is not a Map and execution aborts with IllegalArgumentException: Invalid value for 'resourceLabels' directive - expected a map of key/value pairs, got '..._closure...'.
  • Closure-based resourceLabels typically reference task-scoped bindings (task.process, task.hash, ...) and cannot be meaningfully evaluated at the run level. Skip them at run level with a debug log; per-task resolution via TaskConfig.getResourceLabels continues to resolve the closure with the task binding as before.

Test plan

  • New Spock test should skip run resource labels when process.resourceLabels is a closure fails before the fix and passes after.
  • Existing SeqeraExecutorTest suite still green.
  • Manual run of a pipeline with process { resourceLabels = { [...] } } against the Seqera executor.

Generated with Claude Code

In the nf-seqera executor, computeRunResourceLabels read the raw
process.resourceLabels value from the session config. When the directive
is defined dynamically (as a closure), the value was passed to
Labels.toStringMap which rejected it as a non-Map, aborting execution.

Closure-based resourceLabels typically reference task-scoped bindings
(task.process, task.hash, ...) and cannot be meaningfully evaluated at
the run level. Skip them at run level with a debug log; per-task
resolution via TaskConfig.getResourceLabels continues to resolve the
closure with the task binding as before.

Signed-off-by: Paolo Di Tommaso <paolo@seqera.io>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 23, 2026

Deploy Preview for nextflow-docs-staging ready!

Name Link
🔨 Latest commit b35d771
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/69ea743602ee4e0008b58d39
😎 Deploy Preview https://deploy-preview-7068--nextflow-docs-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pditommaso pditommaso merged commit 944977e into master Apr 24, 2026
24 checks passed
@pditommaso pditommaso deleted the fix-seqera-resource-labels-closure branch April 24, 2026 13:06
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

Successfully merging this pull request may close these issues.

1 participant