Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-72725

Node's offlineCause due to schedule lost after restart

XMLWordPrintable

      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.

            Unassigned Unassigned
            rpk_pro Robert
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: