Agent Troubleshooting
Common issues and their solutions for the Bloqd agent.
Diagnostic Commands
Quick Status Check
# Check agent service
systemctl status bloqd-agent
# Check fail2ban service
systemctl status fail2ban
# View recent agent logs
journalctl -u bloqd-agent -n 50
# Run agent status command
bloqd-agent --status
# Run health check
bloqd-agent --health-check
# Validate configuration
bloqd-agent --check
Connection Issues
Agent Not Connecting
Symptoms: Agent shows as offline in dashboard
Solutions:
-
Verify server URL in config:
grep url /etc/bloqd/agent.yaml -
Test connectivity:
curl -v https://bloqd.example.com/api/v1/health -
Check firewall:
# Allow outbound HTTPS
firewall-cmd --add-port=443/tcp --permanent
firewall-cmd --reload -
Check SSL certificate:
# For self-signed certs
server:
verify_ssl: false
API Authentication Failing
Symptoms: 401/403 errors in logs
Solutions:
-
Verify API key:
grep api_key /etc/bloqd/agent.yaml -
Check key is not expired/revoked in dashboard
-
Regenerate API key in Bloqd Settings → API Keys
Ban Reporting Issues
Bans Not Appearing in Dashboard
Solutions:
-
Check report socket exists:
ls -la /var/run/bloqd-agent/report.sock -
Test helper script:
/usr/local/bin/bloqd-report 192.0.2.1 sshd "test log" -
Verify fail2ban action is installed:
cat /etc/fail2ban/action.d/bloqd-report.conf -
Check jail uses the action:
grep "action.*bloqd" /etc/fail2ban/jail.d/*.conf -
Test with manual ban:
fail2ban-client set sshd banip 192.0.2.1
# Check dashboard
fail2ban-client set sshd unbanip 192.0.2.1
Socket Not Found
Symptoms: Socket not found in syslog
Solutions:
-
Ensure agent is running:
systemctl restart bloqd-agent -
Check socket directory permissions:
ls -la /var/run/bloqd-agent/ -
Verify reporter module is enabled:
modules:
reporter:
enabled: true
Whitelist Sync Issues
Whitelist Not Updating
Solutions:
-
Force manual sync:
# From dashboard: Server → Sync Whitelist
# Or via API -
Check sync logs:
journalctl -u bloqd-agent | grep -i sync -
Verify whitelist file:
cat /etc/fail2ban/bloqd-whitelist.txt -
Check API returns data:
curl -H "Authorization: Bearer API_KEY" \
https://bloqd.example.com/api/v1/whitelist/plain
IP Still Getting Banned
Solutions:
-
Verify IP is in dashboard whitelist
-
Check local whitelist:
grep "192.168.1.100" /etc/fail2ban/bloqd-whitelist.txt -
Reload fail2ban:
fail2ban-client reload -
Check jail config includes whitelist:
grep ignoreip /etc/fail2ban/jail.d/00-bloqd-base.conf
Service Issues
Agent Keeps Crashing
Solutions:
-
Check logs for errors:
journalctl -u bloqd-agent -p err -
Run in debug mode:
bloqd-agent --log-level DEBUG -
Check Python version:
python3 --version # Requires 3.10+ -
Reinstall agent package:
/opt/bloqd-agent/venv/bin/pip install --upgrade --force-reinstall \
/path/to/bloqd-agent.tar.gz
High Memory/CPU Usage
Solutions:
-
Increase intervals:
modules:
metrics:
interval: 600 # 10 minutes
health:
interval: 300 # 5 minutes -
Disable unused modules:
modules:
siem:
enabled: false -
Check for log file growth:
du -h /var/log/bloqd/
fail2ban Issues
fail2ban Not Starting
Solutions:
-
Check configuration:
fail2ban-client -t -
Check for syntax errors:
fail2ban-client -vvv start -
Review Bloqd jail configs:
ls -la /etc/fail2ban/jail.d/ -
Remove problematic jail:
rm /etc/fail2ban/jail.d/50-problem-jail.conf
fail2ban-client reload
Jail Not Starting
Solutions:
-
Check log file exists:
ls -la /var/log/nginx/access.log -
Verify filter exists:
ls /etc/fail2ban/filter.d/nginx-*.conf -
Test filter:
fail2ban-regex /var/log/nginx/access.log \
/etc/fail2ban/filter.d/nginx-botsearch.conf
Installation Issues
Install Script Fails
Solutions:
-
Check install log:
cat /var/log/bloqd-install.log -
Verify root access:
sudo -v -
Check OS compatibility:
cat /etc/os-release -
Install dependencies manually:
# Debian/Ubuntu
apt-get install -y python3 python3-pip python3-venv fail2ban curl jq
# RHEL/CentOS
dnf install -y epel-release
dnf install -y python3 python3-pip fail2ban curl jq
Token Expired
Solutions:
- Generate new install command in dashboard
- Tokens expire after 24 hours
Log Locations
| Log | Location |
|---|---|
| Agent log | /var/log/bloqd/agent.log |
| Install log | /var/log/bloqd-install.log |
| Systemd journal | journalctl -u bloqd-agent |
| fail2ban log | /var/log/fail2ban.log |
| Syslog messages | /var/log/syslog or /var/log/messages |
Getting Help
If issues persist:
-
Collect diagnostic info:
bloqd-agent --status > /tmp/bloqd-status.txt 2>&1
journalctl -u bloqd-agent -n 100 >> /tmp/bloqd-status.txt -
Check Bloqd documentation
-
Report issue with:
- OS version
- Agent version (
bloqd-agent --version) - Error messages
- Diagnostic output