Troubleshooting
This guide covers common issues and their solutions when running foxd.
Daemon Won't Start
Error: "Permission denied" when starting
Symptom:
Error: Failed to create packet capture: Permission deniedCause: foxd needs elevated privileges to capture packets.
Solutions:
Run with capabilities (recommended):
bashsudo setcap cap_net_raw,cap_net_admin=eip ./foxd ./foxdRun as root (not recommended):
bashsudo ./foxdCheck capabilities were set:
bashgetcap ./foxd # Should show: ./foxd = cap_net_admin,cap_net_raw+eip
Error: "No such device" or "Interface not found"
Symptom:
Error: No such device: eth0Cause: The configured network interface doesn't exist.
Solution:
List available interfaces:
baship link showUpdate config.toml with correct interface:
toml[daemon] interface = "wlan0" # or whichever interface existsOr use environment variable:
bashFOXD_INTERFACE=wlan0 ./foxd
Error: "Address already in use"
Symptom:
Error: Failed to bind to 0.0.0.0:8080: Address already in useCause: Another process is using port 8080.
Solutions:
Find what's using the port:
bashsudo lsof -i :8080 sudo netstat -tulpn | grep 8080Stop the conflicting service or change foxd's port:
toml[api] port = 8081
Database Error on Startup
Symptom:
Error: Failed to open database: database is lockedCause: Another foxd instance is running or database file is corrupted.
Solutions:
Check for running instances:
bashps aux | grep foxd sudo systemctl status foxdStop other instances:
bashsudo systemctl stop foxd killall foxdIf database is corrupted, restore from backup or delete:
bashmv foxd.db foxd.db.backup # foxd will create a new database on next start
Device Detection Issues
No Devices Being Detected
Symptom: foxd starts successfully but no devices appear in the console.
Diagnosis:
Check packet capture is working:
bash# Monitor logs for packet activity journalctl -u foxd -f | grep -i packet # Or if running in foreground, look for: # "Packet captured" or similar messagesVerify interface has traffic:
bashsudo tcpdump -i eth0 -c 10Check metrics:
bashcurl http://localhost:8080/api/metrics # Look at "packets_captured" - should be > 0
Solutions:
Wrong interface:
- Verify you're monitoring the correct network interface
- Use
ip link showto list interfaces - Update
config.tomlwith correct interface
No ARP/DHCP traffic:
- Some networks (especially with switches) may not broadcast ARP to all ports
- Try pinging devices to generate ARP traffic:
ping 192.168.1.1 - Check if you're on a VLAN or isolated network segment
BPF filter too restrictive:
- Remove or adjust the
capture_filterin config:
toml[daemon] # Comment out or remove this line # capture_filter = "arp or (udp port 67 or udp port 68)"- Remove or adjust the
Interface not up:
bashsudo ip link set eth0 up
Devices Detected But Immediately Go Offline
Symptom: Devices appear briefly then switch to offline status.
Cause: device_timeout_secs is set too low, or devices are actually inactive.
Solutions:
Increase timeout:
toml[daemon] device_timeout_secs = 600 # 10 minutes instead of defaultCheck neighbor table polling interval:
toml[daemon] neighbor_check_interval_secs = 30 # Check more frequentlyVerify devices are actually active:
baship neigh show # Look for your device's MAC address
Devices Show Wrong IP or Hostname
Symptom: Device MAC address is correct but IP or hostname is wrong or missing.
Cause:
- Device changed IP address
- Hostname not broadcast via DHCP
- Stale ARP cache
Solutions:
Wait for next update: foxd will eventually see the correct information
Force ARP refresh:
bash# From a device on the network ping 192.168.1.100 # IP of the device in questionCheck kernel neighbor table:
baship neigh show | grep aa:bb:cc:dd:ee:ffUse device nicknames: If hostname is unreliable, set a nickname via the console or API
Duplicate Devices
Symptom: Same device appears multiple times with different MACs.
Cause:
- Device has multiple network interfaces (Wi-Fi + Ethernet)
- MAC address randomization (privacy feature on phones)
- Virtual interfaces
Solutions:
- This is expected behavior - foxd tracks by MAC address, which is per-interface
- Use nicknames to identify which MAC corresponds to which device/interface
- MAC randomization: Some modern phones randomize MAC addresses. Check device settings to disable this feature if needed.
Notification Issues
Notifications Not Being Sent
Diagnosis Steps:
Check if rules are enabled:
bashcurl http://localhost:8080/api/rules # Verify "enabled": trueCheck rule matches your event:
- Verify
trigger_typematches the event - Check if
mac_filteris restricting matches - Ensure device actually triggered the event
- Verify
Check notification channels exist:
bashcurl http://localhost:8080/api/notifications # Verify channels are configuredCheck logs for errors:
bashjournalctl -u foxd | grep -i notification curl http://localhost:8080/api/logs | jq '.logs[] | select(.category=="notification")'Verify metrics:
bashcurl http://localhost:8080/api/metrics # Check "notifications_sent" increases
Telegram Notifications Failing
Symptoms:
- No messages received
- Errors in logs about Telegram API
Solutions:
Verify bot token:
bashTOKEN="your_bot_token" curl "https://api.telegram.org/bot${TOKEN}/getMe" # Should return bot informationVerify chat ID:
bash# Send a message to your bot first, then: curl "https://api.telegram.org/bot${TOKEN}/getUpdates" # Look for "chat":{"id":123456789}Test sending manually:
bashTOKEN="your_bot_token" CHAT_ID="your_chat_id" curl -X POST "https://api.telegram.org/bot${TOKEN}/sendMessage" \ -d "chat_id=${CHAT_ID}" \ -d "text=Test from foxd"Check firewall/network:
bashcurl -I https://api.telegram.org # Should return 200 or 302Update channel configuration:
- Delete and recreate the Telegram channel in foxd
- Ensure no extra spaces in bot token or chat ID
ntfy Notifications Failing
Symptoms:
- No notifications on ntfy app/website
- Connection errors in logs
Solutions:
Test topic manually:
bashcurl -d "Test message" https://ntfy.sh/your-topicVerify server URL:
- Must be full URL:
https://ntfy.sh - For self-hosted:
https://ntfy.example.com
- Must be full URL:
Check authentication:
- If topic requires auth, ensure token is set
- Test with token:
bashcurl -H "Authorization: Bearer tk_xxxxxxxxx" \ -d "Test" https://ntfy.sh/your-topicNetwork connectivity:
bashcurl -I https://ntfy.sh
Webhook Notifications Failing
Symptoms:
- Webhook endpoint not receiving data
- Connection errors in logs
Solutions:
Test endpoint manually:
bashcurl -X POST https://example.com/webhook \ -H "Content-Type: application/json" \ -d '{"test": "message"}'Check endpoint logs: Verify your webhook server is running and accessible
Verify URL is correct: Must be full URL with protocol
Test headers:
- If using authentication headers, verify they're correct
- Headers should be JSON object:
json{ "Authorization": "Bearer token123" }Firewall/network:
- Ensure foxd can reach the webhook URL
- Check for SSL certificate issues:
bashcurl -v https://your-webhook-url.com
Performance Issues
High CPU Usage
Symptom: foxd using >20% CPU continuously.
Diagnosis:
- Check packet capture rate:bash
curl http://localhost:8080/api/metrics | jq .packets_captured # Note the number, wait 10 seconds, check again
Solutions:
Reduce packet capture scope with BPF filter:
toml[daemon] capture_filter = "arp or (udp port 67 or udp port 68)"Increase polling intervals:
toml[daemon] neighbor_check_interval_secs = 120 # Check less frequentlyMonitor on smaller network segment: If possible, use a dedicated VLAN
Check for packet flood: Use
tcpdumpto see if there's unusual traffic
High Memory Usage
Symptom: foxd using excessive RAM.
Diagnosis:
Check number of devices:
bashcurl http://localhost:8080/api/metrics | jq .total_devicesCheck logs count:
bashsqlite3 foxd.db "SELECT COUNT(*) FROM logs;"
Solutions:
Enable log cleanup:
toml[daemon] log_cleanup_enabled = true log_retention_days = 7 # Keep less historyManually clean old logs:
bashsqlite3 foxd.db "DELETE FROM logs WHERE timestamp < datetime('now', '-7 days');" sqlite3 foxd.db "VACUUM;"Restart daemon: Memory will be cleared
Database Growing Large
Symptom: foxd.db file is many megabytes or gigabytes.
Diagnosis:
ls -lh foxd.db
sqlite3 foxd.db "SELECT name, COUNT(*) FROM sqlite_master JOIN (
SELECT 'devices' as name UNION ALL
SELECT 'logs' UNION ALL
SELECT 'rules' UNION ALL
SELECT 'notification_channels'
) USING(name) WHERE type='table' GROUP BY name;"Solutions:
Clean old logs:
bashsqlite3 foxd.db "DELETE FROM logs WHERE timestamp < datetime('now', '-30 days');" sqlite3 foxd.db "VACUUM;"Enable automatic cleanup:
toml[daemon] log_cleanup_enabled = true log_retention_days = 30Remove old offline devices:
bash# Backup first! cp foxd.db foxd.db.backup # Remove devices not seen in 90 days sqlite3 foxd.db "DELETE FROM devices WHERE status='offline' AND last_seen < datetime('now', '-90 days');" sqlite3 foxd.db "VACUUM;"
Web Console Issues
Console Not Loading
Symptom: Browser shows error or blank page.
Diagnosis:
Check API is accessible:
bashcurl http://localhost:8080/api/healthCheck browser console: Open browser dev tools (F12) and look for errors
Try different browser: Rule out browser-specific issues
Solutions:
Clear browser cache: Hard refresh (Ctrl+Shift+R or Cmd+Shift+R)
Rebuild console:
bashcd console pnpm install pnpm build cd ../daemon cargo build --releaseCheck foxd was built with console:
bash# Console files should be embedded strings foxd | grep "index.html"
Console Shows "Failed to fetch"
Symptom: Console loads but shows connection errors.
Cause: Browser cannot reach API (CORS, wrong URL, or daemon not running).
Solutions:
Verify daemon is running:
bashcurl http://localhost:8080/api/healthCheck browser URL matches daemon host/port:
- If daemon on
localhost:8080, browser must accesshttp://localhost:8080 - If on remote host, use IP:
http://192.168.1.100:8080
- If daemon on
Check firewall:
bashsudo ufw status sudo iptables -LBind to correct interface:
toml[api] host = "0.0.0.0" # Listen on all interfaces port = 8080
Logging and Debugging
Enable Verbose Logging
Set the RUST_LOG environment variable:
# Info level (default)
RUST_LOG=info ./foxd
# Debug level (verbose)
RUST_LOG=debug ./foxd
# Trace level (very verbose)
RUST_LOG=trace ./foxd
# Specific modules only
RUST_LOG=foxd_daemon=debug,axum=info ./foxdFor systemd service, edit the service file:
[Service]
Environment="RUST_LOG=debug"
ExecStart=/usr/local/bin/foxdView Logs in Real-Time
If running as systemd service:
# Follow logs
journalctl -u foxd -f
# Last 100 lines
journalctl -u foxd -n 100
# Filter by priority
journalctl -u foxd -p err # Errors onlyIf running in foreground: Logs print to stdout/stderr directly.
Via API:
curl http://localhost:8080/api/logs | jq .Common Log Messages
"Packet captured: ARP request"
- Normal operation, devices are being detected
"Device timeout: aa:bb:cc:dd:ee:ff"
- Device marked offline due to inactivity
"Rule matched: [rule name]"
- Notification rule triggered
"Failed to send notification"
- Notification delivery error, check channel configuration
"Database query error"
- SQLite error, may indicate corruption or locks
Getting Help
If you're still experiencing issues:
Check GitHub Issues: https://github.com/P8labs/foxd/issues
Create an issue with:
- foxd version (
./foxd --version) - Operating system and version
- Relevant configuration (redact tokens!)
- Command used to start foxd
- Error messages and logs
- Steps to reproduce
- foxd version (
Provide debug logs:
bashRUST_LOG=debug ./foxd 2>&1 | tee foxd-debug.log # Run until issue occurs, then share foxd-debug.log (redact sensitive info)Check documentation: