Troubleshooting
Quick fixes for common issues.
Backend
Database connection refused
sqlalchemy.exc.OperationalError: could not connect to server
Fix: Ensure PostgreSQL is running and DATABASE_URL is correct.
docker compose ps # Check if db container is healthy
docker compose logs db # Check for errors
Redis connection failed
redis.exceptions.ConnectionError: Error connecting to localhost:6379
Fix: Redis is optional. App works without it (caching disabled).
# To disable Redis explicitly:
REDIS_ENABLED=false
ChromaDB not responding
chromadb.errors.ChromaError: Could not connect
Fix: Check ChromaDB container or local instance.
docker compose logs chromadb
curl http://localhost:8000/api/v1/heartbeat # Should return {"nanosecond heartbeat":...}
LLM provider errors
anthropic.APIError: Invalid API key
Fix: Check ANTHROPIC_API_KEY in .env. For local development without API key:
LLM_PROVIDER=ollama # Use local Ollama
# or
USE_MOCK_LLM=true # Use mock responses
Production startup fails
ProductionConfigError: PRODUCTION CONFIGURATION ERROR
Fix: When APP_ENV=production, security checks are enforced. Ensure:
JWT_SECRETis set (not default)API_KEYis set (not default)COOKIE_SECURE=trueDEBUG=falseCORS_ORIGINSincludes your domain
Frontend
Blank page / JS errors
Fix: Check browser console. Common causes:
- Backend not running → API calls fail
- Wrong
VITE_API_URL→ Check.env - Build cache stale →
npm run buildfresh
CORS errors
Access-Control-Allow-Origin header missing
Fix: Add your frontend URL to CORS_ORIGINS in backend .env:
CORS_ORIGINS=http://localhost:5173,https://yourdomain.com
Auth token expired
401 Unauthorized on API calls
Fix: Frontend auto-refreshes tokens. If persistent:
- Clear localStorage:
localStorage.clear() - Log in again
Docker
Container won’t start
docker compose logs <service> # Check specific service
docker compose down -v # Nuclear option: reset volumes
docker compose up --build # Rebuild images
Out of disk space
docker system df # Check usage
docker system prune -a # Remove unused images/containers
docker builder prune # Clear build cache
Port already in use
Bind for 0.0.0.0:5432 failed: port is already allocated
Fix: Stop conflicting service or change port in docker-compose.yml.
Background Jobs (RQ)
Jobs stuck in queue
docker compose exec backend rq info # Check queue status
docker compose logs worker # Check worker logs
Fix: Restart worker:
docker compose restart worker
Newsletter not sending
- Check
NEWSLETTER_DRY_RUN=falsein production - Verify
RESEND_API_KEYis set - Check worker logs for errors
Quick Diagnostics
# Health check
curl http://localhost:8000/health
# API version
curl http://localhost:8000/api/v1/
# Database connectivity (from backend container)
docker compose exec backend python -c "from db.connection import engine; from sqlalchemy import text; print(engine.connect().execute(text('SELECT 1')).scalar())"
Getting Help
- Check logs:
docker compose logs -f - Search GitHub Issues
- Open a new issue with:
- Error message
- Steps to reproduce
- Environment (OS, Docker version)