-
Bug
-
Resolution: Unresolved
-
Minor
-
Java 11
Jenkins 2.426.3
RHEL 8
I am working on a tool that uses the Jenkins APIs to figure out which offline machines and be shut down and then which should be restarted before they are supposed to go online. Because I didn't want to shut down a machine if someone brought it offline manually, I look for offlineCause elements with a _class attribute of hudson.slaves.OfflineCause$SimpleOfflineCause from the /computer/api/xml REST API.
That worked great until I upgraded Jenkins in the LTS series. Then all of a sudden, my code couldn't detect any scheduled offline nodes.
It could be that an upgrade itself is the reason why the offlineCause was lost. The odd thing is that the Jenkins UI still knew why that node was offline:
This node’s availability policy is: “Bring this agent online according to a schedule” Currently, this mandates that the node be offline.
I assume/hope that when Jenkins interacts with node scheduled, offlineCauses will be properly formed at least until the next reboot.