Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-44873

UnsupportedOperationException - Refusing to marshal org.codehaus.groovy.runtime.GStringImpl

    XMLWordPrintable

Details

    • Bug
    • Status: Reopened (View Workflow)
    • Major
    • Resolution: Unresolved
    • artifactory-plugin
    • Jenkins v2.46.3
      Artifactory Plugin v2.11.0
      Pipeline v2.5
      Pipeline API v2.17
      Jenkins Master: Ubuntu 16.04.2 LTS

    Description

      After calling maven.run in the Artifactory Plugin, following Stack Trace appears.

      Since i didnt found any, Artifactory calls in the Stacktrace, my idea was that this could be a general Jenkins Problem, or my Pipeline script is broken. Either way, there should be a better Error Description.

      Pipeline:

      class MyArtifactory implements Serializable{
      
          def server
          def buildInfo
          def maven
      
          MyArtifactory(artifactory){
              this.server = artifactory.server('Artifactory')
              this.buildInfo = artifactory.newBuildInfo()
              this.maven = artifactory.newMavenBuild()
              
              this.maven.tool = 'Maven'
              this.maven.resolver server: server, releaseRepo: 'libs-release',       snapshotRepo: 'libs-snapshot'
              this.maven.deployer server: server, releaseRepo: 'libs-release-local', snapshotRepo: 'libs-snapshot-local', evenIfUnstable: false
          }
      
          def runMaven(inGoals, inOptions=""){
              this.maven.opts = inOptions
              this.maven.run pom: 'pom.xml', goals: inGoals, buildInfo: this.buildInfo
          }
      
          def publishBuildInfo(){
              this.server.publishBuildInfo this.buildInfo
          }
      }
      
      
      node('master'){
      
          def artifactory = new MyArtifactory(Artifactory);
          stage("Pack Artifact"){
              stash name: "ServerDeploy", excludes:"ci/**", includes: "Server.jar,SampleData.xml,*.bat,Configuration/**,Interfaces/**"
              artifactory.runMaven('install', '-Dfile=target/ServerDeploy.zip');
          }
      
      }
      

      Stacktrace:

      java.lang.UnsupportedOperationException: Refusing to marshal org.codehaus.groovy.runtime.GStringImpl for security reasons
      at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:445)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
      at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
      at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:79)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
      at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
      at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
      Caused: java.lang.RuntimeException: Failed to serialize groovy.lang.Binding#variables for class groovy.lang.Binding
      at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
      at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
      at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
      at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
      at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
      at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:250)
      at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:226)
      at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.<init>(AbstractReflectionConverter.java:189)
      at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:135)
      at com.thoughtworks.xstream.converters.reflection.SerializableConverter.marshalUnserializableParent(SerializableConverter.java:292)
      at com.thoughtworks.xstream.converters.reflection.SerializableConverter.doMarshal(SerializableConverter.java:246)
      at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:83)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
      at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
      at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
      Caused: java.lang.RuntimeException: Failed to serialize org.jfrog.hudson.pipeline.types.MavenBuild#cpsScript for class org.jfrog.hudson.pipeline.types.MavenBuild
      at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
      at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
      at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
      at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
      at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
      at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
      at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:79)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
      at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
      at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
      Caused: java.lang.RuntimeException: Failed to serialize org.jenkinsci.plugins.workflow.cps.actions.ArgumentsActionImpl#arguments for class org.jenkinsci.plugins.workflow.cps.actions.ArgumentsActionImpl
      at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
      at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
      at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
      at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
      at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
      at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
      at com.thoughtworks.xstream.converters.collections.ArrayConverter.marshal(ArrayConverter.java:45)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
      at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
      at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
      Caused: java.lang.RuntimeException: Failed to serialize org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage$Tag#actions for class org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage$Tag
      at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
      at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
      at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
      at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
      at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
      at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)
      at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
      at com.thoughtworks.xstream.XStream.marshal(XStream.java:1026)
      at com.thoughtworks.xstream.XStream.marshal(XStream.java:1015)
      at com.thoughtworks.xstream.XStream.toXML(XStream.java:988)
      at hudson.XmlFile.write(XmlFile.java:170)
      at org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage.saveActions(SimpleXStreamFlowNodeStorage.java:111)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$TimingFlowNodeStorage.saveActions(CpsFlowExecution.java:1491)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.saveActions(CpsFlowExecution.java:1012)
      at org.jenkinsci.plugins.workflow.graph.FlowNode.save(FlowNode.java:380)
      at org.jenkinsci.plugins.workflow.graph.FlowNode.persistSafe(FlowNode.java:386)
      at org.jenkinsci.plugins.workflow.graph.FlowNode.access$100(FlowNode.java:61)
      at org.jenkinsci.plugins.workflow.graph.FlowNode$1.add(FlowNode.java:346)
      at org.jenkinsci.plugins.workflow.graph.FlowNode$1.add(FlowNode.java:336)
      at java.util.AbstractList.add(AbstractList.java:108)
      at hudson.model.Actionable.addAction(Actionable.java:152)
      at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:910)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1221)
      at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:407)
      at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:35)
      at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
      at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:748)
      

      Attachments

        Issue Links

          Activity

            raynig Simon Schneider created issue -
            raynig Simon Schneider made changes -
            Field Original Value New Value
            Description After calling maven.run in the Artifactory Plugin, following Stack Trace appears.

            Since i didnt found any, Artifactory calls in the Stacktrace, my idea was that this could be a general Jenkins Problem, or my Pipeline script is broken. Either way, there should be a better Error Description.

            Pipeline:
            {code:java}
            class MyArtifactory implements Serializable{

                def server
                def buildInfo
                def maven

                MyArtifactory(artifactory){
                    this.server = artifactory.server('Artifactory')
                    this.buildInfo = artifactory.newBuildInfo()
                    this.maven = artifactory.newMavenBuild()
                    
                    this.maven.tool = 'Maven'
                    this.maven.resolver server: server, releaseRepo: 'libs-release',       snapshotRepo: 'libs-snapshot'
                    this.maven.deployer server: server, releaseRepo: 'libs-release-local', snapshotRepo: 'libs-snapshot-local', evenIfUnstable: false
                }

                def runMaven(inGoals, inOptions=""){
                    this.maven.opts = inOptions
                    this.maven.run pom: 'pom.xml', goals: inGoals, buildInfo: this.buildInfo
                }

                def publishBuildInfo(){
                    this.server.publishBuildInfo this.buildInfo
                }
            }


            node('master'){

                def artifactory = new MyArtifactory(Artifactory);
                stage("Pack Artifact"){
                    stash name: "ServerDeploy", excludes:"ci/**", includes: "Server.jar,SampleData.xml,*.bat,Configuration/**,Interfaces/**"
                    artifactory.runMaven('install', '-Dfile=target/ServerDeploy.zip');
                }

            }
            {code}


            Stacktrace:
            java.lang.UnsupportedOperationException: Refusing to marshal org.codehaus.groovy.runtime.GStringImpl for security reasons
            at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:445)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
            at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
            at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:79)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
            at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
            at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
            Caused: java.lang.RuntimeException: Failed to serialize groovy.lang.Binding#variables for class groovy.lang.Binding
            at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
            at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
            at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
            at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
            at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
            at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:250)
            at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:226)
            at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.<init>(AbstractReflectionConverter.java:189)
            at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:135)
            at com.thoughtworks.xstream.converters.reflection.SerializableConverter.marshalUnserializableParent(SerializableConverter.java:292)
            at com.thoughtworks.xstream.converters.reflection.SerializableConverter.doMarshal(SerializableConverter.java:246)
            at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:83)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
            at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
            at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
            Caused: java.lang.RuntimeException: Failed to serialize org.jfrog.hudson.pipeline.types.MavenBuild#cpsScript for class org.jfrog.hudson.pipeline.types.MavenBuild
            at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
            at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
            at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
            at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
            at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
            at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
            at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:79)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
            at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
            at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
            Caused: java.lang.RuntimeException: Failed to serialize org.jenkinsci.plugins.workflow.cps.actions.ArgumentsActionImpl#arguments for class org.jenkinsci.plugins.workflow.cps.actions.ArgumentsActionImpl
            at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
            at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
            at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
            at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
            at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
            at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
            at com.thoughtworks.xstream.converters.collections.ArrayConverter.marshal(ArrayConverter.java:45)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
            at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
            at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
            Caused: java.lang.RuntimeException: Failed to serialize org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage$Tag#actions for class org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage$Tag
            at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
            at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
            at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
            at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
            at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
            at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)
            at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
            at com.thoughtworks.xstream.XStream.marshal(XStream.java:1026)
            at com.thoughtworks.xstream.XStream.marshal(XStream.java:1015)
            at com.thoughtworks.xstream.XStream.toXML(XStream.java:988)
            at hudson.XmlFile.write(XmlFile.java:170)
            at org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage.saveActions(SimpleXStreamFlowNodeStorage.java:111)
            at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$TimingFlowNodeStorage.saveActions(CpsFlowExecution.java:1491)
            at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.saveActions(CpsFlowExecution.java:1012)
            at org.jenkinsci.plugins.workflow.graph.FlowNode.save(FlowNode.java:380)
            at org.jenkinsci.plugins.workflow.graph.FlowNode.persistSafe(FlowNode.java:386)
            at org.jenkinsci.plugins.workflow.graph.FlowNode.access$100(FlowNode.java:61)
            at org.jenkinsci.plugins.workflow.graph.FlowNode$1.add(FlowNode.java:346)
            at org.jenkinsci.plugins.workflow.graph.FlowNode$1.add(FlowNode.java:336)
            at java.util.AbstractList.add(AbstractList.java:108)
            at hudson.model.Actionable.addAction(Actionable.java:152)
            at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:910)
            at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1221)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:407)
            at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:35)
            at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
            at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:748)
            After calling maven.run in the Artifactory Plugin, following Stack Trace appears.

            Since i didnt found any, Artifactory calls in the Stacktrace, my idea was that this could be a general Jenkins Problem, or my Pipeline script is broken. Either way, there should be a better Error Description.

            Pipeline:
            {code:java}
            class MyArtifactory implements Serializable{

                def server
                def buildInfo
                def maven

                MyArtifactory(artifactory){
                    this.server = artifactory.server('Artifactory')
                    this.buildInfo = artifactory.newBuildInfo()
                    this.maven = artifactory.newMavenBuild()
                    
                    this.maven.tool = 'Maven'
                    this.maven.resolver server: server, releaseRepo: 'libs-release',       snapshotRepo: 'libs-snapshot'
                    this.maven.deployer server: server, releaseRepo: 'libs-release-local', snapshotRepo: 'libs-snapshot-local', evenIfUnstable: false
                }

                def runMaven(inGoals, inOptions=""){
                    this.maven.opts = inOptions
                    this.maven.run pom: 'pom.xml', goals: inGoals, buildInfo: this.buildInfo
                }

                def publishBuildInfo(){
                    this.server.publishBuildInfo this.buildInfo
                }
            }


            node('master'){

                def artifactory = new MyArtifactory(Artifactory);
                stage("Pack Artifact"){
                    stash name: "ServerDeploy", excludes:"ci/**", includes: "Server.jar,SampleData.xml,*.bat,Configuration/**,Interfaces/**"
                    artifactory.runMaven('install', '-Dfile=target/ServerDeploy.zip');
                }

            }
            {code}
            Stacktrace:
            {code:java}
            java.lang.UnsupportedOperationException: Refusing to marshal org.codehaus.groovy.runtime.GStringImpl for security reasons
            at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:445)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
            at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
            at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:79)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
            at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
            at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
            Caused: java.lang.RuntimeException: Failed to serialize groovy.lang.Binding#variables for class groovy.lang.Binding
            at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
            at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
            at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
            at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
            at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
            at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:250)
            at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:226)
            at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.<init>(AbstractReflectionConverter.java:189)
            at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:135)
            at com.thoughtworks.xstream.converters.reflection.SerializableConverter.marshalUnserializableParent(SerializableConverter.java:292)
            at com.thoughtworks.xstream.converters.reflection.SerializableConverter.doMarshal(SerializableConverter.java:246)
            at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:83)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
            at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
            at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
            Caused: java.lang.RuntimeException: Failed to serialize org.jfrog.hudson.pipeline.types.MavenBuild#cpsScript for class org.jfrog.hudson.pipeline.types.MavenBuild
            at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
            at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
            at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
            at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
            at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
            at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
            at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:79)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
            at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
            at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
            Caused: java.lang.RuntimeException: Failed to serialize org.jenkinsci.plugins.workflow.cps.actions.ArgumentsActionImpl#arguments for class org.jenkinsci.plugins.workflow.cps.actions.ArgumentsActionImpl
            at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
            at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
            at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
            at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
            at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
            at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
            at com.thoughtworks.xstream.converters.collections.ArrayConverter.marshal(ArrayConverter.java:45)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
            at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
            at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
            Caused: java.lang.RuntimeException: Failed to serialize org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage$Tag#actions for class org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage$Tag
            at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
            at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
            at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
            at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
            at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
            at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)
            at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
            at com.thoughtworks.xstream.XStream.marshal(XStream.java:1026)
            at com.thoughtworks.xstream.XStream.marshal(XStream.java:1015)
            at com.thoughtworks.xstream.XStream.toXML(XStream.java:988)
            at hudson.XmlFile.write(XmlFile.java:170)
            at org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage.saveActions(SimpleXStreamFlowNodeStorage.java:111)
            at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$TimingFlowNodeStorage.saveActions(CpsFlowExecution.java:1491)
            at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.saveActions(CpsFlowExecution.java:1012)
            at org.jenkinsci.plugins.workflow.graph.FlowNode.save(FlowNode.java:380)
            at org.jenkinsci.plugins.workflow.graph.FlowNode.persistSafe(FlowNode.java:386)
            at org.jenkinsci.plugins.workflow.graph.FlowNode.access$100(FlowNode.java:61)
            at org.jenkinsci.plugins.workflow.graph.FlowNode$1.add(FlowNode.java:346)
            at org.jenkinsci.plugins.workflow.graph.FlowNode$1.add(FlowNode.java:336)
            at java.util.AbstractList.add(AbstractList.java:108)
            at hudson.model.Actionable.addAction(Actionable.java:152)
            at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:910)
            at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1221)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:407)
            at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:35)
            at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
            at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:748)
            {code}
            raynig Simon Schneider made changes -
            Rank Ranked higher

            Jenkins 2.65 here and I have the same problem.

            gildor Sylvain Le Gall added a comment - Jenkins 2.65 here and I have the same problem.

            I assume you are running this code snippet through a Pipeline job. Does these examples work for you?

            https://github.com/JFrogDev/project-examples/tree/master/jenkins-pipeline-examples

            I'm asking so that we can understand what section of your code causes this exception.

            eyalbe Eyal Ben Moshe added a comment - I assume you are running this code snippet through a Pipeline job. Does these examples work for you? https://github.com/JFrogDev/project-examples/tree/master/jenkins-pipeline-examples I'm asking so that we can understand what section of your code causes this exception.
            gildor Sylvain Le Gall added a comment - - edited

            In my case:

            • I use this in a Pipeline job
            • I use a generic repository
            • The upload method works correctly

            If I comment the "download" method, everything works.

             

            My own snippet:

             

            def artifactory = Artifactory.server(artifactoryId)
            def buildInfo = Artifactory.newBuildInfo()
            buildInfo.retention maxBuilds: 10, deleteBuildArtifacts: true
            stage('local-dependencies')
               // TODO: re-enable when https://issues.jenkins-ci.org/browse/JENKINS-44873 is solved
                downloadSpec = """{
                "file": [
                 {
                   "pattern": "${artifactoryRepo}/github.com/gildor478/user/user-latest.zip",
                   "target": "user-latest.zip",
                 }
                ]
                }"""
                artifactoryDownload spec:downloadSpec, server: artifactory // This one fails.
            }
            stage('archive') {
                dir("src/${pkg}") {
                  sh "git archive -o ${localZip} --prefix=${pkg}/ HEAD"
                  sh "cp ${localZip} ${localLatestZip}"
                  def uploadSpec = """{
                    "files": [
                       {
                         "pattern": "${localZip}",
                         "target": "${artifactoryRepo}/${remoteDir}"
                       },
                       {
                         "pattern": "${localLatestZip}",}}
                         "target": "${artifactoryRepo}/${remoteDir}"??
                       },
                       {
                         "pattern": "junit-report.xml",
                         "target": "${artifactoryRepo}/${remoteDir}/junit-report-${version}.xml"
                       }
                      ]
                      }"""
                      artifactory.upload(uploadSpec, buildInfo)
                      artifactory.publishBuildInfo(buildInfo)
                    }
                  }
               }
            

             

             

            gildor Sylvain Le Gall added a comment - - edited In my case: I use this in a Pipeline job I use a generic repository The upload method works correctly If I comment the "download" method, everything works.   My own snippet:   def artifactory = Artifactory.server(artifactoryId) def buildInfo = Artifactory.newBuildInfo() buildInfo.retention maxBuilds: 10, deleteBuildArtifacts: true stage( 'local-dependencies' )   // TODO: re-enable when https://issues.jenkins-ci.org/browse/JENKINS-44873 is solved    downloadSpec = """{     "file" : [     {     "pattern" : "${artifactoryRepo}/github.com/gildor478/user/user-latest.zip" ,     "target" : "user-latest.zip" ,     }    ]    }"""    artifactoryDownload spec:downloadSpec, server: artifactory // This one fails. } stage( 'archive' ) {    dir( "src/${pkg}" ) {      sh "git archive -o ${localZip} --prefix=${pkg}/ HEAD"      sh "cp ${localZip} ${localLatestZip}"      def uploadSpec = """{         "files" : [           {             "pattern" : "${localZip}" ,             "target" : "${artifactoryRepo}/${remoteDir}"           },           {             "pattern" : "${localLatestZip}" ,}}           "target" : "${artifactoryRepo}/${remoteDir}" ??           },           {             "pattern" : "junit-report.xml" ,             "target" : "${artifactoryRepo}/${remoteDir}/junit-report-${version}.xml"           }          ]          }"""          artifactory.upload(uploadSpec, buildInfo)          artifactory.publishBuildInfo(buildInfo) } }   }    

            Hey eyalbe,

            I tested the examples, the worked.
            In my case, i moved the MyArtifactory Class to a pipeline library.

            I`ll check the examples again, in the next few days, with executing them in a pipeline lib.

            raynig Simon Schneider added a comment - Hey eyalbe , I tested the examples, the worked. In my case, i moved the MyArtifactory Class to a pipeline library. I`ll check the examples again, in the next few days, with executing them in a pipeline lib.
            jglick Jesse Glick added a comment -

            Sounds like you installed some plugins from the experimental update center with known bugs, then neglected to update them to release versions.

            jglick Jesse Glick added a comment - Sounds like you installed some plugins from the experimental update center with known bugs, then neglected to update them to release versions.
            jglick Jesse Glick made changes -
            Link This issue duplicates JENKINS-43934 [ JENKINS-43934 ]
            jglick Jesse Glick made changes -
            Resolution Duplicate [ 3 ]
            Status Open [ 1 ] Resolved [ 5 ]

            I suddenly started experiencing this problem too;

            [Pipeline] getArtifactoryServer

            [Pipeline] newBuildInfo

            [Pipeline] End of Pipeline

            java.lang.UnsupportedOperationException: Refusing to marshal org.codehaus.groovy.runtime.GStringImpl for security reasons

            at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:452)

            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)

            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)

            ...

            Everything was working fine until we updated the git plugin, which seemed to update various other things. Now we see this error. This is some sort of regression which has completely crippled our automations.

             

            I even installed a fresh lts jenkins master (2.60.1) chose the recommended list of plugins and only installed the artifactory plug in on top of that and am seeing the same problem. Please fix ASAP.

             

             

            hossaiy yacoub hossain added a comment - I suddenly started experiencing this problem too; [Pipeline] getArtifactoryServer [Pipeline] newBuildInfo [Pipeline] End of Pipeline java.lang.UnsupportedOperationException: Refusing to marshal org.codehaus.groovy.runtime.GStringImpl for security reasons at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:452) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) ... Everything was working fine until we updated the git plugin, which seemed to update various other things. Now we see this error. This is some sort of regression which has completely crippled our automations.   I even installed a fresh lts jenkins master (2.60.1) chose the recommended list of plugins and only installed the artifactory plug in on top of that and am seeing the same problem. Please fix ASAP.    

            eyalbe, interestingly if i isolate and run each of the individual stages of my script they work fine, only when trying to the entire script does it fail, seemingly during artifactory upload stage, although it's complaining about serialization stuff. Can you give me some sort of work-around to get my automations back up and running?

            hossaiy yacoub hossain added a comment - eyalbe , interestingly if i isolate and run each of the individual stages of my script they work fine, only when trying to the entire script does it fail, seemingly during artifactory upload stage, although it's complaining about serialization stuff. Can you give me some sort of work-around to get my automations back up and running?
            ajay_singh_jenkins Ajay Singh added a comment -

            eyalbe, jglick

            I am experiencing same behaviour as mentioned by Yacoub.

            Just to ensure that I don't have any badplug-ins, I setup a new jenkins and all the recommended (latest stable) plug-ins but it is still giving below exception during Artifactory upload.

            java.lang.UnsupportedOperationException: Refusing to marshal org.codehaus.groovy.runtime.GStringImpl for security reasons
            at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:452)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
            at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
            at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(A
             

            ajay_singh_jenkins Ajay Singh added a comment - eyalbe , jglick I am experiencing same behaviour as mentioned by Yacoub. Just to ensure that I don't have any badplug-ins, I setup a new jenkins and all the recommended (latest stable) plug-ins but it is still giving below exception during Artifactory upload. java.lang.UnsupportedOperationException: Refusing to marshal org.codehaus.groovy.runtime.GStringImpl for security reasons at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:452) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88) at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(A  

            I really don't think that I have a bad plugin installed. I don't even know that I can use experimental plugins.

             

            I still have the problem and I think other people are reporting the problem too. 

            gildor Sylvain Le Gall added a comment - I really don't think that I have a bad plugin installed. I don't even know that I can use experimental plugins.   I still have the problem and I think other people are reporting the problem too. 
            gildor Sylvain Le Gall made changes -
            Resolution Duplicate [ 3 ]
            Status Resolved [ 5 ] Reopened [ 4 ]

            Since the issue does not reproduce for us, can you please help us pinpoint the issue by creating the simplest possible Pipeline example that reproduces this exception?

            Also, does downgrading the Artifactory Plugin to version 2.10 resolves the issue? We'd like to know if the change that caused comes with the Artifactory Plugin or a different plugin.

            eyalbe Eyal Ben Moshe added a comment - Since the issue does not reproduce for us, can you please help us pinpoint the issue by creating the simplest possible Pipeline example that reproduces this exception? Also, does downgrading the Artifactory Plugin to version 2.10 resolves the issue? We'd like to know if the change that caused comes with the Artifactory Plugin or a different plugin.

            eyalb , I will upload an example later today, it may be my entire script though, strangely, trying to isolate the problem, makes the bug dissappear.
            Also when I first noticed the issue my artifactory plug in was at version 2.10. Later tried version 2.11, but it didnt help. I think what seemed to trigger it for me was when I updated the git plugin, but im so confused now im not sure about anything else changed.

            hossaiy yacoub hossain added a comment - eyalb , I will upload an example later today, it may be my entire script though, strangely, trying to isolate the problem, makes the bug dissappear. Also when I first noticed the issue my artifactory plug in was at version 2.10. Later tried version 2.11, but it didnt help. I think what seemed to trigger it for me was when I updated the git plugin, but im so confused now im not sure about anything else changed.

            Managed to cut it down this time, here is my snippet;

             

            #!groovy
            def stagingRepo = "team-mpg-components-nuget/"
            def localRepoPath=""
            def rfminmDest = "\\\\beaver.autodesk.com\\ENGOPS_BUILDS\\Inventor\\3rdParties
            ASM_Full"
            pipeline {
                agent {
                    label configuration.take(1)
                }
                stages {
                    stage("Download nupkgen tool") {
                        steps {
                            script {
                                dir('./restricted') {
                                    //Download the nupkgen.exe into the current directory
                                    server = Artifactory.server 'ART'
                                    def downloadSpec =
                                            """{
                                        "files":
                                        [
                                            {
                                                "pattern": "team-mpg-components-nuget/yacz-files/tools/",
                                                "target" : "{1}",
                                                "flat" : "true"
                                            }
                                        ]
                                    }"""
                                    server.download(downloadSpec)
                                }
                            }
                        }
                    }
                    
                    stage("Archive ASM Artifacts") {
                        steps {
                            script {
                                //set staging subdir name
                                stagingSubDir = "asm/$label"
                                dir('./restricted') {
                                    server = Artifactory.server 'ART'
                                    //def buildInfo = Artifactory.newBuildInfo()
                                    //buildInfo.env.capture = true
                                    def uploadSpec = """{
                                        "files": [
                                            {
                                              "pattern": "(*.nupkg)",
                                              "target": "$stagingRepo$stagingSubDir/{1}"
                                            }
                                         ]
                                        }"""
                                    server.upload(uploadSpec)
                                }
                            }
                        }
                    }
                }
            }

             

            server.upload(uploadSpec) seems to be where it trips up.

            hossaiy yacoub hossain added a comment - Managed to cut it down this time, here is my snippet;   #!groovy def stagingRepo = "team-mpg-components-nuget/" def localRepoPath="" def rfminmDest = "\\\\beaver.autodesk.com\\ENGOPS_BUILDS\\Inventor\\3rdParties ASM_Full" pipeline {     agent {         label configuration.take(1)     }     stages {         stage("Download nupkgen tool") {             steps {                 script {                     dir('./restricted') {                         //Download the nupkgen.exe into the current directory                         server = Artifactory.server 'ART'                         def downloadSpec =                                 """{                             "files":                             [                                 {                                     "pattern": "team-mpg-components-nuget/yacz-files/tools/ ",                                     "target" : "{1}",                                     "flat" : "true"                                 }                             ]                         }"""                         server.download(downloadSpec)                     }                 }             }         }                  stage("Archive ASM Artifacts") {             steps {                 script {                     //set staging subdir name                     stagingSubDir = "asm/$label"                     dir('./restricted') {                         server = Artifactory.server 'ART'                         //def buildInfo = Artifactory.newBuildInfo()                         //buildInfo.env.capture = true                         def uploadSpec = """{                             "files": [                                 {                                   "pattern": "(*.nupkg)",                                   "target": "$stagingRepo$stagingSubDir/{1}"                                 }                              ]                             }"""                         server.upload(uploadSpec)                     }                 }             }         }     } }   server.upload(uploadSpec) seems to be where it trips up.

            hossaiy - thank you for this.

            I managed to reproduce the issue using your example (after installing the "Pipeline Model Definition Plugin"). I could only reproduce this exception using Declarative Pipeline (https://jenkins.io/blog/2016/12/19/declarative-pipeline-beta/).

            That's probably why we couldn't reproduce this issue using the Artifactory Pipeline Examples (which use Scripted Pipeline). We've actually never tested the Artifactory API with Declarative Pipeline.

            jglick, can you please help us with this? What do we need to change/add to the code to support this?

            The code of the upload and download methods is in the: org.jfrog.hudson.pipeline.types.ArtifactoryServer class, in the Artifactory Plugin code base:

            https://github.com/JFrogDev/jenkins-artifactory-plugin

            eyalbe Eyal Ben Moshe added a comment - hossaiy - thank you for this. I managed to reproduce the issue using your example (after installing the "Pipeline Model Definition Plugin"). I could only reproduce this exception using Declarative Pipeline ( https://jenkins.io/blog/2016/12/19/declarative-pipeline-beta/). That's probably why we couldn't reproduce this issue using the Artifactory Pipeline Examples (which use Scripted Pipeline). We've actually never tested the Artifactory API with Declarative Pipeline. jglick , can you please help us with this? What do we need to change/add to the code to support this? The code of the upload and download methods is in the: org.jfrog.hudson.pipeline.types.ArtifactoryServer class, in the Artifactory Plugin code base: https://github.com/JFrogDev/jenkins-artifactory-plugin
            mvk Max Kovgan added a comment - - edited

            eyalbe, I understand you believe the issue is coming up only with "Declarative Pipeline". I am experiencing this problem in "Scripted Pipeline", I have Pipeline Model Definition plugin installed too.

            The file being uploaded is pretty big. not as fat VM image big, but it's ~ 4.2GB big.

            This is the code:

            // shortens each stage. shows how to use closures
            def toggleable_stage(def name, Closure body) {
                stage(name) {
                    boolean stage_run = true
                    if (params.containsKey(name)) {
                        stage_run = params."${name}"
                    }
                    if (stage_run) {
                        echo "executing: ${name}"
                        body()
                    } else {
                        echo "skipping: ${name}"
                    }
                }
            }
            
            node() {
            wrappers() {
                           toggleable_stage 'DEPLOY', {
                                echo "Creating uploadSpecDataFiles"
                                def uploadSpecDataFiles = [
                                    [
                                        pattern: "${targetDir}/${installerName}",
                                        target : "deployment-install-media/${VERSION}/"
                                    ] as HashMap,
                                    [
                                        pattern: "${targetDir}/${installerName}.${checkSum}",
                                        target : "deployment-install-media/${VERSION}/"
                                    ] as HashMap,
                                ] as ArrayList
            
                                def uploadSpecData = [:]
                                uploadSpecData << [
                                    files: uploadSpecDataFiles
                                ] as HashMap
                                echo "Converting uploadSpecData to JSON"
                                def uploadSpec = toJSON(uploadSpecData)
                                def artifactoryData = [:]
                                artifactoryData << [
                                    url          : ARTIFACTORY.url,
                                    credentialsId: credentials.rt
                                ]
                                echo "Setting up artifactory service instance"
                                def artifactoryServer = Artifactory.newServer(artifactoryData)
                                def buildInfo = artifactoryServer.upload(uploadSpec)
                                echo "Publishing build info in artifactory"
                                artifactoryServer.publishBuildInfo(buildInfo)
                            }
                }
                //
                }
            }
            

             
            Here comes the log again:

            13:07:11 Setting up artifactory service instance
            [Pipeline] newArtifactoryServer
            [Pipeline] End of Pipeline
            java.lang.UnsupportedOperationException: Refusing to marshal org.codehaus.groovy.runtime.GStringImpl for security reasons
            	at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:452)
            	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
            	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
            	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
            	at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:79)
            	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
            	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
            	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
            	at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:79)
            	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
            	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
            	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
            	at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:79)
            	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
            	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
            	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
            Caused: java.lang.RuntimeException: Failed to serialize groovy.lang.Binding#variables for class groovy.lang.Binding
            	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
            	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
            	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
            	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
            	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
            	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
            	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:250)
            	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:226)
            	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.<init>(AbstractReflectionConverter.java:189)
            	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:135)
            	at com.thoughtworks.xstream.converters.reflection.SerializableConverter.marshalUnserializableParent(SerializableConverter.java:292)
            	at com.thoughtworks.xstream.converters.reflection.SerializableConverter.doMarshal(SerializableConverter.java:246)
            	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:83)
            	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
            	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
            	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
            Caused: java.lang.RuntimeException: Failed to serialize org.jfrog.hudson.pipeline.types.ArtifactoryServer#cpsScript for class org.jfrog.hudson.pipeline.types.ArtifactoryServer
            	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
            	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
            	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
            	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
            	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
            	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
            	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
            	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
            	at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:79)
            	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
            	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
            	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
            Caused: java.lang.RuntimeException: Failed to serialize org.jenkinsci.plugins.workflow.cps.actions.ArgumentsActionImpl#arguments for class org.jenkinsci.plugins.workflow.cps.actions.ArgumentsActionImpl
            	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
            	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
            	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
            	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
            	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
            	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
            	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
            	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
            	at com.thoughtworks.xstream.converters.collections.ArrayConverter.marshal(ArrayConverter.java:45)
            	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
            	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
            	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
            Caused: java.lang.RuntimeException: Failed to serialize org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage$Tag#actions for class org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage$Tag
            	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
            	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
            	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
            	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
            	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
            	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
            	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
            	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
            	at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)
            	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
            	at com.thoughtworks.xstream.XStream.marshal(XStream.java:1026)
            	at com.thoughtworks.xstream.XStream.marshal(XStream.java:1015)
            	at com.thoughtworks.xstream.XStream.toXML(XStream.java:988)
            	at hudson.XmlFile.write(XmlFile.java:171)
            	at org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage.saveActions(SimpleXStreamFlowNodeStorage.java:111)
            	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$TimingFlowNodeStorage.saveActions(CpsFlowExecution.java:1491)
            	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.saveActions(CpsFlowExecution.java:1012)
            	at org.jenkinsci.plugins.workflow.graph.FlowNode.save(FlowNode.java:380)
            	at org.jenkinsci.plugins.workflow.graph.FlowNode.persistSafe(FlowNode.java:386)
            	at org.jenkinsci.plugins.workflow.graph.FlowNode.access$100(FlowNode.java:61)
            	at org.jenkinsci.plugins.workflow.graph.FlowNode$1.add(FlowNode.java:346)
            	at org.jenkinsci.plugins.workflow.graph.FlowNode$1.add(FlowNode.java:336)
            	at java.util.AbstractList.add(AbstractList.java:108)
            	at hudson.model.Actionable.addAction(Actionable.java:152)
            	at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:962)
            	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1221)
            	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:407)
            	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:35)
            	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
            	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
            	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
            	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            	at java.lang.Thread.run(Thread.java:748)
            Finished: FAILURE
            Page generated: Jun 25, 2017 10:05:23 PM IDTREST APIJenkins ver. 2.60.1
            
            mvk Max Kovgan added a comment - - edited eyalbe , I understand you believe the issue is coming up only with "Declarative Pipeline". I am experiencing this problem in "Scripted Pipeline", I have Pipeline Model Definition plugin installed too. The file being uploaded is pretty big. not as fat VM image big, but it's ~ 4.2GB big. This is the code: // shortens each stage. shows how to use closures def toggleable_stage(def name, Closure body) { stage(name) { boolean stage_run = true if (params.containsKey(name)) { stage_run = params. "${name}" } if (stage_run) { echo "executing: ${name}" body() } else { echo "skipping: ${name}" } } } node() { wrappers() { toggleable_stage 'DEPLOY' , { echo "Creating uploadSpecDataFiles" def uploadSpecDataFiles = [ [ pattern: "${targetDir}/${installerName}" , target : "deployment-install-media/${VERSION}/" ] as HashMap, [ pattern: "${targetDir}/${installerName}.${checkSum}" , target : "deployment-install-media/${VERSION}/" ] as HashMap, ] as ArrayList def uploadSpecData = [:] uploadSpecData << [ files: uploadSpecDataFiles ] as HashMap echo "Converting uploadSpecData to JSON" def uploadSpec = toJSON(uploadSpecData) def artifactoryData = [:] artifactoryData << [ url : ARTIFACTORY.url, credentialsId: credentials.rt ] echo "Setting up artifactory service instance" def artifactoryServer = Artifactory.newServer(artifactoryData) def buildInfo = artifactoryServer.upload(uploadSpec) echo "Publishing build info in artifactory" artifactoryServer.publishBuildInfo(buildInfo) } } // } }   Here comes the log again: 13:07:11 Setting up artifactory service instance [Pipeline] newArtifactoryServer [Pipeline] End of Pipeline java.lang.UnsupportedOperationException: Refusing to marshal org.codehaus.groovy.runtime.GStringImpl for security reasons at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:452) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88) at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64) at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:79) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88) at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64) at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:79) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88) at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64) at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:79) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84) at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265) at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252) Caused: java.lang.RuntimeException: Failed to serialize groovy.lang.Binding#variables for class groovy.lang.Binding at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256) at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224) at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138) at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209) at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:250) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:226) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.<init>(AbstractReflectionConverter.java:189) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:135) at com.thoughtworks.xstream.converters.reflection.SerializableConverter.marshalUnserializableParent(SerializableConverter.java:292) at com.thoughtworks.xstream.converters.reflection.SerializableConverter.doMarshal(SerializableConverter.java:246) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:83) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84) at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265) at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252) Caused: java.lang.RuntimeException: Failed to serialize org.jfrog.hudson.pipeline.types.ArtifactoryServer#cpsScript for class org.jfrog.hudson.pipeline.types.ArtifactoryServer at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256) at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224) at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138) at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209) at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88) at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64) at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:79) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84) at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265) at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252) Caused: java.lang.RuntimeException: Failed to serialize org.jenkinsci.plugins.workflow.cps.actions.ArgumentsActionImpl#arguments for class org.jenkinsci.plugins.workflow.cps.actions.ArgumentsActionImpl at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256) at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224) at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138) at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209) at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88) at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64) at com.thoughtworks.xstream.converters.collections.ArrayConverter.marshal(ArrayConverter.java:45) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84) at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265) at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252) Caused: java.lang.RuntimeException: Failed to serialize org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage$Tag#actions for class org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage$Tag at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256) at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224) at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138) at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209) at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43) at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82) at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37) at com.thoughtworks.xstream.XStream.marshal(XStream.java:1026) at com.thoughtworks.xstream.XStream.marshal(XStream.java:1015) at com.thoughtworks.xstream.XStream.toXML(XStream.java:988) at hudson.XmlFile.write(XmlFile.java:171) at org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage.saveActions(SimpleXStreamFlowNodeStorage.java:111) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$TimingFlowNodeStorage.saveActions(CpsFlowExecution.java:1491) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.saveActions(CpsFlowExecution.java:1012) at org.jenkinsci.plugins.workflow.graph.FlowNode.save(FlowNode.java:380) at org.jenkinsci.plugins.workflow.graph.FlowNode.persistSafe(FlowNode.java:386) at org.jenkinsci.plugins.workflow.graph.FlowNode.access$100(FlowNode.java:61) at org.jenkinsci.plugins.workflow.graph.FlowNode$1.add(FlowNode.java:346) at org.jenkinsci.plugins.workflow.graph.FlowNode$1.add(FlowNode.java:336) at java.util.AbstractList.add(AbstractList.java:108) at hudson.model.Actionable.addAction(Actionable.java:152) at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:962) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1221) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:407) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:35) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang. Thread .run( Thread .java:748) Finished: FAILURE Page generated: Jun 25, 2017 10:05:23 PM IDTREST APIJenkins ver. 2.60.1

            eyalbe, jglick , thought i'd try my luck and ask if you happen to have a work-around? I really want to avoid doing any manual work :'( 

            hossaiy yacoub hossain added a comment - eyalbe , jglick , thought i'd try my luck and ask if you happen to have a work-around? I really want to avoid doing any manual work :'( 
            eyalbe Eyal Ben Moshe added a comment - - edited

            I may have found the root cause of the issue.

            It could be that in a specific version of the plugin that includes the code of the 

            org.jenkinsci.plugins.workflow.cps.CpsScript class, it is no longer possible to serialize the CpsScript class. I'm not 100% sure about this, but that could explain why it the issue affects some of us, while for others (me ) everything works.

            As I previously mentioned, I did manage to reproduce the issue with the Pipeline Model Definition Plugin. After modifying the code in the ArtifactoryServer class (mentioned above), so that the CpsScript member is declared as transient, the issue was resolved.

            I published a snapshot version with a fix, and I'd sure appreciate your feedback for it.

            You can find the the download link in my comment at the following JIRA issue:

            https://www.jfrog.com/jira/browse/HAP-935

             

            eyalbe Eyal Ben Moshe added a comment - - edited I may have found the root cause of the issue. It could be that in a specific version of the plugin that includes the code of the  org.jenkinsci.plugins.workflow.cps.CpsScript class, it is no longer possible to serialize the CpsScript class. I'm not 100% sure about this, but that could explain why it the issue affects some of us, while for others (me ) everything works. As I previously mentioned, I did manage to reproduce the issue with the Pipeline Model Definition Plugin. After modifying the code in the ArtifactoryServer class (mentioned above), so that the CpsScript member is declared as transient, the issue was resolved. I published a snapshot version with a fix, and I'd sure appreciate your feedback for it. You can find the the download link in my comment at the following JIRA issue: https://www.jfrog.com/jira/browse/HAP-935  
            ajay_singh_jenkins Ajay Singh added a comment - - edited

            eyalbe,

            I tried the snapshot version and it seems to have fixed my builds. 

            I hope it works for others as well.

            ajay_singh_jenkins Ajay Singh added a comment - - edited eyalbe , I tried the snapshot version and it seems to have fixed my builds.  I hope it works for others as well.

            Cool!, I will try out as soon as I get to a keyboard in a few hours

            hossaiy yacoub hossain added a comment - Cool!, I will try out as soon as I get to a keyboard in a few hours

            eyalbe, Thank you!!! This has fixed my automations, much appreciated

            hossaiy yacoub hossain added a comment - eyalbe , Thank you!!! This has fixed my automations, much appreciated

            Fixed for me too.

            gildor Sylvain Le Gall added a comment - Fixed for me too.
            razvan_botez Razvan Botez added a comment -

            While the snapshot version works, when should we expect to see this fix included in a public version?

            razvan_botez Razvan Botez added a comment - While the snapshot version works, when should we expect to see this fix included in a public version?

            Version 2.12.0 of the Artifactory Plugin will include this fix. We expect it to be released within a few days.

            eyalbe Eyal Ben Moshe added a comment - Version 2.12.0 of the Artifactory Plugin will include this fix. We expect it to be released within a few days.
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-42524 [ JENKINS-42524 ]
            jglick Jesse Glick made changes -
            Link This issue duplicates JENKINS-43934 [ JENKINS-43934 ]
            jglick Jesse Glick added a comment - e7442b8
            jglick Jesse Glick added a comment -

            I do not believe that fix is correct. @abayer ping

            jglick Jesse Glick added a comment - I do not believe that fix is correct. @abayer ping
            jglick Jesse Glick made changes -
            Component/s pipeline-model-definition-plugin [ 21706 ]
            Component/s pipeline [ 21692 ]
            jglick Jesse Glick added a comment -

            In general the need to use script blocks to use this plugin is an indication that the decision to create a custom DSL was misguided. Much safer to stick to plain old steps. In the above examples most of the Pipeline is not in fact Declarative so it would be better to just make it all scripted.

            I suspect the problem has something to do with the apparent use of Script.binding (“global”) variables to store DSL objects, which is perhaps something Declarative should forbid, if it can.

            jglick Jesse Glick added a comment - In general the need to use script blocks to use this plugin is an indication that the decision to create a custom DSL was misguided. Much safer to stick to plain old steps. In the above examples most of the Pipeline is not in fact Declarative so it would be better to just make it all scripted. I suspect the problem has something to do with the apparent use of Script.binding (“global”) variables to store DSL objects, which is perhaps something Declarative should forbid, if it can.
            abayer Andrew Bayer added a comment -

            jglick Actually, most of the examples here aren't Declarative - looks like a more general problem?

            abayer Andrew Bayer added a comment - jglick Actually, most of the examples here aren't Declarative - looks like a more general problem?
            jglick Jesse Glick added a comment -

            abayer well the early examples may have been JENKINS-43934, a bug in an alpha release of a plugin since fixed. So only pay attention to bugs which are still reproducible.

            jglick Jesse Glick added a comment - abayer well the early examples may have been  JENKINS-43934 , a bug in an alpha release of a plugin since fixed. So only pay attention to bugs which are still reproducible.

            Update: version 2.12.0 of the Artifactory Plugin has been released.

            It includes the changes added to the snapshot version previously published.

            eyalbe Eyal Ben Moshe added a comment - Update: version 2.12.0 of the Artifactory Plugin has been released. It includes the changes added to the snapshot version previously published.
            abayer Andrew Bayer added a comment -

            I'm removing pipeline-model-definition from the components - Declarative is more strict about serializability than Scripted is, but that's not a bug, that's just life. =)

            abayer Andrew Bayer added a comment - I'm removing pipeline-model-definition from the components - Declarative is more strict about serializability than Scripted is, but that's not a bug, that's just life. =)
            abayer Andrew Bayer made changes -
            Component/s pipeline-model-definition-plugin [ 21706 ]
            jglick Jesse Glick added a comment -

            abayer well it is not actually clear to me where the bug lies, and I suspected that it was really in pipeline-model-definition, since I did not see anything wrong in what artifactory was doing offhand.

            jglick Jesse Glick added a comment - abayer well it is not actually clear to me where the bug lies, and I suspected that it was really in pipeline-model-definition , since I did not see anything wrong in what artifactory was doing offhand.
            rzhou Ronnie Zhou added a comment -

            saw the same stacktrae in zd-57759 and https://support.cloudbees.com/hc/en-us/articles/234805187-SECURITY-360-Advisory fixed it.

            rzhou Ronnie Zhou added a comment - saw the same stacktrae in zd-57759 and https://support.cloudbees.com/hc/en-us/articles/234805187-SECURITY-360-Advisory  fixed it.
            jglick Jesse Glick added a comment -

            I still suspect that pipeline-model-definition is involved here somehow, given the fact that the recent report involved the conjunction of a library with Declarative. (Not done in the normal way with a Declarative library section, but using Groovy code outside the pipeline block, which I suspect should be treated as a syntax error abayer?)

            jglick Jesse Glick added a comment - I still suspect that pipeline-model-definition is involved here somehow, given the fact that the recent report  involved the conjunction of a library with Declarative. (Not done in the normal way with a Declarative library section, but using Groovy code outside the pipeline block, which I suspect should be treated as a syntax error abayer ?)
            jglick Jesse Glick made changes -
            Component/s pipeline-model-definition-plugin [ 21706 ]
            Labels artifactory-plugin bug maven pipeline maven pipeline
            abayer Andrew Bayer added a comment -

            I want to reject anything outside of pipeline as a syntax error, but that'll break a bunch of existing Pipelines, so things get wonkier. But that specific report is definitely a case of Declarative serializing the steps block (deliberately and correctly) but the library object throws things off due to containing a GString. I honestly don't know off the top of my head what the right behavior on Declarative's side here would be - need to think on it.

            abayer Andrew Bayer added a comment - I want to reject anything outside of pipeline as a syntax error, but that'll break a bunch of existing Pipelines, so things get wonkier. But that specific report is definitely a case of Declarative serializing the steps block (deliberately and correctly) but the library object throws things off due to containing a GString . I honestly don't know off the top of my head what the right behavior on Declarative's side here would be - need to think on it.
            abayer Andrew Bayer made changes -
            Component/s pipeline-model-definition-plugin [ 21706 ]

            People

              eyalbe Eyal Ben Moshe
              raynig Simon Schneider
              Votes:
              4 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated: