jenkinsci / allure-plugin

Allure Jenkins Plugin
https://plugins.jenkins.io/allure-jenkins-plugin/
Other
84 stars 66 forks source link

Build History disappears when Allure plugin is used #315

Closed aantonczak closed 1 year ago

aantonczak commented 1 year ago

Jenkins and plugins versions report

Environment Jenkins: 2.361.2 Allure: 2.30.2 Allure Commandline: 2.19.0 Java: jdk-18.0.2

What Operating System are you using (both controller, and any agents involved in the problem)?

Windows 10

Reproduction steps

Step1: I installed the Allure plugin via Plugin Manager in Jenkins. Step2: I set up the allure-commandline in Global Tool Configuration Step3: I added post-build action (Allure Report) in my Job Configuration Step4: I executed my test Step5: I checked the generated Allure report in Jenkins Step6: I restarted the Jenkins Step7: I try to open the same Allure report as in step 5

Expected Results

I should be able to open the Allure reports after Jenkins restart.

Actual Results

After Jenkins restart, all build history with Allure's reports disappears. When I try to open the report, I get a 404 Not Found error.

Anything else?

After build execute, I get the following error in the Jenkins Log:

Failed to save build record
java.lang.reflect.InaccessibleObjectException: Unable to make field private java.lang.Object java.lang.ref.Reference.referent accessible: module java.base does not "opens java.lang.ref" to unnamed module @71687585
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
    at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:180)
    at java.base/java.lang.reflect.Field.setAccessible(Field.java:174)
    at com.thoughtworks.xstream.converters.reflection.FieldDictionary.buildDictionaryEntryForClass(FieldDictionary.java:176)
    at com.thoughtworks.xstream.converters.reflection.FieldDictionary.buildMap(FieldDictionary.java:142)
    at com.thoughtworks.xstream.converters.reflection.FieldDictionary.fieldsFor(FieldDictionary.java:80)
    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:167)
    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:208)
    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.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 ru.yandex.qatools.allure.jenkins.AllureReportBuildAction#buildSummary for class ru.yandex.qatools.allure.jenkins.AllureReportBuildAction
    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.CollectionConverter.marshal(CollectionConverter.java:75)
    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 hudson.model.Actionable#actions for class hudson.model.FreeStyleBuild
    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.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 hudson.model.Run.save(Run.java:2070)
    at hudson.model.Run.execute(Run.java:1956)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
    at hudson.model.ResourceController.execute(ResourceController.java:107)
    at hudson.model.Executor.run(Executor.java:449)
FHannes commented 1 year ago

This seems to be a serious issue. I ran into the same problem with Java 17. The cause seems to be that there's some illegal reflection access happening here, which has been blocked off since Java 17. As far as I can tell, this issue in the plugin extensively corrupts information about builds that used Allure. All affected builds lost most information, including having their state set to false and their date to 0 (1970-01-01).

baev commented 1 year ago

Wow, Java 17 finally meets Jenkins. I'll take a look

FHannes commented 1 year ago

fyi, I was using the Jenkins docker image jenkins/jenkins:2.361.2-lts-jdk17