Avoid OldDataMonitor avoids Jenkins load a plugin
@@ -365,7 +365,15 @@ public class RobustReflectionConverter implements Converter {
// Report any class/field errors in Saveable objects
if (context.get("ReadError") != null && context.get("Saveable") == result) {
+ // Avoid any error in OldDataMonitor to be catastrophic. See JENKINS-62231 and JENKINS-59582
+ // The root cause is the OldDataMonitor extension is not ready before a plugin triggers an error, for
+ // example when trying to load a field that was created by a new version and you downgrade to the previous
+ // one.
+ try {
OldDataMonitor.report((Saveable) result, (ArrayList<Throwable>) context.get("ReadError"));
+ } catch (Throwable ignored) {
+ // it should be already reported
+ }
context.put("ReadError", null);
}
return result;
