Troubleshooting
Common issues and solutions for SaleSpider.
Quick Diagnostics
Check System Status
# Service status
make status
# View logs
make logs
# Check health
make healthCommon Issues
Services Won't Start
Symptoms:
- Containers fail to start
- Services exit immediately
- Port conflicts
Solutions:
Check logs:
bashmake logs docker-compose logsCheck ports:
bash# Check if ports are in use lsof -i :3000 lsof -i :5432Restart Docker:
bash# Restart Docker daemon sudo systemctl restart dockerClean and rebuild:
bashdocker-compose down -v make deploy
Database Connection Errors
Symptoms:
- "Connection refused"
- "Could not connect to database"
- Application can't reach database
Solutions:
Check database is running:
bashdocker-compose ps postgresVerify connection string:
bashdocker-compose exec app env | grep DATABASE_URLTest connection:
bashdocker-compose exec postgres psql -U postgres -d salespiderCheck logs:
bashdocker-compose logs postgres
Application Errors
Symptoms:
- 500 Internal Server Error
- Application crashes
- Features not working
Solutions:
Check application logs:
bashmake logs SERVICE=appVerify environment variables:
bashdocker-compose exec app envRestart application:
bashdocker-compose restart appCheck database migrations:
bashdocker-compose exec app npx prisma migrate status
Port Conflicts
Symptoms:
- "Port already in use"
- "Address already in use"
Solutions:
Find process using port:
bashlsof -i :3000Kill process:
bashkill -9 <PID>Change port:
yaml# In docker-compose.yml ports: - "3001:3000"
Out of Disk Space
Symptoms:
- "No space left on device"
- Backups fail
- Services crash
Solutions:
Check disk usage:
bashdf -hClean Docker:
bashdocker system prune -a docker volume pruneClean logs:
bashdocker-compose logs --tail=0Remove old backups:
bashdocker-compose exec postgres pgbackrest expire --stanza=main
Performance Issues
Slow Response Times
Symptoms:
- Pages load slowly
- API requests timeout
- Database queries slow
Solutions:
Check resource usage:
bashdocker statsCheck database performance:
bashdocker-compose exec postgres psql -U postgres -d salespider -c \ "SELECT * FROM pg_stat_activity WHERE state = 'active';"Restart services:
bashmake restart
High CPU Usage
Symptoms:
- System sluggish
- High load average
- Containers using excessive CPU
Solutions:
Identify culprit:
bashdocker stats docker top salespider-appCheck for runaway processes:
bashdocker-compose logs app | grep -i errorRestart affected service:
bashdocker-compose restart app
High Memory Usage
Symptoms:
- Out of memory errors
- System swapping
- Containers killed
Solutions:
Check memory usage:
bashfree -h docker statsIncrease memory limits:
yaml# In docker-compose.yml services: app: mem_limit: 2gRestart services:
bashmake restart
Backup Issues
Backup Fails
Symptoms:
- Backup command fails
- No recent backups
- Backup errors in logs
Solutions:
Check backup logs:
bashdocker-compose logs backup cat /var/log/pgbackrest/main-backup.logVerify disk space:
bashdf -h /var/lib/pgbackrestCheck permissions:
bashls -la /var/lib/pgbackrestManual backup:
bashmake backup
Restore Fails
Symptoms:
- Restore command fails
- Database not restored
- Data missing after restore
Solutions:
Verify backup exists:
bashmake backup-infoCheck restore logs:
bashcat /var/log/pgbackrest/main-restore.logTry different backup:
bashdocker-compose exec postgres pgbackrest info
Docker Issues
Docker Daemon Not Running
Symptoms:
- "Cannot connect to Docker daemon"
- Docker commands fail
Solutions:
Start Docker:
bashsudo systemctl start dockerCheck Docker status:
bashsudo systemctl status dockerRestart Docker:
bashsudo systemctl restart docker
Container Keeps Restarting
Symptoms:
- Container in restart loop
- Services unstable
Solutions:
Check logs:
bashdocker-compose logs <service>Check health:
bashdocker inspect <container> | grep HealthRemove and recreate:
bashdocker-compose rm <service> docker-compose up -d <service>
Network Issues
Cannot Access Application
Symptoms:
- Cannot reach application URL
- Connection timeout
- DNS errors
Solutions:
Check services are running:
bashmake statusVerify ports:
bashdocker-compose psCheck firewall:
bashsudo ufw statusTest locally:
bashcurl http://localhost:3000
SSL Certificate Errors
Symptoms:
- "Certificate not trusted"
- "SSL handshake failed"
- Browser warnings
Solutions:
Regenerate certificates:
bashrm -rf .docker/ssl make deployInstall certificate:
- Export certificate
- Install in system trust store
Use HTTP for testing:
bashhttp://localhost:3000
Authentication Issues
Cannot Login
Symptoms:
- Login fails
- "Invalid credentials"
- Session expires immediately
- No users exist in database
Solutions:
Check if database was seeded:
bash# Check if super admin exists docker-compose exec postgres psql -U postgres -d salespider -c \ "SELECT email, role FROM \"User\" WHERE role = 'SUPER_ADMIN';"If no results, seed the database:
bash# Self-hosted docker-compose exec app npm run seed # Cloud/production npm run seed:prodVerify credentials:
- Check username/email matches SUPER_ADMIN_EMAIL in .env
- Check password matches SUPER_ADMIN_PASSWORD in .env
Check JWT configuration:
bashdocker-compose exec app env | grep JWTClear browser cache:
- Clear cookies
- Try incognito mode
Check logs:
bashmake logs SERVICE=app | grep auth
Permission Denied
Symptoms:
- "Access denied"
- "Insufficient permissions"
- Features not accessible
Solutions:
Check user role:
- Verify user has correct role
- Check role permissions
Check logs:
bashmake logs SERVICE=app | grep permission
Migration Issues
Migration Fails
Symptoms:
- Migration command fails
- Database schema outdated
- Application errors
Solutions:
Check migration status:
bashdocker-compose exec app npx prisma migrate statusRun migrations:
bashdocker-compose exec app npx prisma migrate deployReset if needed:
bashdocker-compose exec app npx prisma migrate reset
Getting Help
Collect Information
Before seeking help, gather:
System information:
bashuname -a docker --version docker-compose --versionService status:
bashmake statusLogs:
bashmake logs > logs.txtConfiguration:
bashdocker-compose config > config.yml
Support Channels
- Check documentation
- Review GitHub issues
- Ask in community forums
- Contact support
Prevention
Regular Maintenance
- Monitor logs daily
- Check backups weekly
- Update regularly
- Test disaster recovery
Best Practices
- Keep backups current
- Monitor disk space
- Review logs regularly
- Document changes