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

JEP-200 issue with plugin Kubernetes Continuous Deploy Plugin

      OS: Linux Ubuntu 16.04 
      Jenkins-version: 2.107.1

      When trying to deploy using the kubernetes-cd-plugin in our Jenkinsfile, we get the following stacktrace:

       
      ERROR: ERROR: Failed to deserialize response to UserRequest:com.microsoft.jenkins.kubernetes.command.DeploymentCommand$1@6eca1f31: java.lang.SecurityException: Rejected: com.fasterxml.jackson.databind.JsonMappingException$Reference; see
      https://jenkins.io/redirect/class-filter/
      java.io.IOException: Failed to deserialize response to UserRequest:com.microsoft.jenkins.kubernetes.command.DeploymentCommand$1@6eca1f31: java.lang.SecurityException: Rejected: com.fasterxml.jackson.databind.JsonMappingException$Reference; see
      https://jenkins.io/redirect/class-filter/
      at hudson.remoting.Channel.call(Channel.java:960)
      at hudson.FilePath.act(FilePath.java:1093)
      at com.microsoft.jenkins.kubernetes.command.DeploymentCommand.execute(DeploymentCommand.java:66)
      at com.microsoft.jenkins.kubernetes.command.DeploymentCommand.execute(DeploymentCommand.java:45)
      at com.microsoft.jenkins.azurecommons.command.CommandService.runCommand(CommandService.java:88)
      at com.microsoft.jenkins.azurecommons.command.CommandService.execute(CommandService.java:96)
      at com.microsoft.jenkins.azurecommons.command.CommandService.executeCommands(CommandService.java:75)
      at com.microsoft.jenkins.azurecommons.command.BaseCommandContext.executeCommands(BaseCommandContext.java:77)
      at com.microsoft.jenkins.kubernetes.KubernetesDeploy.perform(KubernetesDeploy.java:42)
      at com.microsoft.jenkins.azurecommons.command.SimpleBuildStepExecution.run(SimpleBuildStepExecution.java:54)
      at com.microsoft.jenkins.azurecommons.command.SimpleBuildStepExecution.run(SimpleBuildStepExecution.java:35)
      at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49)
      at hudson.security.ACL.impersonate(ACL.java:290)
      at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46)
      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.SecurityException: Rejected: com.fasterxml.jackson.databind.JsonMappingException$Reference; see
      https://jenkins.io/redirect/class-filter/
      at hudson.remoting.ClassFilter.check(ClassFilter.java:76)
      at hudson.remoting.MultiClassLoaderSerializer$Input.resolveClass(MultiClassLoaderSerializer.java:129)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1826)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1713)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2000)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
      at java.util.LinkedList.readObject(LinkedList.java:1149)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1058)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2136)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2027)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2245)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2169)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2027)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2245)
      at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:552)
      at java.lang.Throwable.readObject(Throwable.java:914)
      at sun.reflect.GeneratedMethodAccessor75.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1058)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2136)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2027)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
      at hudson.remoting.UserRequest.deserialize(UserRequest.java:277)
      at hudson.remoting.UserResponse.retrieve(UserRequest.java:310)
      at hudson.remoting.Channel.call(Channel.java:952)
      ... 18 more

          [JENKINS-50760] JEP-200 issue with plugin Kubernetes Continuous Deploy Plugin

          Oleg Nenashev added a comment -

          Yes, it is a real defect from what I see

          Oleg Nenashev added a comment - Yes, it is a real defect from what I see

          Menghua Xiao added a comment -

          I can add the class to the whitelist.

          metareven , could you run the job on Jenkins master and paste the stack trace of the raised JsonMappingException ? The above exception stack trace was generated by the deserialization code, and the actual cause to the JsonMappingException was swallowed. It would be better we know where the exception was raised and properly handle it.

          Thanks,

          Menghua Xiao added a comment - I can add the class to the whitelist. metareven , could you run the job on Jenkins master and paste the stack trace of the raised JsonMappingException ? The above exception stack trace was generated by the deserialization code, and the actual cause to the JsonMappingException was swallowed. It would be better we know where the exception was raised and properly handle it. Thanks,

          Oleg Nenashev added a comment -

          " com.fasterxml.jackson.databind.JsonMappingException$Reference". This class gets rejected, because it is sent back as a field within exception from what I see (ornot?). JENKINS-50237 should resolve this issue alltogether, but we are not going to backport the entire fix into the 2.107.x baseline.

          arieshout Whitelisting of the class semms to be an acceptable solution since the class itself is safe. Alternate approach would be to catch the JsonMappingException exception within the Remoting call and wrap it by "ProxyException".

          Oleg Nenashev added a comment - " com.fasterxml.jackson.databind.JsonMappingException$Reference". This class gets rejected, because it is sent back as a field within exception from what I see (ornot?). JENKINS-50237 should resolve this issue alltogether, but we are not going to backport the entire fix into the 2.107.x baseline. arieshout Whitelisting of the class semms to be an acceptable solution since the class itself is safe. Alternate approach would be to catch the JsonMappingException exception within the Remoting call and wrap it by "ProxyException".

          Menghua Xiao added a comment -

          oleg_nenashev I have submitted a PR https://github.com/jenkinsci/kubernetes-cd-plugin/pull/32 which wraps the unknown Exception to AbortException, which should solve such serialization issue in future.

          Menghua Xiao added a comment - oleg_nenashev I have submitted a PR https://github.com/jenkinsci/kubernetes-cd-plugin/pull/32  which wraps the unknown Exception to AbortException, which should solve such serialization issue in future.

          Code changed in jenkins
          User: Menghua Xiao
          Path:
          src/main/java/com/microsoft/jenkins/kubernetes/command/DeploymentCommand.java
          src/test/java/com/microsoft/jenkins/kubernetes/command/DeploymentCommandTest.java
          http://jenkins-ci.org/commit/kubernetes-cd-plugin/d1314ceb390b135a38773ff37275b208b4a50b7d
          Log:
          Transfrom slave exceptions to whitelist exceptions (JENKINS-50760)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Menghua Xiao Path: src/main/java/com/microsoft/jenkins/kubernetes/command/DeploymentCommand.java src/test/java/com/microsoft/jenkins/kubernetes/command/DeploymentCommandTest.java http://jenkins-ci.org/commit/kubernetes-cd-plugin/d1314ceb390b135a38773ff37275b208b4a50b7d Log: Transfrom slave exceptions to whitelist exceptions ( JENKINS-50760 )

          Code changed in jenkins
          User: Menghua Xiao
          Path:
          src/main/java/com/microsoft/jenkins/kubernetes/command/DeploymentCommand.java
          src/test/java/com/microsoft/jenkins/kubernetes/command/DeploymentCommandTest.java
          http://jenkins-ci.org/commit/kubernetes-cd-plugin/7bafafa2b32047cd44eeeacbd0d31d3a33885b0f
          Log:
          Merge pull request #32 from ArieShout/jep-200

          Transfrom slave exceptions to whitelist exceptions (JENKINS-50760)

          Compare: https://github.com/jenkinsci/kubernetes-cd-plugin/compare/bd475dc3da5f...7bafafa2b320

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Menghua Xiao Path: src/main/java/com/microsoft/jenkins/kubernetes/command/DeploymentCommand.java src/test/java/com/microsoft/jenkins/kubernetes/command/DeploymentCommandTest.java http://jenkins-ci.org/commit/kubernetes-cd-plugin/7bafafa2b32047cd44eeeacbd0d31d3a33885b0f Log: Merge pull request #32 from ArieShout/jep-200 Transfrom slave exceptions to whitelist exceptions ( JENKINS-50760 ) Compare: https://github.com/jenkinsci/kubernetes-cd-plugin/compare/bd475dc3da5f...7bafafa2b320

          Oleg Nenashev added a comment -

          Fix has been released in kubernetes-cd-0.2.1

          Oleg Nenashev added a comment - Fix has been released in kubernetes-cd-0.2.1

            azure_devops Azure DevOps
            metareven Lars Tønder
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: