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

UnsupportedOperationException: Refusing to marshal com.sonymobile.tools.gerrit.gerritevents.watchdog.WatchTimeExceptionData for security reasons

      After upgrading jenkins and updating the gerrit trigger plugin, it couldn't read the gerrit-trigger.xml file so I deleted it. Now when I try to add a new server under gerrit trigger or try to edit existing server, when I save it throws an exception:

      Caused by: java.lang.UnsupportedOperationException: Refusing to marshal com.sonymobile.tools.gerrit.gerritevents.watchdog.WatchTimeExceptionData 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.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
          at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
          at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)

      So following what is written on https://jenkins.io/redirect/class-filter/ I am reporting this issue. Note that after doing save a few times, little by little it saved all the needed values even though this exception continues to occur.

          [JENKINS-48963] UnsupportedOperationException: Refusing to marshal com.sonymobile.tools.gerrit.gerritevents.watchdog.WatchTimeExceptionData for security reasons

          Oleg Nenashev added a comment -

          ttux Are you sure you are using Gerrit Trigger 2.27.2? Full Stacktrace would be helpful.

          Oleg Nenashev added a comment - ttux Are you sure you are using Gerrit Trigger 2.27.2? Full Stacktrace would be helpful.

          Oleg Nenashev added a comment -

          i confirm that the class is in the patched library: https://github.com/sonyxperiadev/gerrit-events/blob/master/src/main/java/com/sonymobile/tools/gerrit/gerritevents/watchdog/WatchTimeExceptionData.java
          If the plugin is up to date, there is a chance it conflicts with another lib with PluginFirstClassloader

          Oleg Nenashev added a comment - i confirm that the class is in the patched library: https://github.com/sonyxperiadev/gerrit-events/blob/master/src/main/java/com/sonymobile/tools/gerrit/gerritevents/watchdog/WatchTimeExceptionData.java If the plugin is up to date, there is a chance it conflicts with another lib with PluginFirstClassloader

          Oleg Nenashev added a comment -

          ttux the screenshot says you're using 2.27.1, not 2.27.2

          Oleg Nenashev added a comment - ttux the screenshot says you're using 2.27.1, not 2.27.2

          But I just saw in the logs:

          WARNING: com.sonymobile.tools.gerrit.gerritevents.watchdog.WatchTimeExceptionData in file:/home/jenkins/.jenkins/plugins/gerrit-trigger/WEB-INF/lib/gerrit-events-2.11.1.jar might be dangerous, so rejecting; see https://jenkins.io/redirect/class-filter/

          I also can see others:

          java.io.IOException: java.lang.RuntimeException: Failed to serialize hudson.model.Actionable#actions for class hudson.model.FreeStyleBuild
                  at hudson.XmlFile.write(XmlFile.java:201)
                  at hudson.model.Run.save(Run.java:1923)
                  at com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.model.BuildMemory.updateTriggerContext(BuildMemory.java:291)
                  at com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ToGerritRunListener.updateTriggerContexts(ToGerritRunListener.java:277)
                  at com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ToGerritRunListener.onCompleted(ToGerritRunListener.java:161)
                  at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:211)
                  at hudson.model.Run.execute(Run.java:1772)
                  at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
                  at hudson.model.ResourceController.execute(ResourceController.java:97)
                  at hudson.model.Executor.run(Executor.java:429)

          ...

          Caused by: java.lang.UnsupportedOperationException: Refusing to marshal com.sonymobile.tools.gerrit.gerritevents.dto.attr.Provider 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.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
                  at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
                  at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
                  ... 63 more

           

           

          Marc des Garets added a comment - But I just saw in the logs: WARNING: com.sonymobile.tools.gerrit.gerritevents.watchdog.WatchTimeExceptionData in file:/home/jenkins/.jenkins/plugins/gerrit-trigger/WEB-INF/lib/gerrit-events-2.11.1.jar might be dangerous, so rejecting; see https://jenkins.io/redirect/class-filter/ I also can see others: java.io.IOException: java.lang.RuntimeException: Failed to serialize hudson.model.Actionable#actions for class hudson.model.FreeStyleBuild         at hudson.XmlFile.write(XmlFile.java:201)         at hudson.model.Run.save(Run.java:1923)         at com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.model.BuildMemory.updateTriggerContext(BuildMemory.java:291)         at com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ToGerritRunListener.updateTriggerContexts(ToGerritRunListener.java:277)         at com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ToGerritRunListener.onCompleted(ToGerritRunListener.java:161)         at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:211)         at hudson.model.Run.execute(Run.java:1772)         at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)         at hudson.model.ResourceController.execute(ResourceController.java:97)         at hudson.model.Executor.run(Executor.java:429) ... Caused by: java.lang.UnsupportedOperationException: Refusing to marshal com.sonymobile.tools.gerrit.gerritevents.dto.attr.Provider 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.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)         at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)         at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)         ... 63 more    

          Oleg Nenashev added a comment -

          "gerrit-events" library is not being used in other plugins within jenkinsci organization.
          If you see Gerrit Events 2.11.1 in the log, it means that you HAVE NOT upgraded to Gerrit Trigger Plugin 2.27.2. Please do so. Last screenshot does not show the version at all

          Oleg Nenashev added a comment - "gerrit-events" library is not being used in other plugins within jenkinsci organization. If you see Gerrit Events 2.11.1 in the log, it means that you HAVE NOT upgraded to Gerrit Trigger Plugin 2.27. 2 . Please do so. Last screenshot does not show the version at all

          Good point, so when 2.72.2 is being picked up by jenkins and I can upgrade then this issue will be gone?

          Marc des Garets added a comment - Good point, so when 2.72.2 is being picked up by jenkins and I can upgrade then this issue will be gone?

          Ok sorry, I didn't see https://issues.jenkins-ci.org/browse/JENKINS-48943 so you can close this issue and sorry for wasting your time.

          Marc des Garets added a comment - Ok sorry, I didn't see https://issues.jenkins-ci.org/browse/JENKINS-48943 so you can close this issue and sorry for wasting your time.

          Oleg Nenashev added a comment -

          np, it happens

          Oleg Nenashev added a comment - np, it happens

          oleg_nenashev I've removed the Gerrit Code Review plugin, this issue is specific to the Gerrit Trigger.

          Luca Domenico Milanesio added a comment - oleg_nenashev I've removed the Gerrit Code Review plugin, this issue is specific to the Gerrit Trigger.

            oleg_nenashev Oleg Nenashev
            ttux Marc des Garets
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: