Troubleshooting Guide
Common issues and solutions for the Agnostic Automation Center.
๐ Startup Issuesโ
Services Won't Startโ
Symptom: docker-compose up fails or services exit immediately
Solutions:
-
Check Docker is running:
docker ps
# If error: Start Docker Desktop/daemon -
Check port conflicts:
# Check if ports are already in use
netstat -an | findstr "3000 8080 27017 5672 6379" # Windows
lsof -i :3000,8080,27017,5672,6379 # Mac/Linux -
Clean and rebuild:
docker-compose down -v # Remove volumes
docker-compose up --build --force-recreate -
Check logs:
docker-compose logs producer-service
docker-compose logs worker-service
MongoDB Connection Errorsโ
Symptom: Failed to connect to MongoDB in logs
Solutions:
-
Wait for MongoDB to start:
- MongoDB takes 10-15 seconds to initialize
- Producer/Worker services retry automatically
-
Check MongoDB is healthy:
docker-compose ps mongodb
# Status should be "Up" not "Restarting" -
Verify connection string:
# In .env or docker-compose.yml
MONGODB_URI=mongodb://automation-mongodb:27017/automation_platform
# Use container name, not localhost -
Check MongoDB logs:
docker-compose logs mongodb
RabbitMQ Connection Errorsโ
Symptom: Failed to connect to RabbitMQ in worker logs
Solutions:
-
Check RabbitMQ is running:
docker-compose ps rabbitmq -
Verify connection URL:
RABBITMQ_URL=amqp://automation-rabbitmq:5672
# Use container name, not localhost -
Check RabbitMQ management UI:
- Open http://localhost:15672
- Login:
guest/guest - Check queue
automation_queueexists
๐ Authentication Issuesโ
"Invalid or expired token" on Every Requestโ
Symptom: Logged in but every API call returns 401
Solutions:
-
Check JWT secret matches:
# Same JWT_SECRET in producer-service across restarts
# If changed, all existing tokens are invalidated -
Verify token expiration:
JWT_EXPIRY=24h # In producer-service
# Token expires after 24 hours by default -
Check Authorization header format:
// Correct
headers: { 'Authorization': 'Bearer eyJhbGc...' }
// Incorrect (missing "Bearer ")
headers: { 'Authorization': 'eyJhbGc...' } -
Clear browser localStorage and login again:
localStorage.removeItem('jwt_token');
// Then login again
"Account temporarily locked" After Failed Loginsโ
Symptom: Cannot login even with correct password
Solutions:
-
Wait 15 minutes:
- Account locked for 15 minutes after 5 failed attempts
- Automatic unlock after expiration
-
Manual unlock via Redis:
docker exec -it <redis-container> redis-cli
> DEL login_lock:user@example.com
> DEL login_failures:user@example.com
> exit -
Check Redis is running:
docker-compose ps redis
Email Invitations Not Sendingโ
Symptom: Invitation created but email never arrives
Solutions:
-
Check email service configuration:
# In producer-service
EMAIL_SERVICE=ethereal # Development: Ethereal (test mode)
EMAIL_SERVICE=smtp # Production: Real SMTP
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-password # NOT your Gmail password -
Check logs for email errors:
docker-compose logs producer-service | grep -i "email" -
Test with Ethereal (development):
EMAIL_SERVICE=ethereal
# Check producer logs for Ethereal preview URL -
Gmail App Password:
- Don't use your Gmail password directly
- Generate App Password: https://myaccount.google.com/apppasswords
- Use that password in
SMTP_PASS
Rate Limit Errors (429 Too Many Requests)โ
Symptom: API returns 429 status code
Solutions:
-
Check current rate limits:
- Auth endpoints: 5 requests/min per IP
- API endpoints: 100 requests/min per organization
- Admin actions: 10 requests/min per organization
-
Wait for the rate limit window to reset (typically 60 seconds)
-
Manual rate limit reset (development only):
docker exec -it automation-redis redis-cli
> KEYS rl:*
> DEL rl:api:<your-org-id>
> exit -
Check if you're running automation against the API:
- Consider adding delays between requests
- Use API keys for CI/CD to track usage separately
Invalid Credentials When Switching Environmentsโ
Symptom: Login fails after changing from Cloud to Local database (or vice versa)
Cause: Each database environment has separate user accounts.
Solutions:
-
Check your MONGO_URI in
.env:# Cloud (MongoDB Atlas)
MONGO_URI=mongodb+srv://user:pass@cluster.mongodb.net/automation_platform
# Local (Docker container)
MONGO_URI=mongodb://automation-mongodb:27017/automation_platform -
Create a new account in the target environment (users don't transfer between databases)
-
Clear browser localStorage to remove stale JWT tokens:
localStorage.clear();
// Then refresh and login -
Restart services after changing
MONGO_URI:docker-compose down && docker-compose up -d
๐งช Test Execution Issuesโ
Tests Stuck in "PENDING" Statusโ
Symptom: Execution created but never starts running
Solutions:
-
Check worker service is running:
docker-compose ps worker-service
docker-compose logs worker-service -
Check RabbitMQ queue has consumer:
- Open http://localhost:15672
- Go to Queues โ
automation_queue - Check "Consumers" column shows 1 or more
-
Restart worker service:
docker-compose restart worker-service
Tests Stuck in "RUNNING" Status Foreverโ
Symptom: Test execution shows RUNNING but never completes
Solutions:
-
Check worker logs:
docker-compose logs -f worker-service
# Look for container errors or crashes -
Check Docker socket access:
# In docker-compose.yml worker service
volumes:
- /var/run/docker.sock:/var/run/docker.sock # Required -
Test container might have crashed:
docker ps -a | grep playwright # Or your test image
docker logs <container-id> -
Clean up stuck containers:
docker ps -a | grep Exited
docker rm $(docker ps -a -q --filter "status=exited")
"Docker image not found" Errorโ
Symptom: Worker fails with image pull error
Solutions:
-
Pull image manually:
docker pull mcr.microsoft.com/playwright:latest
# Or your custom image -
Check image name is correct:
// In execution request
{
"image": "mcr.microsoft.com/playwright:latest", // Full name with registry
"command": "npm test"
} -
Private registry authentication:
docker login your-registry.com
# Or configure Docker credentials helper
๐ WebSocket / Real-time Issuesโ
Live Logs Not Showingโ
Symptom: Tests run but logs don't appear in dashboard
Solutions:
-
Check WebSocket connection:
// In browser console
console.log('Socket connected:', socket.connected); -
Verify Socket.io handshake includes token:
const socket = io('http://localhost:3000', {
auth: {
token: localStorage.getItem('jwt_token') // Must include
}
}); -
Check CORS configuration:
// In producer-service index.ts
app.register(socketio, {
cors: {
origin: "*", // Development
methods: ["GET", "POST"]
}
}); -
Check producer logs for Socket.io connections:
docker-compose logs producer-service | grep -i "socket"
"auth-error" on Socket Connectionโ
Symptom: WebSocket connects but immediately gets auth-error
Solutions:
-
Check JWT token is valid:
// Verify token exists and is not expired
const token = localStorage.getItem('jwt_token');
console.log('Token:', token); -
Ensure token is in handshake auth:
// Correct
io('http://localhost:3000', { auth: { token: yourToken } });
// Incorrect (missing auth)
io('http://localhost:3000');
๐ Data / Database Issuesโ
Can't See Executions from Other Usersโ
Symptom: Only see my own test runs, not team's
Behavior: THIS IS EXPECTED - Multi-tenant isolation working correctly
Explanation:
- All users in same organization should see same executions
- If not seeing team executions, check:
- You're logged in to correct organization
- Executions have correct
organizationIdfield - Your JWT token has correct
organizationId
Verify:
// In browser console after login
const token = localStorage.getItem('jwt_token');
const payload = JSON.parse(atob(token.split('.')[1]));
console.log('Organization ID:', payload.organizationId);
Old Executions Missing After Migrationโ
Symptom: Historical executions disappeared
Solutions:
-
Check migration ran successfully:
# In MongoDB
docker exec -it <mongo-container> mongosh automation_platform
> db.executions.findOne()
# Should have organizationId field -
Re-run migration if needed:
cd migrations
npm install
npm run migrate:001 -
Check organizationId matches:
# In MongoDB
> db.executions.find({ organizationId: { $exists: false } }).count()
# Should be 0
โก Performance Issuesโ
Dashboard Slow to Loadโ
Solutions:
-
Check execution history size:
# Limit query results
GET /api/executions?limit=50 -
Clear old executions:
# In MongoDB
> db.executions.deleteMany({
startTime: { $lt: new Date('2026-01-01') }
}) -
Check Redis is running:
docker-compose ps redis
# Redis caches improve performance
Rate Limit Errors on Normal Usageโ
Symptom: Getting 429 errors despite normal use
Solutions:
-
Check rate limit configuration:
// In rateLimiter.ts
api: {
windowMs: 60000, // 1 minute
maxRequests: 100, // 100 requests per minute
} -
Temporary increase for testing:
// Modify and rebuild
maxRequests: 500, // Higher limit -
Manual reset via Redis:
docker exec -it <redis-container> redis-cli
> DEL rl:api:your-org-id
> exit
๐ง Development Issuesโ
Hot Reload Not Workingโ
Symptom: Code changes don't reflect without rebuild
Solutions:
-
Check volume mounts:
# In docker-compose.yml
services:
dashboard-client:
volumes:
- ./apps/dashboard-client:/app # Source code mount
- /app/node_modules # Don't override node_modules -
Restart service:
docker-compose restart dashboard-client -
Full rebuild if needed:
docker-compose up --build dashboard-client
TypeScript Errors in IDE but Not in Containerโ
Symptom: VS Code shows errors but code runs fine
Solutions:
-
Install dependencies locally:
cd apps/dashboard-client
npm install
# Or npm install from root with workspace setup -
Restart TypeScript server:
- VS Code: Cmd/Ctrl + Shift + P โ "Restart TypeScript Server"
-
Check tsconfig.json paths:
{
"compilerOptions": {
"paths": {
"@shared/*": ["../../packages/shared-types/src/*"]
}
}
}
๐ ๏ธ Debugging Tipsโ
Enable Debug Loggingโ
Producer Service:
LOG_LEVEL=debug # In docker-compose.yml environment
Worker Service:
DEBUG=true
MongoDB Queries:
// Add to producer code temporarily
console.log('Query:', { organizationId: request.user.organizationId });
Check All Service Healthโ
# Quick health check
docker-compose ps
# Detailed logs for each service
docker-compose logs -f producer-service
docker-compose logs -f worker-service
docker-compose logs -f mongodb
docker-compose logs -f redis
docker-compose logs -f rabbitmq
# Check resource usage
docker stats
Reset Everything (Nuclear Option)โ
# โ ๏ธ WARNING: Deletes all data and containers
docker-compose down -v
docker system prune -a --volumes
docker-compose up --build --force-recreate
๐ Getting Helpโ
Before Opening an Issueโ
-
Check logs:
docker-compose logs > debug.log
# Attach debug.log to issue -
Gather environment info:
- OS and version
- Docker version:
docker --version - Node version (if running locally):
node --version
-
Reproduce steps:
- List exact steps to reproduce
- Expected vs actual behavior
Useful Commandsโ
# View all containers (including stopped)
docker ps -a
# Inspect container
docker inspect <container-id>
# Execute command in container
docker exec -it <container-id> sh
# View container resource usage
docker stats
# Check network connectivity
docker exec -it <container> ping mongodb
docker exec -it <container> ping producer-service