@Tom-Elliott
Test result with the agent log: software waits for the rename/join restart, but not while the rejoin is still blocked
Thanks a lot, Tom, for the quick work on this, for the agent change and for #2214. I tested it on a fresh Deploy: image captured with agent 0.1.35, server 1.6.1.59 (27a1194fb, dev-branch with #2214). The deferral works, but software still ran twice before it kicked in. Times are UTC (web server and agent logs are UTC+1 and have been converted).
14:02:30 Post_Stage3.php, deploy finished (task complete, software status list cleared by #2214) 14:02:41 PXE boot.php (reboot after imaging) 14:03:06 Agent 0.1.35 enrolls (GET enroll, identity/check 409, POST enroll 200, identity/check 200) 14:04:06 PXE boot.php (second reboot, before the domain join) 14:04:22 Agent contacts (enroll, identity/check, poll 14:04:23) 14:04:26 "Run before software" snapin downloaded; result rc 0 at 14:05:11 14:06:49 SOFTWARE PASS 1: our package downloaded from the Chocolatey feed (200) 14:07:43 8 x POST /agent/v1/result: six packages "installed", rc 0; our Avast package has no status row. Agent update payload downloaded 14:07:54 Agent is now 0.1.36, update state ok 14:08:07 SOFTWARE PASS 2: package downloaded again; at 14:08:20 the six packages are "converged", still no row for the Avast package 14:08:23 POST /fog/agent/v1/directory/rejoin/start 14:08:25 AD: computer account password set (pwdLastSet) = the domain join 14:08:39 PXE boot.php: the rename/join restart 14:08:48 AD: computer object changed (whenChanged), first boot under the new name 14:08:49 First agent contact after the restart (enroll, identity/check, poll 14:08:54) 14:09:11 SOFTWARE PASS 3 (first one after the restart): package downloaded again (200) 14:09:31 Avast console: NO_SERVICES / ANTIVIRUS: INSTALLING 14:09:37 Avast package reported "installed", rc 0 (first time it has a status row); the other six "converged" 14:10:01 Pass 4: all seven packages "converged" 14:13:17 Avast console: SAFE / ANTIVIRUS: ACTIVATED (3 min 46 s after INSTALLING)The matching agent log lines (fog-agent.log, local time +01:00):
15:04:25 directory rejoin: blocked (directory_observation_required) 15:07:42 software "avast-business-agent": installed, exit 4294967295, outcome failed, installed "" 15:07:54 directory rejoin: blocked (directory_observation_required) 15:08:19 software "avast-business-agent": installed, exit 4294967295, outcome failed, installed "" 15:08:24 directory rejoin: native success; Windows restart and verification pending 15:08:25 software: deferred; a rename or domain join is waiting for its restart 15:08:25 reboot: applied (directory-rejoin: directory rejoin needs a Windows restart, mode reboot) 15:08:54 directory rejoin: verified after Windows restart 15:09:35 software "avast-business-agent": installed, exit 0, outcome success, installed "1.0.0"What I see:
The deferral works. software: deferred appears right after the join, and pass 3 only ran after directory rejoin: verified after Windows restart. The gap is before the join. From enrollment (15:03) until 15:08:24 the rejoin was blocked (directory_observation_required), so nothing was pending and software ran twice while the computer was still named INSTALACION (the image name). What is that observation, and could software also wait while a join is expected but still blocked? The failed run was not stored. The agent logged outcome failed (exit 4294967295) for our package in both early passes, and the 7 results were posted, but the host had only 6 software status rows, none for that package, until after the restart (point 2 of my first post is still open). The Avast install worked, but only thanks to our own name check in the package script, which made it skip passes 1 and 2 and let pass 3 through. The status list was empty right after the deploy finished, so #2214 works. That one is a big help, thank you.Happy to test a patch or send more logs.