Agent Disconnected
Symptom
An Agent that previously registered is offline in the console, zwallctl list-agents, or GET /api/v1/agents. Heartbeats stop. Hosting status is stale. Virtualization maps stop updating.
Likely verified causes
- Agent process stopped (
zwall-agent,zwall-hosting-agent, or loader). - Manager unreachable (treat as Manager Unavailable first).
- Manager
agents.timeoutelapsed (example"2m") since last heartbeat. Example Agentheartbeat_interval: 30s. - Agent JWT expired and refresh failed. Example:
auth.agent_token_ttl: "8h",auth.agent_refresh_before: "20m",auth.agent_expired_grace: "2m". - Clock skew. Hosting observation status
CollectedAtmust be within ±15 minutes of Manager time or the heartbeat is rejected. - TLS: Agent
verify_tls: true;allow_insecure_remote_tls: false. - Hosting heartbeat contract violation →
400 Invalid hosting observation heartbeat(must beobservation_onlywith Hosting profile identity; no active-control payload). - Hosting binding missing →
403 Hosting observation registration is not authorized. - Operator used
POST /api/v1/agents/:id/restartorzwallctl restart --agenton a Hosting Agent →409 Hosting observation Agents cannot receive restart commands. - Heartbeat hostname does not match the authenticated Agent principal →
403 Access denied. - Heartbeat without Agent JWT →
401 Agent authentication required.
Diagnostic commands/endpoints
zwallctl login --manager-url https://manager.example.com:8443 --username admin
zwallctl list-agents
zwallctl status --agent <id>GET /api/v1/agents
GET /api/v1/agents/:id
POST /api/v1/agents/heartbeat
POST /api/v1/agents/token/refreshHeartbeat is Agent JWT. Enterprise may wrap capability + optional mTLS (heartbeatWithMTLS). Body hostname is protocol-compatible but must identify the authenticated principal.
On the node:
sudo systemctl status zwall-agent
sudo journalctl -u zwall-agent -n 200 --no-pager
# Hosting
sudo systemctl status zwall-hosting-ebpf-loader
sudo systemctl status zwall-hosting-agent
sudo journalctl -u zwall-hosting-agent -u zwall-hosting-ebpf-loader -n 200 --no-pagerHosting admin (Enterprise):
GET /api/v1/agents/:id/hosting/statusRestart API (admin):
POST /api/v1/agents/:id/restartzwallctl restart --agent ID calls that path. zwallctl start / stop are not remote implementations (CLI).
What each result means
Scroll sideways to see the full table. Use the arrow keys when focused.
| Result | Meaning |
|---|---|
Agent status offline after ~agents.timeout (example 2m) | No successful heartbeat in the timeout window. Process, network, TLS, or token. |
| 401 on heartbeat | Missing/invalid Agent JWT or principal could not be reconciled. |
403 Access denied on heartbeat | Body hostname ≠ authenticated hostname. |
400 Invalid hosting observation heartbeat | Hosting contract failed: profile not hosting, incomplete identity, observation_only false, HostingStatus missing, active-control fields present (XDP/TC caps, blocked IPs, VMs, rule_count, eBPF status, UDP protection), prohibited mutation counters, or CollectedAt outside ±15m. |
403 Hosting observation registration is not authorized | No authoritative Hosting registration binding. |
409 Hosting profile transition is not pending/authorized | v1→v2 heartbeat without authenticated transition. |
409 Hosting observation Agents cannot receive restart commands | protection_model is hosting. Restart API is refused. |
200 restart {"success":true,"message":"Restart command sent to agent"} | Command recorded for a non-Hosting Agent. Handler does not guarantee an immediate SIGTERM from the Manager; the Agent acts on a later cycle. |
| TLS errors in Agent journal | Certificate verification failed. Do not “fix” with allow_insecure_remote_tls except break-glass. |
Hosting status runtime_available: false | No persisted Hosting status yet (no successful observation heartbeat). |
Token near token_expires_at | Agent should call POST /api/v1/agents/token/refresh (CapabilityAuthLifecycle). If clock is wrong, refresh and heartbeat both fail. |
Heartbeat required body fields: hostname, ip_address. Status if present must be online, offline, or error.
Safe remediation
- Confirm Manager ready (
GET /health/ready). - Confirm the Agent unit is active. Hosting: start loader first, then Agent. Stop Agent, then loader (
--detach). - Confirm
server.manager_urlmatches the reachable HTTPS Manager (examplehttps://manager.example.com:8443), not zwallctl’s default 8080. - Keep
verify_tls: true. Repair the Manager certificate chain. - If the JWT is expired and the Agent cannot refresh: issue a new one-time pre-register for recovery with explicit
agent_idmatching hostname and IP. Do not leaveauto_registeron. - Correct node clock (Hosting ±15m is product-enforced on
CollectedAt; admin/Agent JWT lifetimes are the 8h / 20m / 2m example). - Hosting: do not send Virtualization heartbeat fields. Do not use the restart API. Use:
sudo systemctl restart zwall-hosting-agent- Virtualization:
zwallctl restart --agent IDis allowed; it is still not a substitute for systemd if the Agent process is dead and cannot receive a later heartbeat action. - After recovery, confirm
list-agentsand, for Hosting,GET .../hosting/status.
Do-not-do warnings
- Do not use
zwallctl start/stopas remote power control. - Do not restart Hosting Agents through the Manager restart API (409 is correct).
- Do not set
allow_insecure_remote_tls: trueto mask a certificate problem. - Do not widen
agents.timeoutas a substitute for fixing heartbeats. - Do not treat Manager cluster as an Agent failover product. Example Agent
manager_urlsis cluster-oriented commentary; cluster is not certified HA. - Do not put Agent JWTs in tickets or command argv.
Escalation condition
Escalate when:
- Agent process is running, Manager ready is 200, TLS verifies, clocks agree, token is unexpired, and heartbeats still 401/403
- Hosting heartbeats that match the observation contract still return 400
- Non-Hosting restart API returns 200 but the Agent never restarts and systemd shows the process never received a command — the handler currently logs a request and returns success without a guaranteed remote SIGTERM
Related documentation
- Enrollment troubleshooting
- Agent / Manager trust
- Agent enrollment
- Service control
- Hosting troubleshooting
- Virtualization troubleshooting
- CLI
Edition
SHARED heartbeat and timeout. Hosting observation heartbeat contract, Hosting status API, and Hosting 409 restart are ENTERPRISE_ONLY.
Status
SUPPORTED. Restart-via-API for Virtualization is “command sent,” not a certified remote process manager.