"Join" column empty after reimage + rejoin
-
Morning all.
Small reporting inconsistency in Reports > Directory Membership (FOG 1.6.0.158 stable, agent 0.1.28, AD join). Cosmetic, nothing breaks.
The “Join” column comes from
hdJoinAt. InDirectory_Membership::join()an emptyhdJoinAtwith no error is shown as empty, and the code comment says “Never attempted: the host is already joined, or it has never reported, or nothing has needed doing. Not a problem.”But a host that was reimaged and joined through the rejoin protocol (the result carries an
attempt_id, soDirectoryJoin::report()hands it toDirectoryRejoin::report()) never getshdJoinAtwritten. On top of that,TaskQueue::checkout()callsDirectoryJoin::forgetAttempt()when a Deploy completes, which setshdJoinAtback to NULL. So after every reinstall the host ends up like this:hdJoined=1,hdDomaincorrect, Drift “ok”,hdRejoinStatephaseverifiedhdJoinAtNULL,hdJoinErrorempty, so “Join” is blank
In our case two test VMs that we reinstall many times show a blank “Join” even though they joined correctly and automatically, while hosts joined with the older path (or by hand before) show “ok”. Looking at the report you can’t tell the two cases apart, and a blank reads as “never joined”.
I checked the unpatched
DirectoryRejoin.php(before our local #2122 patch) and it has nojoinAteither, so it is not caused by that.Thanks for the help.
-
@lperoma Thanks, your analysis is correct. A join through the rejoin protocol records its result in
hdRejoinState, and the Join column read onlyhdJoinAt. So a reimaged host that joined correctly showed a blank cell.The fix is in https://github.com/FOGProject/fogproject/pull/2125. The Join column now also reads the rejoin result and labels it: “ok (rejoin)”, “rejoin failed”, “rejoin awaiting reboot” or “rejoin result unknown”. A plain join still shows “ok” or its error, so you can tell the two paths apart. Whichever result is newer is the one shown.
It is merged to dev-branch now, and it reaches stable with the next stable merge.