jenkinsci / jenkinsci/script-security-plugin

[JENKINS-55001] Sandboxed System Groovy Scripts don't support multiple assignments (with Tuples)

Open
#822 1 comment 0 reactions 0 assignees View on GitHub
component:script-security-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
76
Forks
181
Avg merge
14h 55m
Merged PRs (30d)
3

Description

Use case

A sandoxed system script doesn't support multiple assignments (with Tuples):

def (a, b) = [1,2]

println a

Returns:

ERROR: Build step failed with exception 

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during canonicalization: not supporting tuples yet


  • This is working in non sandboxed mode, but not in sandboxed mode.

  • Reproduced on the latest OSS LTS (2.138.3), with Groovy Plugin version 2.0 and Script Security Plugin version 1.49.

workaround

Do not use multiple assignments.

Note

It is supported in a Pipeline (as of workflow-cps 2.46, JENKINS-45575). It also works in non sandboxed mode.

---
Originally reported by pierrebtz, imported from: Sandboxed System Groovy Scripts don't support multiple assignments (with Tuples)


  • status: Open
  • priority: Major
  • component(s): script-security-plugin
  • resolution: Unresolved
  • votes: 3
  • watchers: 5
  • imported: 2025-12-09

Raw content of original issue

Use case

A sandoxed system script doesn't support multiple assignments (with Tuples):


def (a, b) = [1,2]

println a

Returns:


ERROR: Build step failed with exception 

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during canonicalization: not supporting tuples yet


  • This is working in non sandboxed mode, but not in sandboxed mode.

  • Reproduced on the latest OSS LTS (2.138.3), with Groovy Plugin version 2.0 and Script Security Plugin version 1.49.

workaround

Do not use multiple assignments.

Note

It is supported in a Pipeline (as of workflow-cps 2.46, JENKINS-45575). It also works in non sandboxed mode.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.