Thanks Tom, that explains both. I re-ran the same test with your fixes in place.
Setup: server updated to dev-branch 4c426a799 (includes #2301, schema 492). Fresh BIOS image captured with agent 0.1.38, so there was no self-update during the run. Same host (test-bios), same package avast-business-agent 1.0.0 (the name check in its script is still there).
Result: software now waits for the join. All times UTC (agent log is +01:00, minus one hour).
| Time | Source | Event |
|---|---|---|
| 17:09:23 | server | Deploy task 16969 created |
| 17:09:45 | server | PXE: boot.php, bzImage, init.xz |
| 17:10:05 | server | Task check-in, copy starts |
| 17:12:34 | server | Post_Stage3.php, copy done. softwareStatus for the host is empty (#2214 OK) |
| 17:13:08 | agent | this state was made on another machine ... enrolling as this machine, host 667 |
| 17:14:20 | agent | Service starts after the next reboot (0.1.38, no update) |
| 17:14:26 | agent | directory rejoin: blocked (directory_observation_required) and software: deferred; the server has not renamed this machine yet |
| 17:14:29 | server | POST directory/rejoin/start |
| 17:14:30.7 | AD | pwdLastSet of the computer account: joined |
| 17:14:31 | agent | directory rejoin: native success; Windows restart and verification pending |
| 17:14:33 | agent | software: deferred; a rename or domain join is waiting for its restart, then reboot: applied (directory-rejoin...) |
| 17:14:56 | agent | directory rejoin: verified after Windows restart |
| 17:15:40 | agent | Snapin 129 (before software): exit 0, success |
| 17:15:40 | agent | software: Chocolatey is missing; bootstrapping from https://community.chocolatey.org/install.ps1 (done 17:15:52) |
| 17:17:28 | server | Feed: avast-business-agent 1.0.0 downloaded |
| 17:17:45 | Avast console | ANTIVIRUS: INSTALLING |
| 17:18:34 | agent | 7 packages installed, exit 0, outcome success (googlechrome, vlc, 7zip, avast-business-agent, qemu-virtio-driver, qemu-guest-agent, chocolateygui). The server stored all 7 rows, Avast included |
| 17:18:58 | agent | All 7 converged |
| 17:21:15 | Avast console | ANTIVIRUS: ACTIVATED |
Compared with the earlier run (0.1.35, before your fix), software ran twice before the join and the Avast row was missing; now software runs once, after the join, and everything is stored.
What I could not test: the Avast install succeeded, so the failure path (exit code -1 / 4294967295, your #2301) was not exercised, and the name check never had to act (the name was already final). Before I remove it I would like to test a package that fails on purpose and check that the row is stored with -1. Does that sound right?
Two small questions:
- The join block (
directory_observation_required) lasted about 5 minutes in the first run and about 6 seconds here. Is that expected, or did something change on the server side? - At 17:14:26 and 17:14:33 the log says
reconcile: a provider failed; will retry next poll. Which provider is that, and should I worry?
One observation: the image has no Chocolatey installed, so the agent bootstraps it from the public site (12 seconds). That works, but a machine with no internet access would fail there.
Thanks again for the quick fixes.