[JIRA] (JENKINS-37777) Pipeline Config: Unable to assign any non literal to an environment variable

4 views
Skip to first unread message

andrew.bayer@gmail.com (JIRA)

unread,
Aug 29, 2016, 2:42:01 PM8/29/16
to jenkinsc...@googlegroups.com
Andrew Bayer created an issue
 
Jenkins / Bug JENKINS-37777
Pipeline Config: Unable to assign any non literal to an environment variable
Issue Type: Bug Bug
Assignee: Andrew Bayer
Components: pipeline-config-plugin
Created: 2016/Aug/29 6:41 PM
Priority: Major Major
Reporter: Andrew Bayer

Should you try anything like:

environment {
  FOO = blah()
  BAZ = "${blah()}"
}

you will be rewarded with a stacktrace and a sandbox violation.

I think it is expected that the environment should be able to set programmatically, limiting it to literals is too restrictive to make it practical.

org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object (org.jenkinsci.plugins.workflow.cps.CpsClosure2 foo)
	at org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.StaticWhitelist.rejectMethod(StaticWhitelist.java:181)
	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:117)
	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:103)
	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)
	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:16)
	at WorkflowScript.run(WorkflowScript:21)
	at org.jenkinsci.plugin
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

andrew.bayer@gmail.com (JIRA)

unread,
Aug 29, 2016, 2:46:01 PM8/29/16
to jenkinsc...@googlegroups.com

andrew.bayer@gmail.com (JIRA)

unread,
Sep 21, 2016, 12:30:04 PM9/21/16
to jenkinsc...@googlegroups.com
Andrew Bayer resolved as Duplicate
 

Oops, screwed up and created a new issue, but I like the other one more anyway. =)

Change By: Andrew Bayer
Status: Open Resolved
Resolution: Duplicate

bitwiseman@gmail.com (JIRA)

unread,
Oct 22, 2019, 11:24:34 PM10/22/19
to jenkinsc...@googlegroups.com
Liam Newman closed an issue as Duplicate
 

Bulk closing resolved issues.

Change By: Liam Newman
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages