- The Jenkins logs are polluted with warnings about unexpected reference like the following:
Feb 13, 2018 12:50:27 PM hudson.XmlFile replaceIfNotAtTopLevel WARNING: JENKINS-45892: reference to <OBJECT_NAME> being saved from unexpected <XML_FILE>
- CloudBees Jenkins Enterprise - Managed controller (CJEMM) 2.89.1+
- CloudBees Jenkins Enterprise - Operations Center (CJEOC) 2.89.1+
- CloudBees Jenkins Platform - Client controller (CJPCM) 2.89.1+
- CloudBees Jenkins Platform - Operations Center (CJPOC) 2.89.1+
- CloudBees Jenkins Team (CJT) 2.89.1+
- Jenkins LTS 2.89+
Since the release of Jenkins 2.89, nested references to model objects in their own XML files are forbidden. This is explained in JENKINS-45892. If such reference is detected when saving an object (for example a build, a job, a user, …), a WARNING is displayed in Jenkins.
Many plugins have already been fixed to comply with this improvement (for example the Blue Ocean Plugin has a fix in 1.4), other still need to be fixed.
In any cases, this is a WARNING can be ignored. HOWEVER if many objects with nested object references are being saved constantly in a Jenkins environment, this can pollutes the Jenkins logs with WARNINGS and eventually impact the overall performances of the Jenkins controller.
The solution is to upgrade the plugin that implements object(s) producing the nested reference(s). Following are plugins that have already been fixed at the time of writing this article:
- Blue Ocean Plugin 1.4.0
- Claim Plugin 2.12
- Cucumber Living Documentation 2.1.2
- Last Changes Plugin 2.6.1
- Maven Integration Plugin 3.1
- Multijob Plugin 1.29
- Sauce OnDemand Plugin 1.173
- Static Analysis Utilities 2.0 (not released)
XML_FILE can help to identify the object reference. Looking at the content of the XML file you can pinpoint the nested reference by looking for the attribute hudson.model.Run$Replacer. If not sure, file a ticket with CloudBees Support and attach the XML File.
If the Jenkins instance is impacted (performance wise) but the plugin that produces nested references has not been fixed yet, the workaround is to change the log level so that the WARNING is not logged anymore.
To prevent Jenkins from producing this warning in the logs, refer to How to change the default or package log levels to change the level of the logger