Debugging and Troubleshooting Runbook
This guide provides systematic approaches to debugging and resolving common issues within the AlphaSwarm platform.
Quick Reference: Enable Debug Mode
Backend (Worker & Agents)
Set the log level to DEBUG in your environment:
export ALPHASWARM_LOG_LEVEL=DEBUG
Frontend (Next.js)
Enable verbose logging in the browser console by setting:
localStorage.setItem('alphaswarm_debug', 'true');
Common Issues and Solutions
1. API Connectivity Issues
Symptom: Frontend shows "API Unavailable" or 504 errors.
- Check: Is the
alphaswarm-apipod running? - Command:
kubectl get pods -l app=alphaswarm-api - Solution: Check logs for crash loops:
kubectl logs -l app=alphaswarm-api --tail=100.
2. Worker/Agent Failures
Symptom: Backtests or trades are stuck in PENDING or FAILED.
- Check: Celery/Ray worker logs.
- Command:
alphaswarm-cli bots logs <bot-id> - Solution: Often due to missing credentials or unreachable data sources (e.g., QuestDB).
3. Database Connection Issues
Symptom: "Connection refused" to PostgreSQL or Neo4j.
- Check: Service endpoints and passwords.
- Solution: Verify
DATABASE_URLandNEO4J_PASSWORDenvironment variables match the secret store.
Observability Tools
- Loki/Grafana: Centralized log search and metric dashboards.
- Sentry: Error tracking and alerting.
- AlphaSwarm CLI: Use
alphaswarm status systemfor a quick health check.
Systematic Debugging Steps
- Isolate the Component: Is it the UI, API, Worker, or Database?
- Check Logs: Always start with
tail -fon the relevant component. - Verify Environment: Run
alphaswarm-cli setup verifyto check prerequisites and env vars. - Reproduce Locally: Use the local dev stack (
make dev) to reproduce the issue in a controlled environment.
Further Documentation
- For incident response procedures, see Incident Response.
- For detailed architecture, see Architecture Index.
- For project-wide index, see AlphaSwarm Index.