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

JEP-200 issue with plugin Gradle Plugin

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Executing the test suit for gradle-plugin against jenkins-core:2.107.2 to check compatibility, several of them are failing due to a Serialization exception. These errors seems to be related to JEP-200. As example, the following trace shows one of the exceptions:
       

      java.lang.RuntimeException: java.io.IOException: java.lang.RuntimeException: Failed to serialize hudson.model.Project#builders for class hudson.model.FreeStyleProject
      	at hudson.util.PersistedList._onModified(PersistedList.java:183)
      	at hudson.util.PersistedList.add(PersistedList.java:72)
      	at org.jvnet.hudson.test.JenkinsRule.configRoundtrip(JenkinsRule.java:1086)
      	at hudson.plugins.gradle.GradlePluginIntegrationTest.Config roundtrip(GradlePluginIntegrationTest.groovy:180)
      Caused by: java.io.IOException: java.lang.RuntimeException: Failed to serialize hudson.model.Project#builders for class hudson.model.FreeStyleProject
      	at hudson.XmlFile.write(XmlFile.java:201)
      	at hudson.model.AbstractItem.save(AbstractItem.java:483)
      	at hudson.model.Job.save(Job.java:196)
      	at hudson.model.AbstractProject.save(AbstractProject.java:289)
      	at hudson.util.PersistedList.onModified(PersistedList.java:173)
      	at hudson.util.PersistedList._onModified(PersistedList.java:181)
      	... 3 more
      Caused by: java.lang.RuntimeException: Failed to serialize hudson.model.Project#builders for class hudson.model.FreeStyleProject
      	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:194)
      	... 8 more
      Caused by: java.lang.UnsupportedOperationException: Refusing to marshal hudson.plugins.gradle.Gradle for security reasons; see https://jenkins.io/redirect/class-filter/
      	at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:530)
      	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 hudson.util.DescribableList$ConverterImpl.marshal(DescribableList.java:269)
      	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)
      	... 21 more
      

        Attachments

          Activity

          fcojfernandez Francisco Fernández created issue -
          fcojfernandez Francisco Fernández made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          fcojfernandez Francisco Fernández added a comment -

          After analysing all the exceptions, the classes that seem to be affected are:

          • hudson.plugins.gradle.BuildScanAction
          • hudson.plugins.gradle.Gradle
          • hudson.plugins.gradle.Gradle$DescriptorImpl
          • hudson.plugins.gradle.GradleInstallation
          • hudson.plugins.gradle.GradleInstallation$DescriptorImpl
          • hudson.plugins.gradle.GradleInstaller

          All of them seems to be fine since their non transient field are String, so probably the fix could be just adding those class to the whitelist (via hudson.remoting.ClassFilter file).

          Show
          fcojfernandez Francisco Fernández added a comment - After analysing all the exceptions, the classes that seem to be affected are: hudson.plugins.gradle.BuildScanAction hudson.plugins.gradle.Gradle hudson.plugins.gradle.Gradle$DescriptorImpl hudson.plugins.gradle.GradleInstallation hudson.plugins.gradle.GradleInstallation$DescriptorImpl hudson.plugins.gradle.GradleInstaller All of them seems to be fine since their non transient field are String, so probably the fix could be just adding those class to the whitelist (via hudson.remoting.ClassFilter file).
          fcojfernandez Francisco Fernández made changes -
          Status In Progress [ 3 ] In Review [ 10005 ]
          fcojfernandez Francisco Fernández made changes -
          Remote Link This issue links to "PR-55 (Web Link)" [ 20605 ]
          oleg_nenashev Oleg Nenashev made changes -
          Labels JEP-200 JEP-200 JEP-200-invalid
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          As discussed, it is likely an issue with development tools (obsolete JTH, etc.). The issue cannot be reproduced on a real instance

          Show
          oleg_nenashev Oleg Nenashev added a comment - As discussed, it is likely an issue with development tools (obsolete JTH, etc.). The issue cannot be reproduced on a real instance
          jamesdumay James Dumay made changes -
          Remote Link This issue links to "CloudBees Internal CJP-8740 (Web Link)" [ 20614 ]
          jglick Jesse Glick made changes -
          Assignee Francisco Fernández [ fcojfernandez ] Jesse Glick [ jglick ]
          jglick Jesse Glick made changes -
          Status In Review [ 10005 ] In Progress [ 3 ]
          jglick Jesse Glick made changes -
          Remote Link This issue links to "core PR 3420 (Web Link)" [ 20619 ]
          jglick Jesse Glick made changes -
          Component/s core [ 15593 ]
          jglick Jesse Glick made changes -
          Labels JEP-200 JEP-200-invalid JEP-200 JEP-200-invalid lts-candidate
          jglick Jesse Glick made changes -
          Status In Progress [ 3 ] In Review [ 10005 ]
          cloudbees CloudBees Inc. made changes -
          Remote Link This issue links to "CloudBees Internal ARC-264 (Web Link)" [ 20620 ]
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/java/jenkins/security/ClassFilterImpl.java
          http://jenkins-ci.org/commit/jenkins/b14ba46a141b21d5f45679d2871376d8b12583d2
          Log:
          JENKINS-51062 Extend ClassFilterImpl.isLocationWhitelisted Maven-oriented exclusions to plugin under test during Gradle builds.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/jenkins/security/ClassFilterImpl.java http://jenkins-ci.org/commit/jenkins/b14ba46a141b21d5f45679d2871376d8b12583d2 Log: JENKINS-51062 Extend ClassFilterImpl.isLocationWhitelisted Maven-oriented exclusions to plugin under test during Gradle builds.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/jenkins/security/ClassFilterImpl.java
          http://jenkins-ci.org/commit/jenkins/a4a1355f518f282d1f8f73a640b71aae3680f2a6
          Log:
          Merge pull request #3420 from jglick/gradle-plugin-under-test-JENKINS-51062

          JENKINS-51062 Extend ClassFilterImpl.isLocationWhitelisted Maven-oriented exclusions to plugin under test during Gradle builds

          Compare: https://github.com/jenkinsci/jenkins/compare/d1eaafb28bda...a4a1355f518f
          *NOTE:* This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

          Functionality will be removed from GitHub.com on January 31st, 2019.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/jenkins/security/ClassFilterImpl.java http://jenkins-ci.org/commit/jenkins/a4a1355f518f282d1f8f73a640b71aae3680f2a6 Log: Merge pull request #3420 from jglick/gradle-plugin-under-test- JENKINS-51062 JENKINS-51062 Extend ClassFilterImpl.isLocationWhitelisted Maven-oriented exclusions to plugin under test during Gradle builds Compare: https://github.com/jenkinsci/jenkins/compare/d1eaafb28bda...a4a1355f518f * NOTE: * This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/ Functionality will be removed from GitHub.com on January 31st, 2019.
          jglick Jesse Glick made changes -
          Resolution Fixed [ 1 ]
          Status In Review [ 10005 ] Resolved [ 5 ]
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Fixed in 2.120

          Show
          oleg_nenashev Oleg Nenashev added a comment - Fixed in 2.120
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          LTS backporting is not needed since we picked 2.121.x as a baseline

          Show
          oleg_nenashev Oleg Nenashev added a comment - LTS backporting is not needed since we picked 2.121.x as a baseline
          oleg_nenashev Oleg Nenashev made changes -
          Labels JEP-200 JEP-200-invalid lts-candidate JEP-200 JEP-200-invalid

            People

            Assignee:
            jglick Jesse Glick
            Reporter:
            fcojfernandez Francisco Fernández
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: