Troubleshooting Guide
Solutions to common issues and debugging techniques for Pushy.
Common Issues
Installation Fails
Error: "permission denied to create database"
PostgreSQL is not running or wrong credentials.
# Make sure PostgreSQL is runningdocker-compose ps postgres# If not running, start itdocker-compose up -d postgressleep 10# Then try database operationssqlx database createError: "Cannot start service postgres: driver failed programming external connectivity"
Port 5432 is already in use by another service.
# For local development - find what's using port 5432sudo lsof -i :5432# Kill the process (replace PID with actual process ID)sudo kill -9 PID# Or change the port in docker-compose.ymlports: - "5433:5432" # Use 5433 instead# For EKS - check RDS connectivitykubectl exec -it deployment/pushy-api -n pushy -- nc -zv your-rds-endpoint.sa-east-1.rds.amazonaws.com 5432API Connection Errors
Error: "Connection refused" or "ECONNREFUSED"
The API server is not running or not accessible.
# For EKS deployment, check pod statuskubectl get pods -n pushy# Check pod logskubectl logs -n pushy -l app=pushy-api# Test EKS endpointcurl http://a9a18d9bb21ed4e6e9b07bbd4b8d9f16-251019334.sa-east-1.elb.amazonaws.com/health# For local developmentdocker-compose logs apiRedis/ElastiCache Issues
Redis Connection Timeouts
Important: Redis is now optional in Pushy
If Redis/ElastiCache connection fails, Pushy automatically falls back to direct Contentful API calls.
# Check Redis configurationkubectl describe configmap pushy-config -n pushy | grep -i redis# View Redis connection logskubectl logs -n pushy -l app=pushy-api | grep -E "Redis|redis"# Test ElastiCache connectivitykubectl exec -it deployment/pushy-api -n pushy -- \ timeout 2 redis-cli -h your-redis.sa-east-1.cache.amazonaws.com ping# If timeouts occur, check security groups in AWS ConsoleDatabase Errors
Database Connection Issues
Error: "database does not exist"
# Connect as postgres userpsql -U postgres -h localhost# In psql:CREATE DATABASE pushy OWNER pushy;\q# Run migrationssqlx migrate runError: "FATAL: password authentication failed"
Wrong database password or user doesn't exist.
# Connect to postgresdocker exec -it pushy-postgres-1 psql -U postgres# Reset passwordALTER USER pushy WITH PASSWORD 'pushy';# Grant permissionsGRANT ALL PRIVILEGES ON DATABASE pushy TO pushy;\qMigration Problems
Error: "relation already exists" during migration
# Drop and recreate databasesqlx database dropsqlx database create# Run migrations freshsqlx migrate run# Or force a specific migrationsqlx migrate run --target-version 20240101000000Docker Issues
Container Problems
Containers keep restarting
# Check container statusdocker-compose ps# View logs for specific servicedocker-compose logs -f postgresdocker-compose logs -f redis# Inspect containerdocker inspect pushy-api-1# Reset everythingdocker-compose down -vdocker-compose up -dDocker disk space issues
# Remove unused containersdocker container prune -f# Remove unused imagesdocker image prune -a -f# Remove unused volumesdocker volume prune -f# Clean everything (careful!)docker system prune -a --volumes -fEmail Delivery Issues
SMTP Configuration Problems
Error: "SMTP authentication failed"
# For production (AWS SES)# Check SES configuration in EKSkubectl get configmap pushy-config -n pushy -o yaml | grep SMTP# Test SES connectivitykubectl exec -it deployment/pushy-api -n pushy -- nc -zv email-smtp.sa-east-1.amazonaws.com 587# For local developmentdocker-compose ps mailhogopen http://localhost:8025Production Email Setup (AWS SES)
# Current SES configuration in EKS# Region: sa-east-1SMTP_HOST=email-smtp.sa-east-1.amazonaws.comSMTP_PORT=587SMTP_SECURE=trueFROM_EMAIL=noreply@pushy.ar# Check SES verified domainsaws ses list-verified-email-addresses --region sa-east-1Performance Issues
Slow API Response Times
API responses taking more than 1 second
# For EKS deployment# Check pod resourceskubectl top pods -n pushy# Check HPA statuskubectl get hpa -n pushy# View pod logs with debug levelkubectl logs -n pushy -l app=pushy-api --tail=100# Check ElastiCache Redis metrics in AWS Console# Region: sa-east-1# For local developmentdocker stats pushy-api-1Optimization Tips
- ✓Increase database connection pool size
- ✓Add database indexes on frequently queried columns
- ✓Scale worker instances horizontally
- ✓Enable Redis query caching
High Memory Usage
# Monitor memory usagedocker stats# Check for memory leaks in RustRUST_LOG=debug cargo run --features jemalloc# Limit container memory# In docker-compose.yml:services: api: mem_limit: 1g memswap_limit: 1gUseful Debug Commands
Quick Debug Commands
# EKS API health checkcurl http://a9a18d9bb21ed4e6e9b07bbd4b8d9f16-251019334.sa-east-1.elb.amazonaws.com/health# Check pod healthkubectl describe pods -n pushy# Check service endpointskubectl get endpoints -n pushy# SQS queue status (AWS)aws sqs get-queue-attributes \ --queue-url https://sqs.sa-east-1.amazonaws.com/YOUR_ACCOUNT_ID/pushy-notifications.fifo \ --attribute-names All \ --region sa-east-1# Local development healthcurl http://localhost:3001/health# EKS deployment logs# API logskubectl logs -n pushy -l app=pushy-api -f# Worker logskubectl logs -n pushy -l app=pushy-worker -f# All pods in namespacekubectl logs -n pushy --all-containers=true -f# Local development logsdocker-compose logs -f# Recent notificationspsql -d pushy -c "SELECT * FROM notifications ORDER BY created_at DESC LIMIT 10;"# Failed notificationspsql -d pushy -c "SELECT * FROM notifications WHERE status = 'failed' ORDER BY created_at DESC;"# User countpsql -d pushy -c "SELECT COUNT(*) FROM users;"Frequently Asked Questions
Q: How do I check the current deployment status?
A: Use these commands to check the EKS deployment:
# Check all Pushy resourceskubectl get all -n pushy# Check pod logs for errorskubectl logs -n pushy -l app=pushy-api --tail=50kubectl logs -n pushy -l app=pushy-worker --tail=50# Describe pods for eventskubectl describe pods -n pushy# Check HPA statuskubectl get hpa -n pushyQ: Why are my notifications not being delivered?
A: Check these common causes:
- • Worker pods not running:
kubectl get pods -n pushy -l app=pushy-worker - • SQS queue permissions: Check IAM role for EKS service account
- • Redis connection issues: Check ElastiCache security groups
- • Template not found: Verify Contentful space ID and access token in secrets
Q: How do I scale the system for production?
A: See our Kubernetes deployment guide for production scaling strategies including horizontal pod autoscaling, database connection pooling, and Redis cluster configuration.
Still Need Help?
If you're still experiencing issues, we're here to help: