-
Bug
-
Resolution: Unresolved
-
Major
-
HideOperating System: CentOS Linux release 7.5.1804 (Core) 64bit,
All relevant JRE/JDK vendors and versions: java-1.8.0-openjdk-1.8.0.171-7.b10.el7.x86_64
Jenkins and plugin versions: Warning does not provide a plugin reference
How you installed Jenkins: ansible via yum jenkins-2.107.3ShowOperating System: CentOS Linux release 7.5.1804 (Core) 64bit, All relevant JRE/JDK vendors and versions: java-1.8.0-openjdk-1.8.0.171-7.b10.el7.x86_64 Jenkins and plugin versions: Warning does not provide a plugin reference How you installed Jenkins: ansible via yum jenkins-2.107.3
-
Powered by SuggestiMate
Trying to install Jenkins 2.107.3 and when i apply config and jobs from backup (Jenkins 2.89.3). All plugins are up to date.
Because of below warning we cannot proceed with higher environments since may affect multiple jobs:
May 14, 2018 11:59:15 AM jenkins.security.ClassFilterImpl lambda$isBlacklisted$1
WARNING: long in JRE might be dangerous, so rejecting; see https://jenkins.io/redirect/class-filter/
- jenkins.log
- 6 kB
- config.xml
- 5 kB
- config.xml
- 1 kB
- relates to
-
JENKINS-51355 ClassFilterImpl#isBlacklisted() should print stacktraces when rejecting classes
-
- Resolved
-
- links to
[JENKINS-51326] JEP-200 long data type rejected after upgrade to 2.107.3
I'd guess there is no stacktrace, right?
Would it be possible to get a full log starting from the startup? Maybe the core's whitelist didn't get loaded somehow (e.g. resource loading issue).
Also, do you run Jenkins in a web container? or do you use the built-in Jetty?
I run Jenkins in a VM under VirtualBox, is not a container.
I attached a log file (Removed jobs load part for security reasons).
Web Container is something like Apache Tomcat, JBoss, etc. It is orthogonal to VMs/containers
Anyway, according to the log you are running in Jetty.
I do not see anything specific there.
Would be great to understand what is the config file causing it.
It may be a glitch in primitive type handling, corrupted config or maybe a plugin conflicting with the converter being used for XStream. Anyway, it's strange to not see the full stacktrace
Yes, it seems the code in the core does not process primitive types correctly. It's unclear how it gets there tho.
I will create a small patch to add some diagnostics
Created https://github.com/jenkinsci/jenkins/pull/3446 which should help in this case.
It's still unclear to me WHERE it happens, I will create a separate ticket for diagnosability
Rather than making speculative fixes in release versions of Jenkins, I would rather work with the reporter to track down the root problem in this specific case.
jglick That's why I created https://github.com/jenkinsci/jenkins/pull/3447 . It could give us some diagnostics if sorests could run this snapshot build on a test server with the same data
I finally got the full error message in log:
May 21, 2018 1:03:00 PM jenkins.security.ClassFilterImpl notifyRejected
WARNING: long in JRE might be dangerous, so rejecting; see https://jenkins.io/redirect/class-filter/
java.lang.SecurityException: Class rejected by the class filter: long
at jenkins.security.ClassFilterImpl.notifyRejected(ClassFilterImpl.java:330)
at jenkins.security.ClassFilterImpl.lambda$isBlacklisted$1(ClassFilterImpl.java:180)
at java.util.Map.computeIfAbsent(Map.java:957)
at java.util.Collections$SynchronizedMap.computeIfAbsent(Collections.java:2672)
at jenkins.security.ClassFilterImpl.isBlacklisted(ClassFilterImpl.java:136)
at hudson.remoting.ClassFilter$1.isBlacklisted(ClassFilter.java:120)
at hudson.util.XStream2$BlacklistedTypesConverter.canConvert(XStream2.java:564)
at com.thoughtworks.xstream.core.DefaultConverterLookup.lookupConverterForType(DefaultConverterLookup.java:59)
at com.thoughtworks.xstream.XStream$1.lookupConverterForType(XStream.java:498)
at com.thoughtworks.xstream.mapper.AttributeMapper.getLocalConverterFromItemType(AttributeMapper.java:74)
at com.thoughtworks.xstream.mapper.AttributeMapper.getConverterFromAttribute(AttributeMapper.java:149)
at com.thoughtworks.xstream.mapper.MapperWrapper.getConverterFromAttribute(MapperWrapper.java:132)
at com.thoughtworks.xstream.mapper.EnumMapper.getConverterFromAttribute(EnumMapper.java:84)
at com.thoughtworks.xstream.mapper.MapperWrapper.getConverterFromAttribute(MapperWrapper.java:132)
at com.thoughtworks.xstream.mapper.LocalConversionMapper.getConverterFromAttribute(LocalConversionMapper.java:55)
at com.thoughtworks.xstream.mapper.MapperWrapper.getConverterFromAttribute(MapperWrapper.java:132)
at com.thoughtworks.xstream.mapper.MapperWrapper.getConverterFromAttribute(MapperWrapper.java:132)
at com.thoughtworks.xstream.mapper.MapperWrapper.getConverterFromAttribute(MapperWrapper.java:132)
at com.thoughtworks.xstream.mapper.MapperWrapper.getConverterFromAttribute(MapperWrapper.java:132)
at com.thoughtworks.xstream.mapper.MapperWrapper.getConverterFromAttribute(MapperWrapper.java:132)
at com.thoughtworks.xstream.mapper.MapperWrapper.getConverterFromAttribute(MapperWrapper.java:132)
at hudson.util.xstream.MapperDelegate.getConverterFromAttribute(MapperDelegate.java:151)
at com.thoughtworks.xstream.mapper.MapperWrapper.getConverterFromAttribute(MapperWrapper.java:132)
at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:289)
at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:270)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
at hudson.util.RobustCollectionConverter.populateCollection(RobustCollectionConverter.java:85)
at com.thoughtworks.xstream.converters.collections.CollectionConverter.unmarshal(CollectionConverter.java:80)
at hudson.util.RobustCollectionConverter.unmarshal(RobustCollectionConverter.java:76)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:393)
at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:331)
at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:270)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
at hudson.util.CopyOnWriteList$ConverterImpl.unmarshal(CopyOnWriteList.java:197)
at hudson.util.DescribableList$ConverterImpl.unmarshal(DescribableList.java:275)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:393)
at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:331)
at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:270)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1189)
at hudson.util.XStream2.unmarshal(XStream2.java:160)
at hudson.util.XStream2.unmarshal(XStream2.java:131)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1173)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1053)
at hudson.XmlFile.read(XmlFile.java:147)
at com.cloudbees.hudson.plugins.folder.AbstractFolder.loadChildren(AbstractFolder.java:406)
at com.cloudbees.hudson.plugins.folder.AbstractFolder.onLoad(AbstractFolder.java:567)
at com.cloudbees.hudson.plugins.folder.Folder.onLoad(Folder.java:109)
at com.cloudbees.hudson.plugins.folder.AbstractFolder.loadChildren(AbstractFolder.java:462)
at com.cloudbees.hudson.plugins.folder.AbstractFolder.onLoad(AbstractFolder.java:567)
at com.cloudbees.hudson.plugins.folder.Folder.onLoad(Folder.java:109)
at hudson.model.Items.load(Items.java:372)
at jenkins.model.Jenkins$15.run(Jenkins.java:3073)
at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
at jenkins.model.Jenkins$5.runTask(Jenkins.java:1062)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
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)
sorests So it comes from XStream. Could you please lookup XML files in your "JENKINS_HOME/jobs" directory and provide config.xml which has the following text:
class="long"
grep -ri 'class="long"' /<jenkins_home>/jobs did not found any file containing that text
What happens when you just grep long and ignore every result where that's not at word boundaries (e.g. oblong, longevity)? Shouldn't be too many results.
If it helps, it looks like the job in question is two levels deep in folders, i.e. at JENKINS_HOME/jobs/Folder1/jobs/Folder2/jobs/Job/config.xml level.
Found attached file with:
grep -ri '[^a-z/<>]long[^a-z.]' /<JENKINS_HOME>/jobs/<Folder1>/jobs/<Folder2>/jobs/<Job>
OK, that file should not lead to such errors for sure. Long types are used in Pipeline scripts only, and they are loaded as string.
However, now we know where is logging missing.So we "just" need to understand why XStream does not report errors in this case. Likely the data somehow goes to the old data monitor
sorests just to make sure, do you see anything in Old Data Monitor after loading the instance?
And which version of Folders plugin do you use?
Here's the records in "Old Data Monitor"
Type | Name | Error |
hudson.model.FreeStyleProject | #removed | MissingFieldException: No field 'configurationBuildDir' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'embeddedProfileFile' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'codeSigningIdentity' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'signIpaOnXcrun' found in class 'au.com.rayh.XCodeBuilder' |
hudson.model.FreeStyleProject | #removed | MissingFieldException: No field 'configurationBuildDir' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'embeddedProfileFile' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'codeSigningIdentity' found in class 'au.com.rayh.XCodeBuilder' |
hudson.model.FreeStyleProject | #removed | MissingFieldException: No field 'configurationBuildDir' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'embeddedProfileFile' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'codeSigningIdentity' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'configurationBuildDir' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'embeddedProfileFile' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'codeSigningIdentity' found in class 'au.com.rayh.XCodeBuilder' |
hudson.matrix.MatrixProject | #removed | MissingFieldException: No field 'configurationBuildDir' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'embeddedProfileFile' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'codeSigningIdentity' found in class 'au.com.rayh.XCodeBuilder' |
hudson.model.FreeStyleProject | #removed | MissingFieldException: No field 'configurationBuildDir' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'embeddedProfileFile' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'codeSigningIdentity' found in class 'au.com.rayh.XCodeBuilder' |
hudson.matrix.MatrixProject | #removed | MissingFieldException: No field 'configurationBuildDir' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'embeddedProfileFile' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'codeSigningIdentity' found in class 'au.com.rayh.XCodeBuilder' |
hudson.model.FreeStyleProject | #removed | MissingFieldException: No field 'configurationBuildDir' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'embeddedProfileFile' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'codeSigningIdentity' found in class 'au.com.rayh.XCodeBuilder' |
hudson.matrix.MatrixProject | #removed | MissingFieldException: No field 'configurationBuildDir' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'embeddedProfileFile' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'codeSigningIdentity' found in class 'au.com.rayh.XCodeBuilder' |
hudson.model.FreeStyleProject | #removed | MissingFieldException: No field 'configurationBuildDir' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'embeddedProfileFile' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'codeSigningIdentity' found in class 'au.com.rayh.XCodeBuilder' |
hudson.matrix.MatrixProject | #removed | MissingFieldException: No field 'configurationBuildDir' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'embeddedProfileFile' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'codeSigningIdentity' found in class 'au.com.rayh.XCodeBuilder', MissingFieldException: No field 'signIpaOnXcrun' found in class 'au.com.rayh.XCodeBuilder' |
All these fields are not related to "long". They come from XCode Plugin 2.0.0 AFAICT.
So we will need to add more diagnostics for XStream layers in order to triage the failing job, I'd guess.
Looking for class="long" is probably a red herring. Judging by the stack trace, I suspect that there is some object with an enum-valued field, which is reading a config.xml with crazy content that would not have worked (perhaps some plugin incompatibly refactored the type of a persistent field) but would normally just be sending something to OldDataMonitor. Still not really sure how this becomes a long specifically.
Is the error reproducible? Then forget about custom core patches and just bisect $JENKINS_HOME until you identify the jobs/**/config.xml responsible, and attach it here.
I've seen a similar warning yesterday after a 2.89.x to 2.107.3 upgrade, on one single Jenkins server (whereas I was upgrading many other similar servers). On this specific server, there was one "unusual" plugin (compared to the other servers): hockeyapp
sorests do you have this plugin installed too?
I will attach an edited config.xml for a job which lead to this warning. Note the schemaVersion="X" attributes, that's some long numbers in the plugin code:
<publishers> <hockeyapp.HockeyappRecorder schemaVersion="2"> <applications> <hockeyapp.HockeyappApplication plugin="hockeyapp@1.2.1" schemaVersion="1"> [...]
Note that this did not generate old data warnings in the Jenkins GUI, only a warning in jenkins.log.
Also note that this config was generated by plugin version 1.2.1. Version 1.2.2 (latest) claims to include some JEP-200 compliance fixes. From what I've seen, upgrading to 1.2.2 is not, by itself, enough to make this warning disappear (the config.xml is not auto-converted on Jenkins startup). But as soon as I save the job configuration again (from Jenkins GUI), the schemaVersion attributes are removed, or converted to regular child node (with a different value...):
<publishers> <hockeyapp.HockeyappRecorder plugin="hockeyapp@1.2.2"> <applications> <hockeyapp.HockeyappApplication> <schemaVersion>0</schemaVersion> [...]
From there, I get no more warning if I restart the Jenkins server again.
sorests maybe you could try to grep for similar numeric attributes on you jobs configs? Something like that:
grep -E -R --include=config.xml '^[[:space:]]*<.*="[0-9]+".*>$' ~jenkins/jobs/
Adding jglick's comment from https://github.com/jenkinsci/jenkins/pull/3446#pullrequestreview-125207559 to this thread:
>
Hold on, there is new information in JIRA. Apparently this code using @XStreamAsAttribute leads to
<hockeyapp.HockeyappApplication plugin="hockeyapp@1.2.1" schemaVersion="1">
> which is a format I have never seen before. If true, that means that we have a lead for writing an actual functional test reproducing the bug. I doubt the proposed fix is actually the right one—rather, BlacklistedTypesConverter.canConvert should be doing the isPrimitive check, or perhaps there is a bug even earlier in XStream somewhere, since the converter is not consulted for the regular child element format (is there a reason that would be autoboxed while attributes are not?).
https://github.com/jenkinsci/jenkins/pull/3446 is generally stuck, I do not plan to work on anything else around this ticket
https://github.com/jenkinsci/jenkins/pull/3446 is blocked by jglick due to the lack of reproducible scenario. I will close the pull request.
If anybody else hits this issue, please feel free to take over the PR and to get it over the line.
oleg_nenashev Any idea? long isn't a class…