Troubleshooting the FOG Agent
FOG 1.6 and later
This page is about the FOG Agent, which works only with a FOG 1.6 server. For the legacy FOG client see Install the FOG client.
Two things answer most questions. On the machine, the agent’s log:
C:\ProgramData\FOG\fog-agent.log on Windows, journalctl -u fog-agent on
Linux. It writes one line per change of state rather than one per poll, so
a quiet log is a healthy one, and it never contains a key, certificate or
token, so it is safe to attach to a forum post. On the server, the host’s
History Items → Agent Activity tab, which carries every result and the
reason for every failure the agent reported. Start with whichever you can
reach.
The install fails on Windows
Read the msiexec log you asked for with /l*v. Two things fail the
install on purpose: a CA path that does not exist or is not a PEM file,
and a state directory the installer cannot write. A server that is not
answering does not fail the install; the token is kept and the service
keeps trying.
If the installer exits 1603 and the log shows the Setup action exiting
2, an older unversioned fog-agent.exe was left on disk by a hand
install or a rolled-back attempt. Delete %ProgramFiles%\FOG\fog-agent.exe
and run the MSI again.
Windows SmartScreen warning on install, or Defender quarantining the binary: releases are not yet code-signed. See the download section of Install the FOG Agent.
It never enrolls
Run fog-agent status. enrolled: false with has_key: true means the
request is being made and is not being answered with a certificate. The
log says which case you are in.
“pending approval on the server (reason); waiting”. Someone has to approve it on Host Management → Pending Agents, or you need a token. The reason tells you what the server saw; the table on Install the FOG Agent explains each. Two are worth pausing on:
rebind: the host record already has a different agent key bound for this same OS. If you reimaged the machine outside FOG, or reinstalled the OS by hand, this is expected: approve it. If you did neither, something else is presenting this machine’s firmware identity. On a server without dual-boot support (before the December 11, 2026 stable release), the other OS of a dual-boot machine also arrives asrebind, and approving it retires the first OS’s key.new-seat: the host has an agent on a different OS, as on a dual-boot machine. Approve it to add an agent for this OS. See Dual-boot hosts.identity-conflict: the firmware identity matches more than one host. Usually two host records for one machine, one registered by MAC years ago and one by a shared USB NIC. Merge or delete one, then the agent’s next attempt matches cleanly. Host Identity explains how FOG matches firmware identity. A second cause is a firmware default that many machines share. On some hardware,dmidecode -s chassis-asset-tagprintsAsset-1234567890. Before the December 11, 2026 stable release, FOG uses that value as a tiebreaker, so an unrelated host can win the match. The fix ignores that value. On an older server, clear the asset tag in the firmware setup, or set a unique asset tag for each machine. If another shared default causes the same conflict, add it toFOG_HOST_IDENTIFY_SMBIOS_IGNOREon FOG Settings → General Settings.seat-removed: an admin removed this agent’s seat on the host page. A token does not approve it. Approve it on Pending Agents to let this key back in, or deny it. See Removing an agent seat.
“denied by the server; retrying hourly”. An admin denied this key. The agent will never be approved with that key. Stop the service, delete the state directory, start it again, and it arrives as a new pending agent.
“server does not support agent protocol 1”. The server URL points at a
FOG 1.5 server, or at a 1.6 server whose web root does not serve the
/agent/ routes. Check that https://fogserver/fog/agent/v1/enroll
answers with JSON rather than a redirect to the login page. On a server
upgraded from an older 1.6 build, re-running the installer writes the
<Location /fog/agent/> block the web server needs.
A TLS error naming the certificate. The agent trusts only the bundle
you gave it. If the web UI uses FOG’s own CA, the bundle must be
management/other/ca.cert.pem from this server; if the web UI uses a
public certificate, the bundle must be that public CA. A server whose
certificate was re-minted since the agent was installed needs the new
bundle: run fog-agent run --once --ca newbundle.pem (Windows: re-run the
MSI with CA=) and the agent stores it for every later poll.
Nothing at all in the log. The service is not running or cannot reach
the server. fog-agent service status on Windows, systemctl status fog-agent on Linux. Then try fog-agent run --once from an administrator
or root shell, which prints what the service would have logged.
It was enrolled and stopped checking in
“server no longer recognizes this certificate; enrolling again”. The
host was deleted from FOG, or a different agent key was approved for it. The
agent has done the right thing: it dropped its certificate and is pending
again as reissue or rebind. Approve it if that is what you meant.
“server refused this certificate (…); keeping it and retrying”. A 401 that is not about this host’s binding: the database was down, a proxy answered instead of FOG, or the web root stopped serving the agent routes mid-upgrade. The agent keeps its certificate because re-enrolling would cost you an approval, and retries. Fix the server; the agent recovers on its own. It gives up and re-enrolls only after seven days of continuous refusal.
Last Agent Check-In is old but Last Successful Ping is recent. The machine is up and the agent is not talking. Same steps as “nothing at all in the log” above.
A capability reports a failure
Every one of these appears in Agent Activity with the agent’s own sentence about why.
Software: every entry is cannot_run. Chocolatey is not at
%ProgramData%\chocolatey\bin\choco.exe. Install it, set the Chocolatey
Install Script setting so the agent installs it, or ship it in the image.
The agent checks for the binary every poll and converges as soon as it
appears. See Software Management.
Software: Flatpak or Snap entries are cannot_run. The tool is not
installed on the host. Install Flatpak or snapd. The agent checks again at
every poll and converges after that. See
Flatpak and Snap.
Software: WinGet entries are cannot_run with “winget is not installed”.
App Installer is not on the host, which is common on Windows Server and
LTSC editions. Install App Installer in the image. The agent checks again at
every poll. See WinGet.
Software: a WinGet entry is cannot_run with “this agent has no winget
backend”. The host runs fog-agent 0.1.28 or earlier. Update the agent to
0.1.29 or later.
Software: a WinGet entry is cannot_run with “winget cannot use the
msstore source from the service”. The entry’s Source is msstore. The
Microsoft Store source does not work under SYSTEM. Use the winget source.
Software: Snap reports “cannot communicate with server”. The snapd
socket is not running. Run sudo systemctl enable --now snapd.socket.
Software: a Flatpak entry on a Windows host is cannot_run. The details
say “flatpak runs only on Linux”. Put Windows and Linux hosts in separate
groups.
Software: retry that never clears. Another installer is holding the
Windows Installer mutex on every check. Look for a stuck msiexec on the
machine.
Printers: unsupported against every printer. The agent could not read
the installed printer set, so it refused to touch anything rather than
reinstall the lot. On Windows that is usually the Print Spooler service
stopped. On Linux, CUPS is not running.
Printers: a printer will not install. The URI or driver is wrong for
that machine. The error the spooler gave is in the paError column of the
Printer Deployment report and in Agent Activity. An empty driver against
a socket://, lpd:// or smb:// URI makes a raw queue; an empty driver
only means driverless against an ipp:// or ipps:// URI.
Directory: the join succeeded and now I cannot reach the machine. On Windows a join moves the network profile from Private to Domain, and firewall rules scoped to Private stop applying. RDP usually survives; ping and SSH often do not. The agent is fine, because its traffic is outbound. Scope your inbound rules to the Domain profile.
Hostname: pending ... this one runs after <time>. A domain rename
waits for the server’s gap between join and rename attempts. The gap is
one hour, or FOG_AGENT_JOIN_COOLDOWN on FOG 1.6.0-RC-11 and later. This
is normal after a join, or after a second rename within the gap. Leave
it: the rename runs on the first poll after that time. To skip the wait on
FOG 1.6.0-RC-11 and later, reimage the host: a completed deploy task
clears it. See
Renaming a machine that is already in a domain.
Hostname: failed ... this machine is in a domain ... the server sent no rename. The agent will not rename a domain member alone, and the server
did not send the rename. Check these in order:
- The server is FOG 1.6.0-RC-8 or later. Earlier servers never send a rename to a joined host.
- The host’s Active Directory tab has the domain, username and password, and the domain matches the one the machine is in.
- An agent older than 0.1.13 cannot tell you about the wait, and reports
it as this failure. Look at the time of the last join or rename. If it
was within the wait (one hour, or
FOG_AGENT_JOIN_COOLDOWN), wait.
Directory: failed (access denied; the AD account may not rename computer objects in this OU ...). The join account may create computer objects
but not rename them. Grant it write access to sAMAccountName,
dNSHostName and servicePrincipalName, and the right to rename, on
computer objects in that OU.
Directory: a Linux host joined but users cannot log on with domain
accounts. Expected. The agent joins with adcli, which creates the
machine account and keytab and configures no name service. sssd or winbind
is still yours to configure.
Directory: the OU in FOG changed and the computer object did not move.
Server-side placement is off by default. Set FOG_DIRECTORY_PLACEMENT_ENABLED
and the FOG_DIRECTORY_* bind account, delegated to move computer objects
in the right subtree. The Directory Membership report shows the drift
and the last placement error.
Directory Membership: the Join cell is blank for a host that joined after a
Deploy. Through FOG 1.6.0 stable, the report read only the agent’s own join
result. A join after a Deploy uses the rejoin protocol, which records its
result elsewhere, so the cell stayed blank. The host is joined. On an install
before the UTC storage change with a non-UTC time zone, the join wait could
also end early or late by the zone offset. Both are fixed on dev-branch
(fogproject#2125) and reach stable with the next stable release. Until then,
check the host’s Active Directory tab for the rejoin result. The
Join column
table lists every value.
Directory: “rejoin: blocked (directory_observation_unknown)” and the
workgroup PC never joins. The host’s Active Directory tab can also show
“Current directory observation does not match this host”. That line is normal
for a PC that has not joined yet. The server joins a workgroup PC only when it
knows the PC is in a workgroup. The agent sends that report only when its
membership changes. FOG 1.6.0.158 and earlier read the report only from the
poll that carried it. A server upgraded from 1.6.0 or 1.6.0.14 never got the
report again, so every workgroup PC stayed blocked. Fixed on dev-branch
(fogproject#2142): the server reads the report it stored. The fix reaches
stable with the next stable release. Until then, run this in the fog
database. It sets the workgroup flag on every host that the server has stored
as an unjoined workgroup PC:
UPDATE hostDirectory
SET hdRejoinState = JSON_MERGE_PATCH(hdRejoinState, '{"workgroup":true}')
WHERE hdJoined = 0 AND hdKind = 'workgroup' AND hdRejoinState IS NOT NULL;The PC joins at its next agent poll. A PC that is already in a domain is not affected, because the join also requires that the PC reports no domain. If a PC deployed later shows the same line, run the statement again.
Directory: “rejoin: blocked (directory_observation_unknown)” on a FOG 1.6.1 server, and the workgroup statement above does not help. FOG 1.6.1 uses this one reason for five different causes. Later servers name the cause, and agents that know the new reasons add what to check. See the reason table in AD Rejoin and OU Placement. On 1.6.1, check these on one affected PC:
- Is the deployed image joined to a domain? An image captured in the domain and renamed by the Deploy has no computer account for the new name. The secure channel check then gives no answer, and the host stays blocked. Capture the image out of the domain.
- Does the host’s Domain Name in FOG match the domain the PC is in?
- Can the PC reach the domain controller on TCP port 445?
Directory: a re-imaged workgroup PC stays blocked with
“rejoin: blocked (directory_observation_unknown)” or
“rejoin: blocked (directory_membership_unknown)”. In Reports, then
Directory Membership, the host’s Observed domain still shows a
domain, and Reported is older than the Deploy. The PC was in the domain
before the Deploy. The agent sends a fact only when it differs from the copy
it saved of the last one it sent. That copy is on the disk, so an image can
bring back an older copy that matches the new disk. The agent then sends
nothing, and FOG keeps the old “joined” record. FOG 1.6.1 and earlier ask
again only for a fact they never stored. Fixed on dev-branch
(FOGProject/fogproject#2403): after a completed Deploy, the server asks the
agent for every fact again. The fix reaches stable with the next stable
release. Until then, run this in the fog database for each affected host.
Replace PC-NAME with the host’s name in FOG:
DELETE FROM hostFactState
WHERE hfsHostID = (SELECT hostID FROM hosts WHERE hostName = 'PC-NAME');This deletes only FOG’s record of which facts it has. At its next poll, the
agent sends all its facts again, and the PC joins at the poll after that.
For a lab whose host names start with LAB1-, use this:
DELETE FROM hostFactState
WHERE hfsHostID IN (SELECT hostID FROM hosts WHERE hostName LIKE 'LAB1-%');Directory: the “Confirm that this account is assigned to this host”
checkbox does nothing. Through FOG 1.6.1, the tab saved the confirmation
but never showed it, and the checkbox always shows clear. The confirmation
was saved. Later servers show the account under Confirmed account. They
also rebind after a Deploy task with no confirmation, so a re-imaged lab
needs no click for each host. If the host is also blocked with a
directory_* reason, fix that first. The confirmation is not read until
that block clears.
Directory: failed: the computer object exists and domain policy blocks this account from reusing it (NERR_AccountReuseBlockedByPolicy). An
account with the host’s name exists in AD. Since Microsoft KB5020276,
Windows lets a join reuse an existing account only when the join account
created it, is a domain admin, or is listed in the Group Policy setting
Domain controller: Allow computer account re-use during domain join.
List FOG’s join account in that setting, or delete the old computer account
and let FOG create a new one. Do not make the join account a domain admin:
that turns the check off, so a wrong host name can take over another
computer’s account.
Snapin: a large snapin never runs, and the log shows “fetch: context deadline exceeded (Client.Timeout or context cancellation while reading body); will retry next poll”. Up to agent v0.1.35, the agent gave a whole snapin download 30 seconds. A large file, such as a Microsoft Office installer, takes longer than that, so the download stopped part of the way and started again at every poll. Small snapins were not affected. Agent v0.1.36 and later have no limit on the total download time. They stop a download only when the server sends no data for two minutes. On an older agent, make the snapin file smaller, for example an installer that downloads its own payload, or update the agent.
A snapin that reboots in the middle of an install is not run again after
the reboot. The snapin task is closed and the install stays half done. The
installer exits with its own “reboot needed” code, for example 11641, 13010
or -125071. That code is not in the snapin’s Return Codes table, so FOG
treats it as failed and closes the task. On FOG 1.5, the legacy client
often did not report the result before the shutdown. To fix it, map the code
to reboot_rerun in the Return Codes table, for example
11641=reboot_rerun. This needs a FOG 1.6 server with schema 492 or later,
and fog-agent 0.1.38 or later. The agent then reboots the computer and runs
the snapin again, up to the snapin’s Max reboot re-runs limit (default 5).
See
Installers that reboot mid-install.
On older versions, stop the installer from rebooting by itself. Return 3010
from the script, so that FOG does the reboot. Or split the install into one
snapin for each stage.
Snapin or update: “payload: the FOG server at … sent no data for 2m0s”. Agent v0.1.36 and later show this line when a download starts and then the server stops sending. Check the network between the machine and the server, and the load on the server. The agent tries again at its next poll.
Task reboot: “the firmware lists no network boot entry to arm”. The machine’s UEFI has a boot manager with no network boot option, usually because PXE or network boot is disabled in firmware setup. The agent refuses to reboot for the task, because the reboot would land on the local disk and achieve nothing. Enable network boot in the firmware. The task stays queued and runs at the next poll after you do. VirtualBox guests behave this way by design and cannot be netbooted from an agent-armed entry.
Lenovo ThinkPads showed this line up to agent v0.1.31 even with network boot
enabled. Their firmware has one generic PXE BOOT entry, and those agent
versions did not recognize it. Agent v0.1.32 and later arm it. On an older
agent, update the agent. As a one-time workaround, set the next boot from an
elevated prompt in Windows, then restart:
bcdedit /set {fwbootmgr} bootsequence {<id of the PXE BOOT entry>}.
bcdedit /enum firmware lists the entry and its id.
“update: deferred, a reboot is pending” on every poll, next to the line above. Up to agent v0.1.32, the agent deferred its self-update while a task reboot was pending, even a task reboot it refused to do. So a host with a stuck task never updated. Agent v0.1.33 and later update anyway. On an older agent, cancel the queued task. The agent updates at its next poll. Then queue the task again.
The same line also showed up to agent v0.1.33 when a reboot was waiting for a signed-in user to leave, for example after a software install. A PC where someone stayed signed in got no agent updates. Agent v0.1.34 and later update while the reboot waits. On an older agent, sign the user out or restart the PC once. The agent updates at its next poll.
The machine reboots for a task, comes back to Windows, and the task is
still queued. A BIOS machine, or a UEFI machine where arming succeeded
but the firmware ignored BootNext. The agent does not reboot a second
time for the same task in the same boot. Set the firmware boot order to
network first, as the legacy client always required.
On an IPv6-only network, agents up to v0.1.34 also did this. They always armed the IPv4 network boot entry, which finds no DHCPv4 server there. Agent v0.1.35 and later arm the IPv6 entry when the machine has no usable IPv4 address. On an older agent, turn off the UEFI IPv4 network stack in firmware setup, so that only the IPv6 entry remains.
Auto log out never fires on a Linux desktop. The desktop environment
is not telling logind it is idle, so the agent cannot know and does
nothing, which is the safe direction. Check loginctl show-session <id> -p IdleHint.
A user was logged off with no warning. FOG_CLIENT_AUTOLOGOFF_WARN is
0, or the session is a graphical Linux session, which the agent cannot warn.
Installed Software shows only one OS on a dual-boot host
Symptom. On a host with two agent seats (a dual-boot machine), the Installed Software tab lists the programs of one OS only. The list switches to the other OS after that OS checks in. The host’s history shows an entry like this at each switch:
agent reported 565 installed programs: 565 added, 17 removed
Cause. A server before database schema 469 keeps one installed-software list per host. Each OS reports its complete list, so each report closed the programs of the other OS.
Fixed in. Database schema 469 on the FOG 1.6 Patches channel. The list is now kept per OS, and the tab and the Installed Software report show an OS column. After the update, each OS sends its list again at its next check-in. See Dual-boot hosts.
Workaround on an older server. None that keeps both lists. Read the list right after the OS you care about checks in.
Not a dual-boot machine? If the host should have one OS, check General → Agent Seats. A second seat means another machine with the same firmware identity enrolled as a new OS, for example a cloned virtual machine that kept the original’s system UUID. Give the clone a new system UUID, then remove its seat with Remove on that line. See Removing an agent seat.
Two agents on one machine
If the legacy FOG client and the agent are both installed, whichever polls first consumes an on-demand shutdown or a queued snapin and the other never sees it, and both report to the same host record. The MSI removes the legacy client; a hand install does not. Uninstall “FOG Service” from Apps & Features on Windows, or stop and remove the legacy service on Linux.
Starting over on one machine
Stop the service, delete the state directory
(%ProgramData%\FOG\agent or /var/lib/fog-agent), start it again. The
agent generates a new key and arrives on Pending Agents as a new request for
the same host, with reason rebind, because the host still has the old key
bound. Approving it replaces the binding.