Agent Troubleshooting Guide¶
This guide helps diagnose and resolve common issues with KrakenHashes agents. Use this reference when agents fail to connect, register, sync files, detect hardware, or execute jobs.
Quick Diagnostic Commands¶
Before diving into specific issues, run these commands to gather diagnostic information:
# Check agent status
systemctl status krakenhashes-agent
# View recent agent logs
journalctl -u krakenhashes-agent -f --since "5 minutes ago"
# Check agent configuration
/path/to/krakenhashes-agent --version
cat ~/.krakenhashes/agent/.env
# Test connectivity to backend
curl -k https://your-backend:31337/api/health
# Verify certificate files
ls -la ~/.krakenhashes/agent/config/
openssl x509 -in ~/.krakenhashes/agent/config/client.crt -text -noout
Connection Issues¶
Agent Cannot Connect to Backend¶
Symptoms: - Agent logs show "failed to connect to WebSocket server" - Repeated connection retry attempts - Certificate verification errors
Common Causes:
-
Incorrect Backend URL Configuration
-
Certificate Issues
-
Network Firewall Blocking
Solutions:
-
Update Backend URL
-
Renew Certificates
-
Fix Network/Firewall
Connection Drops Frequently¶
Symptoms: - Agent connects but disconnects after short periods - WebSocket ping/pong timeouts - Frequent reconnection attempts
Causes and Solutions:
-
Network Instability
-
Backend Overload
-
Aggressive Firewall/NAT
Registration and Authentication Issues¶
Agent Registration Fails¶
Symptoms: - "Registration failed" errors - "Invalid claim code" messages - "Registration request failed" in logs
Common Causes:
- Invalid or Expired Claim Code
- Check admin panel for active vouchers
-
Generate new voucher if expired
-
Certificate Download Issues
-
Clock Synchronization Issues
Solutions:
- Get Valid Claim Code
- Access backend admin panel
- Go to Agent Management → Generate Voucher
-
Use the new claim code immediately
-
Manual Registration
Authentication Errors After Registration¶
Symptoms: - "Failed to load API key" errors - "Authentication failed" messages - Agent connected but backend rejects requests
Diagnostic Steps:
# Check credentials files
ls -la ~/.krakenhashes/agent/config/
cat ~/.krakenhashes/agent/config/agent.key
# Verify API key format (should be UUID)
grep -E '^[0-9a-f-]{36}:[0-9]+$' ~/.krakenhashes/agent/config/agent.key
Solutions:
-
Regenerate Credentials
# Remove existing credentials rm ~/.krakenhashes/agent/config/agent.key rm ~/.krakenhashes/agent/config/*.crt ~/.krakenhashes/agent/config/*.key # Re-register systemctl stop krakenhashes-agent /path/to/krakenhashes-agent --register --claim-code NEW_CLAIM_CODE --host your-backend:31337 systemctl start krakenhashes-agent
-
Fix Permissions
Hardware Detection Issues¶
No Devices Detected¶
Symptoms: - Agent shows "0 devices detected" - Missing GPU information in admin panel - Hashcat fails to find OpenCL/CUDA devices
Diagnostic Steps:
# Check if hashcat binary exists
ls -la ~/.krakenhashes/agent/data/binaries/
# Manually test hashcat device detection
find ~/.krakenhashes/agent/data/binaries -name "hashcat*" -type f -executable | head -1 | xargs -I {} {} -I
# Check for GPU drivers
nvidia-smi # NVIDIA
rocm-smi # AMD
intel_gpu_top # Intel
lspci | grep -i vga # General
Common Solutions:
-
Install GPU Drivers
-
Install OpenCL Runtime
-
Fix Hashcat Binary Issues
Partial Device Detection¶
Symptoms: - Some GPUs detected, others missing - Device count mismatch - Specific GPU types not showing
Solutions:
-
Mixed GPU Environment
-
PCIe/Power Issues
File Synchronization Problems¶
Files Not Downloading¶
Symptoms: - Wordlists/rules not available for jobs - "File not found" errors during job execution - Sync requests timing out
Diagnostic Steps:
# Check data directories
ls -la ~/.krakenhashes/agent/data/
ls ~/.krakenhashes/agent/data/wordlists/
ls ~/.krakenhashes/agent/data/rules/
ls ~/.krakenhashes/agent/data/binaries/
# Test file download manually
curl -k -H "X-API-Key: YOUR_API_KEY" -H "X-Agent-ID: YOUR_AGENT_ID" \
https://your-backend:31337/api/agent/files/wordlists/rockyou.txt \
-o /tmp/test_download.txt
Common Solutions:
-
Fix Authentication
# Verify API key is valid grep -o '^[^:]*' ~/.krakenhashes/agent/config/agent.key | head -1 # Test API authentication API_KEY=$(grep -o '^[^:]*' ~/.krakenhashes/agent/config/agent.key | head -1) AGENT_ID=$(grep -o '[^:]*$' ~/.krakenhashes/agent/config/agent.key) curl -k -H "X-API-Key: $API_KEY" -H "X-Agent-ID: $AGENT_ID" \ https://your-backend:31337/api/agent/info
-
Fix Directory Permissions
-
Clear Corrupted Downloads
Binary Extraction Failures¶
Symptoms: - Downloaded .7z files not extracted - Hashcat binary not executable - "No such file or directory" when running hashcat
Solutions:
-
Install 7-Zip Support
-
Fix Extraction Permissions
Job Execution Failures¶
Jobs Not Starting¶
Symptoms: - Tasks assigned but never start - Agent shows as idle despite task assignment - "No enabled devices" errors
Diagnostic Steps:
# Check agent task status
journalctl -u krakenhashes-agent | grep -i "task\|job" | tail -10
# Verify enabled devices in backend
# (Check admin panel Agent Details page)
# Test hashcat manually
HASHCAT=$(find ~/.krakenhashes/agent/data/binaries -name "hashcat*" -type f -executable | head -1)
$HASHCAT --help
Solutions:
- Enable Devices
- Go to backend Admin Panel
- Navigate to Agent Management
-
Select agent and enable required devices
-
Fix Hashcat Path
Jobs Crash or Stop Unexpectedly¶
Symptoms: - Jobs start but terminate quickly - "Process killed" messages - Hashcat segmentation faults
Diagnostic Steps:
# Check system resources
free -h
df -h ~/.krakenhashes/agent/data/
ps aux | grep hashcat
# Check for OOM kills
dmesg | grep -i "killed process\|out of memory" | tail -5
journalctl -f | grep -i "oom\|memory"
Solutions:
-
Resource Issues
-
Driver/Hardware Issues
Job Progress Not Reporting¶
Symptoms: - Jobs running but no progress updates - Backend shows tasks as "running" indefinitely - No crack notifications
Solutions:
-
Check WebSocket Connection
-
Restart Agent Connection
Performance Problems¶
Slow Hash Rates¶
Symptoms: - Lower than expected H/s rates - GPU underutilization - Benchmark speeds don't match job speeds
Solutions:
-
GPU Optimization
-
Cooling and Throttling
-
Hashcat Parameters
High System Load¶
Symptoms: - System becomes unresponsive - Other applications slow down - CPU usage constantly high
Solutions:
-
Limit Resource Usage
-
System Tuning
Error Message Reference¶
Common Error Patterns¶
Error Message | Cause | Solution |
---|---|---|
failed to connect to WebSocket server | Network/TLS issues | Check connectivity, renew certificates |
failed to load API key | Missing/corrupt credentials | Re-register agent |
registration failed | Invalid claim code | Generate new voucher |
failed to detect devices | Missing drivers/OpenCL | Install GPU drivers |
no enabled devices | Devices disabled in backend | Enable devices in admin panel |
file sync timeout | Network/authentication issues | Check API credentials |
hashcat not found | Missing/corrupt binary | Re-download binaries |
certificate verify failed | Expired/invalid certificates | Renew certificates |
connection refused | Backend not accessible | Check backend status |
permission denied | File/directory permissions | Fix ownership/permissions |
Debug Logging¶
Enable detailed logging for troubleshooting:
# Enable debug logging
echo "DEBUG=true" >> ~/.krakenhashes/agent/.env
systemctl restart krakenhashes-agent
# View detailed logs
journalctl -u krakenhashes-agent -f
# Disable debug logging after troubleshooting
sed -i '/DEBUG=true/d' ~/.krakenhashes/agent/.env
systemctl restart krakenhashes-agent
Recovery Procedures¶
Complete Agent Reset¶
When all else fails, completely reset the agent:
# Stop agent
systemctl stop krakenhashes-agent
# Backup current configuration
cp -r ~/.krakenhashes/agent ~/.krakenhashes/agent.backup.$(date +%Y%m%d)
# Remove all agent data
rm -rf ~/.krakenhashes/agent/
# Re-register with new claim code
/path/to/krakenhashes-agent --register --claim-code NEW_CLAIM_CODE --host your-backend:31337
# Start agent
systemctl start krakenhashes-agent
Emergency Job Cleanup¶
Force cleanup of stuck hashcat processes:
# Kill all hashcat processes
pkill -f hashcat
# Clean temporary files
find ~/.krakenhashes/agent/data/ -name "*.tmp" -delete
find ~/.krakenhashes/agent/data/ -name "*.restore" -delete
# Restart agent to reset job state
systemctl restart krakenhashes-agent
Certificate Recovery¶
Recover from certificate issues:
# Stop agent
systemctl stop krakenhashes-agent
# Download CA certificate manually
curl -k https://your-backend:31337/ca.crt -o ~/.krakenhashes/agent/config/ca.crt
# Use API key to renew client certificates
API_KEY=$(grep -o '^[^:]*' ~/.krakenhashes/agent/config/agent.key | head -1)
AGENT_ID=$(grep -o '[^:]*$' ~/.krakenhashes/agent/config/agent.key)
curl -k -X POST -H "X-API-Key: $API_KEY" -H "X-Agent-ID: $AGENT_ID" \
https://your-backend:31337/api/agent/renew-certificates
# Start agent
systemctl start krakenhashes-agent
When to Restart vs Reinstall¶
Restart Agent Service¶
- Connection drops
- Configuration changes
- Minor authentication issues
- After enabling/disabling devices
Restart System¶
- GPU driver updates
- System resource exhaustion
- Hardware changes
- Kernel updates
Reinstall Agent¶
- Corrupt binary files
- Persistent authentication failures after certificate renewal
- File system permission issues that can't be resolved
- Agent binary corruption
Complete Reset (Last Resort)¶
- Multiple interconnected issues
- System contamination from previous installations
- Unknown configuration corruption
- When restart and reinstall don't resolve issues
Use the diagnostic commands at the beginning of this guide to determine the appropriate recovery level.