• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. lperoma
    3. Posts
    L
    • Profile
    • Following 0
    • Followers 0
    • Topics 15
    • Posts 57
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: Feature request: option to run a software item only after the host has been renamed and joined to the domain (with record failed Chocolatey packages)

      @Tom-Elliott

      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:

      1. 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?
      2. 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.

      posted in FOG Problems
      L
      lperoma
    • RE: Feature request: option to run a software item only after the host has been renamed and joined to the domain (with record failed Chocolatey packages)

      @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.

      posted in FOG Problems
      L
      lperoma
    • Feature request: option to run a software item only after the host has been renamed and joined to the domain (with record failed Chocolatey packages)

      Hello everyone,

      I would like to propose a small option on a software item (or on a group association): “run only after the host has been renamed and joined to the domain”.

      Today, on a fresh deploy, the agent enrolls, runs the snapins and then runs the Chocolatey software module, and only after that does it rename the host and join it to the domain, which ends in a reboot. That order is fine for Chrome or VLC. It is a problem for installers that do their real work in a second stage after the first one returns. Our case is the Avast Business agent: the MSI returns 0 in about ten seconds, but the antivirus itself is downloaded and installed afterwards, over the next few minutes. If the join reboot lands in the middle, the install can be left half done, and from FOG’s side everything looks fine because the Chocolatey package reported success.

      What we do today is a workaround inside the package script: if the computer name is still the image name, the script throws on purpose, so nothing gets installed, and then we rely on FOG running the software again after the reboot. It works, but it has some rough edges that a native option would remove:

      • When the script throws, the software status row for that host is not updated. It keeps the old state (converged from a previous run), so the web UI never shows that the package failed. We only knew from the host itself.

      • We had to rely on the retry. By watching the web server log we saw that after each boot the agent runs the Chocolatey module about four times, roughly a minute apart, and then not again for hours (we saw passes about every six hours). So if the retry after the join reboot is missed, the next chance is a long way off.

      • The software status list of the host survives a new deploy. When an image is deployed, pending tasks such as snapins are cleared, but the old software status rows stay, so a freshly cloned host still shows software as converged or installed from the previous install. That is also why a failed package could not be told apart from an old success. The machine is new after a deploy, so that list should not be kept.

      • We first tried to detect “not joined yet” with the domain membership, but that does not work: the agent renames the host and joins the domain in the same step, and both only become effective after the reboot, so right before it Windows already reports the host as part of the domain while it still has the image name. The host name was the only reliable signal.

      So the request would be, in order of importance:

      1. An option per software item (or per group) to defer it until after the rename/join reboot.

      2. Recording a failed Chocolatey run in the software status (failed, with the output), instead of leaving the previous status.

      3. Clearing the host’s software status list when a deploy finishes, the same way pending snapin tasks are cleared, since the machine is new.

      I am not sure the ordering is the only thing behind our Avast problem, since we also had a separate crash of the vendor installer that seems unrelated, so I am only asking for the generic behavior, which would help with any installer that continues working after it returns.

      Happy to share logs or test a patch if it helps. Thanks!

      posted in FOG Problems
      L
      lperoma
    • "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. In Directory_Membership::join() an empty hdJoinAt with 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, so DirectoryJoin::report() hands it to DirectoryRejoin::report()) never gets hdJoinAt written. On top of that, TaskQueue::checkout() calls DirectoryJoin::forgetAttempt() when a Deploy completes, which sets hdJoinAt back to NULL. So after every reinstall the host ends up like this:

      • hdJoined=1, hdDomain correct, Drift “ok”, hdRejoinState phase verified
      • hdJoinAt NULL, hdJoinError empty, 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 no joinAt either, so it is not caused by that.

      Thanks for the help.

      posted in FOG Problems
      L
      lperoma
    • RE: A reimaged host stays stuck on an old directory join plan ("marker absent; automatic retry refused")

      @Tom-Elliott

      Thanks Tom, I tested #2122 and it does what you described.

      I applied the two src files of the PR by hand on top of the patches channel (schema 465, agent 0.1.28) and reproduced the same situation with test-bios. First Deploy (16928): the agent asked for the directory join and the plan went to awaiting_reboot (attempt 12f448e3…, trigger_task_id 16928). Before it rebooted I powered the VM off and queued a second Deploy (16929), which completed normally. The agent enrolled by itself after that (rebind, approved via deploy).

      For a while the old plan was still in hdRejoinState, still awaiting_reboot with trigger 16928, so right after queuing the Deploy nothing had changed. Once the machine booted the new Windows and the agent checked in, FOG replaced it on its own. A minute later there was a new attempt (3e64f53…, trigger 16929, awaiting_reboot). I didn’t touch “Clear directory operation review” or edit anything in the database. After one reboot the host was verified, hdJoined=1, hdKind=ad, secure_channel: healthy.

      So the old attempt is dropped after the new Deploy and the first boot, not at the moment the Deploy is created, which matches what you wrote. It only looks odd if you check the host in between and still see the old plan. No problem on my side, just mentioning it in case anyone else notices the same thing.

      One idea, only if you think it’s worth it: a checkbox in the Deploy task form, something like “discard every pending task of this host”, unchecked by default. The automatic rules are safer for the normal case, but sometimes the admin knows everything left over from the previous install is dead (queued tasks, snapins, a pending directory join) and wants to force a clean start right when the Deploy is queued, without waiting for the first boot and without the “Clear directory operation review” box. In our case, when a machine misbehaves it often keeps snapin tasks queued, and today you have to open the host, work out which tasks it has and delete them one by one. In a big fleet that is slow and easy to get wrong, whereas one box on the Deploy would clean the slate in a single step.

      I’ll drop my manual patch when #2122 reaches patches.

      posted in FOG Problems
      L
      lperoma
    • A reimaged host stays stuck on an old directory join plan ("marker absent; automatic retry refused")

      Hi Tom and everyone,

      First, thanks for the quick work on the shared adapter and enrollment issues. I tested #2116/#2118 today and enrollment behaves now. While doing that I hit something else with the directory join that I think is worth a thread of its own.

      Setup: FOG 1.6.0.158 stable moved today to the patches channel (schema 465, so it includes #2111, #2112, #2113, #2116 and #2118). Two Proxmox VMs (test-uefi and test-bios) deployed from the same image, whose source machine already has agent 0.1.28. Both hosts are set to join AD and both had been deployed once before today.

      After the second Deploy, test-bios joined the domain without any trouble. test-uefi never did. It kept the Windows name “instalacion”, stayed in the workgroup, and installed its software normally (Chrome, VLC, 7-Zip and Avast, before the activation snapin, which is the order we wanted). The agent log shows this every minute, and nothing else about the directory:

      2026-11-20T19:24:29+01:00 this state was made on another machine (a cloned or reimaged disk); generated a new key and enrolling as this machine
      2026-11-20T19:24:29+01:00 enrolled as host 666, certificate valid until 2027-11-20 18:24:29
      2026-11-20T19:26:01+01:00 facts: sending inventory=true software=6 directory=true printers=4 network=1
      2026-11-20T19:26:04+01:00 directory rejoin: directory rejoin marker absent; automatic retry refused
      2026-11-20T19:28:55+01:00 directory rejoin: directory rejoin marker absent; automatic retry refused
      

      So the very first directory poll after the reimage was already refused. On the server, hostDirectory.hdRejoinState for that host had this (trimmed):

      "phase":"awaiting_reboot", "attempt_id":"add87a0f...", "trigger_task_id":16923,
      "last_deploy_task_id":16923, "retry_authorized":false, "placement_hold":true
      

      The Deploy that had just reimaged the machine was task 16927, newer than 16923, but it did not replace that plan. The computer account was fine in AD (it existed and belonged to the account FOG uses to join), so it was not an account problem.

      Reading the code, this looks like the intended protection: PROTECTED_PHASES is started, awaiting_reboot, unknown and failed, and only a plan in ready is dropped when a newer Deploy arrives (dropSupersededPlan, reason directory_task_superseded). That makes sense for the old disk, where the join may really have happened. But after a Deploy the old disk is gone. The plan waits for a local marker and a reboot that can no longer exist, the new install has no marker, so the agent refuses, and the server keeps waiting for the agent. Neither side ever gives up.

      What happened to this host before is simple: it had a join plan pending that never actually ran, I reinstalled it, and it got stuck on that old plan. I can’t show you the log of the earlier install, because the reimage overwrote it, so the odd part is that the stored state says awaiting_reboot for something that, as far as I know, was never executed. test-bios did not get stuck, and its previous plan had ended in “verified”.

      The way out is the “Clear directory operation review” checkbox, and here is where I got a second surprise. clearReview() writes a new state with last_deploy_task_id set to the latest Deploy and drops workgroup and observation. As far as I can tell, with the Deploy counted as already used and no workgroup flag, nothing gets planned afterwards. On a real PC earlier today, ticking the box left the host with no plan at all. I added "workgroup":true by hand and FOG did plan a join, but that agent never ran it and I joined the machine manually.

      For test-uefi I wrote the cleared state by hand instead: reason: operator_cleared, workgroup: true, and last_deploy_task_id set to the previous Deploy (16923), so that 16927 was still pending. On the next poll FOG created a new plan (ready, trigger 16927), the agent ran it (awaiting_reboot, no error), and after a reboot it went to verified with the host joined. So the join itself works, and only the stuck state was the problem.

      What I would suggest, if you agree:

      1. A new Deploy for a host should clear everything that was pending for the previous installation: queued tasks, snapin tasks and directory join plans, not only plans in ready. This includes plans in started, awaiting_reboot, unknown and failed, because they refer to a disk that has been replaced. Whatever the Deploy itself creates (for example the snapins attached to it) would of course stay. I only checked the join plans; I have not tested what happens to old queued tasks and snapins when a Deploy is created, so please take that part as a suggestion.
      2. The review checkbox should keep workgroup and observation, and should not mark the latest Deploy as used, so the next poll can plan the join again.
      3. When the agent says “marker absent; automatic retry refused”, the host’s Active Directory panel could say that this needs the checkbox. Right now the only hint is in the agent log on the machine.

      Open question on my side: I don’t know why that first plan was in awaiting_reboot if it never ran. If there is something I should capture the next time (agent log before reimaging, a particular field of the state), tell me and I will.

      Thanks!

      posted in FOG Problems
      L
      lperoma
    • RE: Feature request: a way to handle USB Ethernet adapters shared between many hosts

      @Tom-Elliott

      Hi Tom, thanks again for the shared-adapter work.

      We hit a case with the new agent that your replies in this thread don’t spell out, and while reproducing it we found a few more things, so here are the details.

      Setup: FOG 1.6.0.158 stable with #2100, #2104 and #2111 applied by hand, FOG_HOST_IDENTIFY_SMBIOS=register, agent 0.1.24, Windows 10 IoT LTSC images, HP laptops that boot from the shared USB-C Ethernet adapter.

      What worked yesterday and what doesn’t today: yesterday, with #2104 and #2111 already applied, we tested two VMs with a duplicated MAC and FOG handled it fine at PXE (register, firmware first). Today, when we reinstall hosts whose firmware is already registered, it is the agent’s enrollment that fails when a MAC belongs to another host.

      The laptop that could never enroll

      The laptop’s host has a full inventory (system serial, UUID, board serial), and no other host has any of those values. Boot worked: PXE identified it correctly through the shared adapter, since in register a unique firmware match wins over the MAC. But the agent tried to enroll every 5 minutes and always got HTTP 409 with status "error", 16 times in a row. Each attempt left this in faults-web.log:

      Database save failed: Class: AgentEnrollment ... SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`fog`.`agentEnrollment`, CONSTRAINT `fk_agentEnrollment_aeHostID` FOREIGN KEY (`aeHostID`) REFERENCES `hosts` (`hostID`) ON DELETE CASCADE)
      

      The agent sends two MACs: the shared adapter’s, still stored on another laptop’s host, and one of its own that no host had. Reading the code, MachineIdentity::choose() returns conflict with host_id 0 when the firmware points to one host and a MAC points to a different one. Enrollment::enroll() then sets the reason to conflict and saves the row with hostID 0, which doesn’t exist in hosts, so the foreign key fails and nothing is stored. Nothing shows up in All Pending Agents, so the admin never sees it. The agent enrollment code only checks whether the setting is off, so register and enforce make no difference there.

      We worked around it by deleting the adapter’s MAC from the other host. The very next attempt enrolled fine (known-host-no-agent).

      Reproducing it with a VM

      We gave a VM the MAC of another VM’s host (approved, hmPending=0). Its firmware UUID names its own host. This time the conflict was stored: All Pending Agents shows it as identity-conflict (the enroll got a 202) and the agent logs:

      directory rejoin: this machine's MAC addresses or SMBIOS identity match more than one FOG host; ...
      this state was made on another machine (a cloned or reimaged disk); generated a new key and enrolling as this machine
      pending approval on the server (identity-conflict); waiting
      

      That row has no _directoryIdentity. After the agent restarted, every enroll got HTTP 409 with status "error" again, but with no database error in faults-web.log. We approved the pending row, restarted the VM, and the agent still gets 409 while the row stays issued with its certificate uncollected. As far as we can tell from MachineIdentity::enrollmentGate(), it returns upgrade_blocked: the stored row doesn’t have _directoryIdentity and the new request declares it, and that check runs before the row’s state is looked at. We haven’t confirmed that part on the agent side.

      So the same mismatch seems to end in two different 409 loops. If the agent declares the directory-identity feature from its first contact (the laptop, whose rows all have {"required": true}), the conflict goes through MachineIdentity::resolve() and ends with host 0 and the foreign key error. If it doesn’t declare it at the first contact (the VM), the conflict is stored, but the agent is locked out as soon as it starts declaring it, even after the admin approves.

      What we expected

      A shared MAC shouldn’t be a conflict at all when the firmware identifies a different machine, which is what enforce/register already do at boot. So:

      1. Could agent enrollment follow the same rule as boot, so that a unique firmware match wins over the MAC?
      2. If a conflict is meant to apply there anyway, the row should be saved with the host the firmware matched (or none) instead of host 0, so it doesn’t fail on the foreign key.
      3. All Pending Agents only shows the Windows name, the reason, the IP and the UUID. It would help to show which host the conflict is with, so the admin can tell it’s another machine before approving.
      4. Approving a conflict should let the agent collect its certificate, even if the stored row was created before the agent started declaring the feature.

      Happy to send full log lines or test a patch. We’re posting a second, unrelated problem (the “Clear directory operation review” button leaving a host unable to join) separately.

      posted in Feature Request
      L
      lperoma
    • RE: FOG 1.6 – Dependencies between Software Management and Snapins?

      @Tom-Elliott

      Thanks Tom, this is useful for us too. We use the same modules, and we have the opposite constraint to the one in the first post. We haven’t hit it yet (our hosts are still on 0.1.24, and we’ll test 0.1.26 on a VM first), but it follows directly from the new order.

      Our setup

      • One group with Chocolatey packages, including Avast Business (its own package generated by us).
      • In the same group, one snapin run with powershell.exe that checks the Windows activation.

      What we expect

      • Once Avast is installed it generally blocks PowerShell on our machines, so PowerShell snapins stop working.
      • Until now the snapin ran first and the software after, so they never collided. With software always before snapins, the Avast package may install first and block the snapin.

      Two suggestions, both as a per-snapin flag on the group’s snapin grant (so only the snapins that need it are affected, and other groups behave as today):

      1. Run before software. A flag on a snapin granted by a group, to run it before the host’s software instead of after.
      2. Run when a host joins the group. Today a group’s snapins are only used when a task is created (Deploy, Single Snapin, All Snapins). Software is applied as soon as a host is in the group; it would be handy for such a flagged snapin to be queued once when a host joins, if the host never completed it before.

      Both default to off, so nothing changes for anyone who doesn’t set them. We’re happy to test any patch on our server.

      posted in FOG Problems
      L
      lperoma
    • RE: Feature request: a way to handle USB Ethernet adapters shared between many hosts

      @Tom-Elliott

      Quick update: we’ve tested PR #2111 and it works perfectly for us.

      Setup

      • We also updated from 1.6.0.14 to 1.6.0.158 (stable).
      • On top of it we applied #2100, #2104 and #2111 by hand (we skipped the schema 462 step, since it only changes a setting description).
      • FOG_HOST_IDENTIFY_SMBIOS is set to register.

      Test (two Proxmox VMs)

      We moved the MAC of an already registered host onto a different machine. The machine with the different serial was not taken for the registered host: it booted as unregistered and registered as a new host, and the original host kept its MAC. Exactly the shared USB adapter case from this thread.

      Real laptops with the shared adapter are the next step, and I’ll report back if anything behaves differently. We’ll switch to the stable release on December 11.

      Thanks, Tom, this solves our problem.

      posted in Feature Request
      L
      lperoma
    • RE: Feature request: a way to handle USB Ethernet adapters shared between many hosts

      @Tom-Elliott

      Thanks for #2104. The case that is still open for us is PXE registration and the PXE menu.

      A new laptop (not in FOG) boots through the shared USB adapter whose MAC is still on another host Y. Its firmware matches no host, so FOG falls back to the MAC and answers “This machine already registered as Y”.

      Could the identification order be simply this? Always check UUID and serial first. Use the MAC only when the machine reports no usable firmware data (empty or placeholder values). If it does report firmware data and it matches no host, it is a new machine: offer registration, without moving any MAC and without giving the new host the adapter’s MAC.

      It could be a new value of FOG_HOST_IDENTIFY_SMBIOS so enforce stays as it is.

      We understand that iPXE already sends the UUID and serial numbers with every PXE request (sysuuid, sysserial, mbserial), also when booting through a USB adapter, since the firmware is read from the laptop and not from the NIC. Please correct us if that is wrong for registration.

      In our case the laptops that boot only through a USB adapter are recent and always report UUID and serial.

      Happy to test a patch.

      posted in Feature Request
      L
      lperoma
    • RE: Feature request: a way to handle USB Ethernet adapters shared between many hosts

      @Tom-Elliott Thanks a lot Tom, that was fast.

      I’m still on 1.6.0.14, and I couldn’t apply #2104 by hand like I did with #2100: it patches MachineIdentity.php, which doesn’t exist in my version, and the change in Enrollment.php calls it. So I’ll wait for the update instead. Do you know which stable release is expected to include it?

      I’ll also run a full inventory on the hosts that share an adapter, as you suggest, so they have a serial stored. And I’ll report back once I’ve tried it with real laptops.

      posted in Feature Request
      L
      lperoma
    • RE: Feature request: a way to handle USB Ethernet adapters shared between many hosts

      @Tom-Elliott Thanks a lot, Tom. I tested it today on 1.6.0.14, with the two files from PR #2100 applied by hand (SmbiosIdentity.php and IpxeBootMenu.php) and FOG_HOST_IDENTIFY_SMBIOS set to enforce.

      I used two Proxmox VMs, both already registered, each with its own UUID. I gave one of them the MAC of the other and booted it by PXE. The menu said Host is registered as bios-test!, which is the right one, and the log shows what happened:

      FOG host identity (enforce): MAC resolved "uefi-test" (id 658); SMBIOS resolved "bios-test" (id 659) on sysuuid=795efc04-...; SMBIOS wins
      

      Both inventories were left alone and the MAC stayed on the first host. Without the patch the same thing overwrote the UUID of the host that owned the MAC, as you described.

      I also hit the gap you mentioned, with a machine FOG did not know yet. Before registering the second VM I gave it the MAC of the first, and FOG took it for the first host. The agent did the same: the enrollment request of the second VM got attached to the first host (reason known-host-no-agent). I don’t know if that last part is worth a look on your side.

      I have only tested VMs so far. The real case is a few laptops that share one USB adapter,

      posted in Feature Request
      L
      lperoma
    • RE: 1.6.0.14: "Create new tasking" modal hangs on "Loading, please wait..." if the host has no image

      @Tom-Elliott Thanks!

      posted in FOG Problems
      L
      lperoma
    • RE: Feature request: a way to handle USB Ethernet adapters shared between many hosts

      @Tom-Elliott Thanks so much!

      posted in Feature Request
      L
      lperoma
    • Feature request: a way to handle USB Ethernet adapters shared between many hosts

      Hi all, and thanks for FOG.

      We run it in a school (about 280 hosts, FOG 1.6.0.14) and we have a problem that I think many schools with laptops share. A lot of our laptops have no Ethernet port, so for imaging we plug in a USB Ethernet adapter and PXE boot from it. The same few adapters get moved from laptop to laptop, and since FOG identifies a host by the MAC it boots with, it always sees the adapter’s MAC and therefore always the same host.

      What we do today is move that MAC by hand: delete it from the previous host, add it to the laptop we are about to image, and mark it as primary. It works, but it is easy to forget a step. If the MAC stays on two hosts, getHostByMacAddresses falls back on the primary flag, and if that does not settle it, the log shows multiple hosts.

      The ignore flags don’t help either. From what I read in parseMacList (I might be wrong), IMI / IMC are looked up across all the rows with that MAC, not per host, so marking the adapter as ignored for imaging on one host hides it for everybody, including the laptop you actually want to image.

      What would make this much easier is some way to tell FOG that a MAC belongs to a shared or removable adapter. When a MAC flagged like that PXE boots, FOG would not bind it to a fixed host, but let you choose the host at boot (a list of hosts that have a task queued, or typing a hostname), or pick the one that has a pending task. Another option would be to let a task carry the MAC it should be matched with, only for that task, so you could schedule the deploy for the laptop with the adapter’s MAC and nothing else would need to change in the host.

      Another way to look at it, which might be simpler to build: let us define a MAC as an installation MAC (or “multi-host” MAC), one that is allowed to be linked to a host only for the duration of a task. You would attach it to the laptop you are about to image, run the deploy or capture, and when the task finishes FOG would detach it automatically, so it is free for the next machine and never ends up on two hosts at once. That would also remove the need for the ignore flags in this case, since the MAC would only live on a host while a task is running.

      I’m happy to test anything on our side. And if there is already a recommended way to handle shared USB adapters that I have missed, I’d be glad to hear it.

      posted in Feature Request
      L
      lperoma
    • 1.6.0.14: "Create new tasking" modal hangs on "Loading, please wait..." if the host has no image

      Just ran into something odd after upgrading to 1.6.0.14. I wanted to capture an image from a host that had no image assigned yet, clicked Capture in the host’s Tasks tab, and the “Create new tasking” modal just sat there on “Loading, please wait…” for good. No error, nothing.

      It took me a while to work out what was going on. The Apache access log shows the request coming back with a 400:

      GET /fog/management/index.php?node=host&sub=deploy&id=607&type=2  ->  400
      

      From a quick look at HostManagement::deploy() it seems to throw “Assigned image is invalid” when the host has no valid image, so I’m guessing that’s what the 400 says, but the modal never shows it.

      Setting an image in the host’s General tab fixed it right away. It would be nice if the modal showed the error, or if Deploy/Capture were greyed out when there’s no image, because from the UI it just looks like the page is broken.

      posted in FOG Problems
      L
      lperoma
    • Feature request: a "Troubleshooting" menu in the web UI to find hosts that fail to authenticate

      Hello everyone,

      First of all, thank you for FOG. We run it in a school (about 320 hosts, FOG 1.5.x on Debian 12) and it is a core part of how we deploy and maintain our PCs.

      I would like to propose a feature: a “Troubleshooting” (or “Host health”) menu in the web UI that lets an administrator find, in a few clicks, which hosts are failing to authenticate and what to do about it. Today this requires digging through server logs and the database, which is complicated and not realistic for most FOG admins. We had to write a script to do it, and I am sharing what it does as a starting point for the design.

      The problem

      FOG does not tell you when a host fails to authenticate. Nothing appears in the web UI or in any error log, because the server answers these requests with HTTP 200 even when it rejects the login. We only found out when somebody stood in front of the machine. Two cases kept hitting us:

      1. Rejected login in the iPXE menu. The user picks Deploy Image, types the credentials, the screen flickers and the menu comes back with no message. Server side, the only trace is the menu (boot.php) being requested again a few seconds later, and the kernel (bzImage / init.xz) never being downloaded. Our working theory (not fully confirmed yet) is the keyboard layout: iPXE uses a US layout, so passwords with symbols typed on another layout would arrive differently.
      2. Windows FOG client that cannot authorize. The host retries forever. The database shows no security token, or one that has not been renewed for days (hostSecToken / hostSecTime), and the client’s fog.log shows token or certificate errors. The usual fix is Reset Encryption Data, but nobody knows which hosts need it.

      What the menu should show

      Each item is something we currently detect by hand:

      • Hosts whose FOG client cannot authorize: missing or stale security token, or an abnormal number of authorization requests (a retry loop). Suggested action: Reset Encryption Data, then check fog.log on the client.
      • Hosts that fail the PXE login: repeated rejected logins without the kernel ever being downloaded. Suggested action: check the keyboard layout and the credentials.
      • Hosts with no contact for N days (configurable): so that machines that no longer exist can be removed and machines in use whose client silently stopped can be fixed.
      • For each one: host name, IP, since when, and the suggested action next to it.
      • Optionally, an e-mail digest through the existing notification mechanism.

      How our script detects it (for reference)

      A read-only shell/awk script that runs weekly from cron on the FOG server and e-mails a report. It never writes to FOG. It uses:

      • Apache access log (other_vhosts_access.log plus the rotated .gz files):
        • Rejected PXE logins: two POSTs to boot.php from the same IP within 120 s, with no kernel download in between. A host is listed after 3 rejections in the period.
        • Client not authorizing: we take the most frequent response size of /management/index.php?sub=requestClientInfo and of the authorize POSTs as “normal”, and flag IPs with several abnormal responses, or with too many authorizations in a single day (a normal host does about 47 a day; we flag above 100, which means a retry loop).
        • Mapping IP to host: the mac= parameter of requestClientInfo links an IP to the host MACs in the database.
      • FOG database (hosts, hostMAC) : the host token and its last renewal time. A host is flagged when its token is missing or older than its last failed request. It also gives the hosts with no sign of life for more than 15 days.

      Example of the summary it produces (host names removed):

      OVERALL STATUS: NEEDS ATTENTION
      
      SUMMARY
        Hosts whose FOG client cannot authorize....... 4
        Hosts that could not log in on PXE............ 4
        Hosts with no contact (over 15 days).......... 64
        Hosts active this week........................ 189
      
      1) HOSTS THAT CANNOT CONNECT TO FOG (Windows client)
         The client cannot authorize against the server.
         -> In the FOG web UI, open the host and click "Reset Encryption Data";
            then check the FOG log on the client.
         - HOST-A, since 03 Nov
         ...
      

      In a few weeks it found hosts with broken tokens that nobody had reported, a laptop that repeatedly failed the PXE login, and several machines in daily use whose FOG client had silently stopped working.

      Why it belongs inside FOG

      Parsing Apache logs is fragile and only works because we know the response sizes by heart. FOG already has the information: the hosts table, the token times and the requests it serves. The simplest native design would be to record an event (or a counter on the host) whenever a PXE login or a client authorization is rejected, with the reason, and build the menu on top of that.

      You are very welcome to take our script and keep it, use it, change it or build on it however you like, with no conditions. We do not have a public code repository, so if any developer wants it, reply here or send me a private message and I will share it. I can also explain the heuristics and thresholds in more detail, share anonymised log samples, or test a patch or plugin on our server if that helps.

      Thank you again for your work.

      posted in Feature Request
      L
      lperoma
    • RE: Update to working-1.6 fails with mysql: unrecognized service

      @Tom-Elliott Success. I switched to single-user with init 1, and installing systemd-sysv worked fine.

      As this is a machine upgraded from debian 11, maybe it wasn’t using systemd. Installation of 1.6 worked no problem Thanks,

      posted in Linux Problems
      L
      lperoma
    • RE: Update to working-1.6 fails with mysql: unrecognized service

      @JJ-Fullmer

      mariadb -V
      mariadb Ver 15.1 Distrib 10.11.6-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper

      posted in Linux Problems
      L
      lperoma
    • RE: Kernel Panic - not syncing, unable to mount root

      @bwilli78 my dell machine was wrongly identified as 32bit and sent bzimage32. You can: 1) update to dev-branch 1629 I should help. Or 2) send bzimage to 32bit machines. (Because they are wrongly identified).

      This could be your issue. I don’t see FOG sending bzimage32 anyway. Just a gut feeling. May be wrong.

      posted in FOG Problems
      L
      lperoma
    • 1
    • 2
    • 3
    • 1 / 3