Agent Troubleshooting Guide
Common issues and solutions for Infracast Agent deployments.
Connection Issues
Agent fails to register
Symptoms:
connection refusedortimeouterrors during registration- Agent never appears in UI
Solutions:
-
Check network connectivity:
curl -v https://api.infracast.io/healthz -
Verify proxy settings (if applicable):
export HTTPS_PROXY=http://proxy.example.com:8080
infracast-agent register --server https://api.infracast.io --token TOKEN -
Check enrollment token:
- Token may be expired (check expiration in UI)
- Token may have reached max uses
- Generate a new token and retry
-
Firewall rules:
- Ensure outbound HTTPS (443) is allowed
- Some firewalls require explicit allow for the domain
Agent shows "Offline" immediately after going "Online"
Cause: Usually a firewall or proxy dropping long-lived connections.
Solutions:
- Check if corporate proxy has idle connection timeout
- Verify no DPI (Deep Packet Inspection) is interfering with HTTPS
- Check for split-horizon DNS issues
Discovery Issues
No software packages discovered
Cause: Agent lacks permission to read package databases.
Solutions:
Linux:
# Agent needs read access to:
# /var/lib/dpkg/status (Debian/Ubuntu)
# /var/lib/rpm/rpmdb.sqlite (RHEL/Fedora)
# Check permissions
ls -la /var/lib/dpkg/status
ls -la /var/lib/rpm/
# Agent typically needs to run as root for full discovery
Windows:
# Agent needs read access to HKLM:\SOFTWARE
# Run agent service as LocalSystem or Administrator
No processes discovered
Cause: Agent can't access process information.
Solutions:
Linux:
# Agent needs access to /proc
# Typically requires root for full process details
# Verify /proc is mounted
mount | grep proc
# Check if running in container without host PID namespace
# Add: hostPID: true in Kubernetes DaemonSet
Windows:
# Agent service needs SeDebugPrivilege for full process info
# Run as LocalSystem
No firewall rules discovered
Cause: Agent can't execute firewall query commands.
Solutions:
Linux:
# iptables requires root
sudo iptables -L -n
# Or capabilities:
sudo setcap cap_net_admin+ep /usr/local/bin/infracast-agent
macOS:
# pfctl requires root
sudo pfctl -sr
Windows:
# netsh requires Administrator
netsh advfirewall show allprofiles
Service Issues
Agent service won't start (Linux)
Check logs:
journalctl -u infracast-agent -n 50 --no-pager
Common causes:
-
Missing config file:
ls -la /etc/infracast-agent/config.json
# If missing, re-run registration -
Permission denied:
# Ensure binary is executable
chmod +x /usr/local/bin/infracast-agent -
SELinux blocking:
ausearch -m avc -ts recent | grep infracast
# If blocked, create policy or run in permissive
Agent service won't start (Windows)
Check Event Viewer:
- Open Event Viewer
- Navigate to Windows Logs → Application
- Filter by Source: InfracastAgent
Common causes:
-
Missing dependencies:
- Install Visual C++ Redistributable if needed
-
Service account permissions:
- Ensure service account has "Log on as a service" right
Agent service won't start (macOS)
Check logs:
log show --predicate 'subsystem == "io.infracast.agent"' --last 1h
Common causes:
-
Gatekeeper blocking:
# Remove quarantine attribute
xattr -d com.apple.quarantine /usr/local/bin/infracast-agent -
TCC (Transparency, Consent, and Control):
- Grant Full Disk Access in System Preferences → Privacy & Security
Performance Issues
High CPU usage
Cause: Collectors running too frequently or hanging.
Solutions:
-
Increase scan interval: Edit
/etc/infracast-agent/config.json:{
"scan_interval_seconds": 600
} -
Check for runaway process discovery:
- On systems with thousands of processes, discovery is expensive
- Consider filtering process discovery
High memory usage
Cause: Large discovery reports accumulating.
Solutions:
-
Check report size:
- Systems with many packages/processes generate large reports
- Default report retention is minimal (current + previous)
-
Restart agent:
sudo systemctl restart infracast-agent
Token and Authentication Issues
"Token revoked" error
Cause: Agent token was revoked from the UI.
Solution:
- Generate new enrollment token in UI
- Re-register agent:
sudo infracast-agent register --server URL --token NEW_TOKEN --force
"Token expired" error
Cause: JWT token has exceeded its validity period.
Solution:
- Agent should automatically refresh token on heartbeat
- If persistent, re-register with new enrollment token
"Tenant mismatch" error
Cause: Agent registered to different tenant than current token.
Solution:
- Revoke agent in original tenant
- Re-register with correct tenant's enrollment token:
sudo infracast-agent register --server URL --token TOKEN --force
Kubernetes-Specific Issues
Agent pods in CrashLoopBackOff
Check logs:
kubectl logs -n infracast -l app=infracast-agent --tail=100
Common causes:
-
Missing enrollment token secret:
kubectl get secret -n infracast infracast-agent-token
# If missing, create it:
kubectl create secret generic infracast-agent-token \
--from-literal=token=YOUR_TOKEN -n infracast -
Insufficient permissions:
- DaemonSet needs
hostPID: trueandhostNetwork: true - SecurityContext may need
privileged: true
- DaemonSet needs
Agents all showing same hostname
Cause: Using pod hostname instead of node hostname.
Solution: Add to DaemonSet spec:
env:
- name: HOSTNAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
Getting Help
If issues persist:
-
Collect diagnostics:
infracast-agent diagnostics > /tmp/agent-diag.txt -
Include:
- Agent version:
infracast-agent version - OS version:
uname -aorsysteminfo - Relevant log excerpts
- Network trace if connectivity issue
- Agent version:
-
Contact support or file GitHub issue with diagnostics attached.