-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Refusing to marshal org.codehaus.groovy.runtime.GStringImpl for security reasons; #311
Comments
Happy New Year to the template engine Team. Is there something missing in my description? The Bug is still a problem for me. Is there a reason why it is not assigned. |
We Installed the new Plugin Version 2.5.3 and restarted the jenkins server. The job is still crashing. The callstack dump is 100% the same as stated above. No Line has changed. |
Sorry, the comment before is false. The job is still crashing at the same place but the callstack is different. Please see the attached dump file 2.5.3versionDump.txt `[Pipeline] End of Pipeline ---- Debugging information ---- |
Sounds like there are deeper structural problems with either this plugin or your attempted usage of it (or both). |
Do you have an Idea what could be the structural root cause? The Job is breaking in an Lifecycle Hooks |
Sorry, no idea, I am not a maintainer and have little knowledge of this plugin. |
I reduced the error to a docker.image call and replaced it with shell commands. And now the pipeline works fine. When running the following code:
The pipline creates the Dump: 2.5.3versionDump.txt When i change the line
to
The pipeline works fine and dose not throw an exception. Do you have an explanation for this workaround? |
Clearly the Line 51 in f73cae4
That said, as an original author of Anyway, based on the error here, another workaround might be to run the |
Do I understand correctly: docker.image().inside() should not be used in the Jenkins Templating Engine script The reason for that is the mentioned Line: Is the Jenkins Templating Engine dead? |
no, it's not. @jglick contributed #312 which was released in version 2.5.3 can you please try upgrading to see if this resolves your issue? |
Jenkins Version
CloudBees CI Client Controller 2.375.1.1-rolling
JTE Version
2.5.2
Bug Description
I am migrating form Jenkins Templating Engine 1.x to 2.5.2. I have made the necessary code changes. All global variables where now accessed using the "globals" object. In our Test Jenkins I am testing the migrated sources.
During a Complex pipeline the Job terminates with the exception:
hudson.remoting.ProxyException: java.lang.UnsupportedOperationException: Refusing to marshal org.codehaus.groovy.runtime.GStringImpl for security reasons; see https://www.jenkins.io/redirect/class-filter/
The complete log starting with the problematic Parts where the exception is thrown you can find in the Relevant log output below.
The library source that is executed in the moment of the exception is a during a @BeforeStep. But a similar error was thrown during a normal Step. A similar Issue was already raised: #207. I tried the mentioned "Text".toString() workaround with no success.
The exception occurs in the following beforeStep() function. "trace 1" is written in the output "trace 2" not. This is the function in progress:
Code starts here: --------------------------------------
`@BeforeStep
void beforeStep() {
println """
+++
called library: $hookContext.library, function: $hookContext.step
+++
"""
if (hookContext.step.equals("check_pr") || hookContext.library.equals("git_scm")) { //vars not set
println """do nothing because: hookContext.step.equals("check_pr") || hookContext.library.equals("git_scm")
+++
return library: $hookContext.library, function: $hookContext.step
+++
"""
return
}
println "trace 1"
env.stepFailed = "false".toString()
println "trace 2"
//TODO: move to initialize
env.githubInit = (env.githubInit) ? true : false
println """
+++
return library: $hookContext.library, function: $hookContext.step
+++
"""
}`
Code ends here: --------------------------------------
(The conde annotation dose not work correctly)
Do you have an clue(glue) to fix this.
Thanks for your support
Martin
Relevant log output
Steps to Reproduce
I only have my complex test system. I have no small code fragment to reproduce it.
The text was updated successfully, but these errors were encountered: