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

Diagnostics plugin fails with UnsupportedOperationException: Refusing to marshal java.util.concurrent.atomic.AtomicInteger for security reasons

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • diagnostics-plugin
    • Jenkins 2.368
      Diagnostics 1.2

      Steps to reproduce

      Install the Diagnostics plugin on a clean installation and click Run Diagnostics.

      Expected results

      No errors in the Jenkins log

      Actual results

      Spews the following stack trace

      2022-09-14 20:11:38.920+0000 [id=100] WARNING o.j.p.d.DiagnosticsConfig#save: Could not save Diagnostics configuration
      java.lang.UnsupportedOperationException: Refusing to marshal java.util.concurrent.atomic.AtomicInteger for security reasons; see https://www.jenkins.io/redirect/class-filter/
      	at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:581)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
      	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:59)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:83)
      	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:285)
      	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:272)
      Caused: java.lang.RuntimeException: Failed to serialize org.jenkinsci.plugins.diagnostics.DiagnosticRunner#runsCompleted for class org.jenkinsci.plugins.diagnostics.DiagnosticRunner
      	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:276)
      	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:243)
      	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:174)
      	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:228)
      	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:165)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
      	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:59)
      	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:44)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:87)
      	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeBareItem(AbstractCollectionConverter.java:94)
      	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:66)
      	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeCompleteItem(AbstractCollectionConverter.java:81)
      	at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:80)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
      	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:59)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:83)
      	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:285)
      	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:272)
      Caused: java.lang.RuntimeException: Failed to serialize org.jenkinsci.plugins.diagnostics.DiagnosticsSession#diagnostics for class org.jenkinsci.plugins.diagnostics.DiagnosticsSession
      	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:276)
      	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:243)
      	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:174)
      	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:228)
      	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:165)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
      	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:59)
      	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:44)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:87)
      	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeBareItem(AbstractCollectionConverter.java:94)
      	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:66)
      	at org.jenkinsci.plugins.diagnostics.DiagnosticsConfig$ConverterImpl.marshal(DiagnosticsConfig.java:382)
      	at hudson.util.XStream2$AssociatedConverterImpl.marshal(XStream2.java:495)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
      	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:59)
      	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:44)
      	at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:83)
      	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
      	at com.thoughtworks.xstream.XStream.marshal(XStream.java:1266)
      	at com.thoughtworks.xstream.XStream.marshal(XStream.java:1255)
      	at com.thoughtworks.xstream.XStream.toXML(XStream.java:1228)
      	at hudson.XmlFile.write(XmlFile.java:213)
      Caused: java.io.IOException
      	at hudson.XmlFile.write(XmlFile.java:220)
      	at org.jenkinsci.plugins.diagnostics.DiagnosticsConfig.save(DiagnosticsConfig.java:292)
      	at org.jenkinsci.plugins.diagnostics.DiagnosticsConfig.lazySave(DiagnosticsConfig.java:307)
      	at org.jenkinsci.plugins.diagnostics.DiagnosticsConfig.notifyDiagnoticRunFinished(DiagnosticsConfig.java:331)
      	at org.jenkinsci.plugins.diagnostics.DiagnosticsSession.notifyDiagnosticRunFinished(DiagnosticsSession.java:633)
      	at org.jenkinsci.plugins.diagnostics.DiagnosticRunner.run(DiagnosticRunner.java:126)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      	at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
      	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at java.base/java.lang.Thread.run(Thread.java:829)
      

            alecharp Adrien Lecharpentier
            basil Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: