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

UnsupportedOperationException: Refusing to marshal com.github.dockerjava.api.*

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The docker plugin serializes classes from the 3rd part docker-java library which have not been whitelisted.

      Originally reported as a GitHub issue: https://github.com/jenkinsci/docker-plugin/issues/614.

      Fixed in PR #619, which has not yet been released. (Although maybe these classes should not be whitelisted and instead the code should be changed to not serialize them. Needs investigation)

      Example stack trace:

      java.io.IOException: java.lang.RuntimeException: Failed to serialize hudson.model.Slave#launcher for class io.jenkins.docker.DockerTransientNode
          at hudson.XmlFile.write(XmlFile.java:200)
          at jenkins.model.Nodes.save(Nodes.java:274)
          at hudson.util.PersistedList.onModified(PersistedList.java:173)
          at hudson.util.PersistedList.replaceBy(PersistedList.java:85)
          at hudson.model.Slave.setNodeProperties(Slave.java:299)
          at com.nirima.jenkins.plugins.docker.DockerTemplate.provisionNode(DockerTemplate.java:448)
          at com.nirima.jenkins.plugins.docker.DockerCloud$1.run(DockerCloud.java:268)
          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:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)
         Caused by: java.lang.RuntimeException: Failed to serialize hudson.model.Slave#launcher for class io.jenkins.docker.DockerTransientNode
          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:193)
          ... 12 more
         Caused by: java.lang.RuntimeException: Failed to serialize hudson.slaves.DelegatingComputerLauncher#launcher for class io.jenkins.docker.connector.DockerComputerConnector$1
          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 hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
          at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
          ... 25 more
         Caused by: java.lang.RuntimeException: Failed to serialize io.jenkins.docker.connector.DockerComputerJNLPConnector$1#val$inspect for class io.jenkins.docker.connector.DockerComputerJNLPConnector$1
          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 hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
          at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
          ... 34 more
         Caused by: java.lang.UnsupportedOperationException: Refusing to marshal com.github.dockerjava.api.command.InspectContainerResponse for security reasons; see https://jenkins.io/redirect/class-filter/
          at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:543)
          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)
          ... 43 more
      

        Attachments

          Issue Links

            Activity

            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Sorry, we have got a split-brain in the discussions.
            We will sync-up with Devin Nusbaum Jesse Glick Nicolas De Loof and then summarize the discussions

            Show
            oleg_nenashev Oleg Nenashev added a comment - Sorry, we have got a split-brain in the discussions. We will sync-up with Devin Nusbaum Jesse Glick Nicolas De Loof and then summarize the discussions
            Hide
            sadovnikov Viktor Sadovnikov added a comment -

            Seems I have fired a false alarm. We assemble docker image with Jenkins Master and our script leaves libraries from docker-plugin 1.0.4 on the classpath.
            I'll correct the script and will re-test tomorrow.

            Show
            sadovnikov Viktor Sadovnikov added a comment - Seems I have fired a false alarm. We assemble docker image with Jenkins Master and our script leaves libraries from docker-plugin 1.0.4 on the classpath. I'll correct the script and will re-test tomorrow.
            Hide
            sadovnikov Viktor Sadovnikov added a comment -

            It was a mistake on my side : old libraries of the plugin were still available. Clean installation of 1.1.3 (and upgrading its dependencies) resolved the problem.
            Though now I'm not sure about the purpose of https://github.com/jenkinsci/docker-plugin/pull/619, which was merged after 1.1.3 is released

            Show
            sadovnikov Viktor Sadovnikov added a comment - It was a mistake on my side : old libraries of the plugin were still available. Clean installation of 1.1.3 (and upgrading its dependencies) resolved the problem. Though now I'm not sure about the purpose of https://github.com/jenkinsci/docker-plugin/pull/619 , which was merged after 1.1.3 is released
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Viktor Sadovnikov this PR has been reverted, so 1.1.4 won't include this code anyway

            Show
            oleg_nenashev Oleg Nenashev added a comment - Viktor Sadovnikov this PR has been reverted, so 1.1.4 won't include this code anyway
            Hide
            dnusbaum Devin Nusbaum added a comment -

            Version 1.1.3 and newer should not be affected by this issue, so I am marking the ticket as resolved.

            Show
            dnusbaum Devin Nusbaum added a comment - Version 1.1.3 and newer should not be affected by this issue, so I am marking the ticket as resolved.

              People

              • Assignee:
                ndeloof Nicolas De Loof
                Reporter:
                dnusbaum Devin Nusbaum
              • Votes:
                2 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: