Troubleshooting Guide¶
This guide helps you diagnose and fix common issues with Hop3 deployments.
Quick Diagnostics¶
Before diving into specific issues, run these commands to gather information:
# System health check
hop3 system:check --verbose
# Application status
hop3 apps
# Recent logs
hop3 app:logs myapp --lines 50
# System info
hop3 system:info
Deployment Issues¶
Build Fails¶
Symptom¶
Deployment fails during the build phase with dependency or compilation errors.
Diagnosis¶
Common Causes & Solutions¶
Missing system dependencies:
# Check if required packages are installed
dpkg -l | grep <package>
# Install missing packages
sudo apt install <package>
Python: pip install fails
# Check Python version
python3 --version
# Ensure pip is up to date
pip install --upgrade pip
# Check for conflicting requirements
pip check
Node.js: npm install fails
# Clear npm cache
npm cache clean --force
# Check Node version
node --version
# Try fresh install
rm -rf node_modules package-lock.json
npm install
Ruby: bundle install fails
# Check Ruby/Bundler versions
ruby --version
bundler --version
# Clear bundle cache
bundle clean --force
Application Won't Start¶
Symptom¶
Build succeeds but application shows as "stopped" or returns 502 errors.
Diagnosis¶
# Check application state
hop3 app:status myapp
# Check process logs
hop3 app:logs myapp --lines 50
# Check uWSGI status
systemctl status uwsgi-hop3
Common Causes & Solutions¶
Missing Procfile:
# Verify Procfile exists
cat /home/hop3/apps/myapp/src/Procfile
# Procfile format should be:
# web: gunicorn app:app
Wrong worker command:
# Test command manually
cd /home/hop3/apps/myapp/src
source ../venv/bin/activate
<your-command> # e.g., gunicorn app:app
Port binding issues:
# Check if port is in use
ss -tlnp | grep <port>
# Verify PORT environment variable
hop3 config:show myapp | grep PORT
Missing environment variables:
502 Bad Gateway¶
Symptom¶
Nginx returns 502 Bad Gateway error.
Diagnosis¶
# Check Nginx error log
sudo tail -50 /var/log/nginx/error.log
# Check if application socket exists
ls -la /tmp/uwsgi-*.sock
# Check Nginx configuration
sudo nginx -t
Common Causes & Solutions¶
Application not running:
Socket permission issues:
uWSGI worker crashed:
# Check uWSGI logs
sudo journalctl -u uwsgi-hop3 -n 50
# Restart uWSGI
sudo systemctl restart uwsgi-hop3
Nginx config error:
404 Not Found¶
Symptom¶
Application returns 404 for all routes.
Diagnosis¶
# Check if app has HOST_NAME configured
hop3 config:show myapp | grep HOST_NAME
# Verify Nginx config exists
ls /etc/nginx/sites-enabled/myapp.conf
Common Causes & Solutions¶
Missing HOST_NAME:
DNS not configured:
Wrong Nginx server_name:
Database Issues¶
Cannot Connect to Database¶
Symptom¶
Application fails to connect to PostgreSQL or MySQL.
Diagnosis¶
# Check database addon
hop3 addons:list
# Check if DATABASE_URL is set
hop3 config:show myapp | grep DATABASE
# Test database service
hop3 system:check --verbose
Common Causes & Solutions¶
Addon not attached:
# Attach addon to app
hop3 addons:attach mydb --app myapp
# Redeploy to pick up DATABASE_URL
hop3 deploy myapp
Database service not running:
# PostgreSQL
sudo systemctl status postgresql
sudo systemctl start postgresql
# MySQL
sudo systemctl status mysql
sudo systemctl start mysql
Wrong credentials:
# Check addon info
hop3 addons:info mydb
# Verify DATABASE_URL format
# postgresql://user:pass@host:port/dbname
PostgreSQL: No pg_hba.conf entry:
# Edit pg_hba.conf
sudo nano /etc/postgresql/*/main/pg_hba.conf
# Add lines for Docker networks:
# host all all 172.16.0.0/12 md5
# host all all 192.168.0.0/16 md5
# Reload PostgreSQL
sudo systemctl reload postgresql
Database Connection Timeout¶
Symptom¶
Application hangs trying to connect to database.
Solutions¶
# Check if database is listening
ss -tlnp | grep 5432 # PostgreSQL
ss -tlnp | grep 3306 # MySQL
# Check firewall
sudo ufw status
# Verify bind address in config
# PostgreSQL: /etc/postgresql/*/main/postgresql.conf
# listen_addresses = '*'
SSL/TLS Issues¶
Certificate Not Provisioned¶
Symptom¶
Site shows "Not Secure" or SSL certificate errors.
Diagnosis¶
# Check certificate status
sudo certbot certificates
# Check for errors
sudo journalctl -u certbot -n 50
Solutions¶
DNS not propagated:
Port 80 blocked:
Rate limited by Let's Encrypt: - Wait 1 hour and try again - Check https://letsencrypt.org/docs/rate-limits/
Certificate Renewal Failed¶
Solutions¶
# Test renewal
sudo certbot renew --dry-run
# Force renewal
sudo certbot renew --force-renewal
# Check timer
systemctl status certbot.timer
Performance Issues¶
Application Slow¶
Diagnosis¶
# Check resource usage
top
htop
# Check disk I/O
iostat -x 1
# Check application logs for slow queries
hop3 app:logs myapp | grep -i slow
Solutions¶
Increase workers:
Enable caching:
Database optimization:
# Check slow queries (PostgreSQL)
sudo -u postgres psql -c "SELECT * FROM pg_stat_statements ORDER BY total_time DESC LIMIT 10;"
Out of Memory¶
Diagnosis¶
Solutions¶
# Add swap space
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
# Reduce worker memory
hop3 config:set myapp UWSGI_WORKERS=2
Disk Full¶
Diagnosis¶
# Check disk usage
df -h
# Find large files
du -sh /home/hop3/apps/* | sort -h
du -sh /var/log/* | sort -h
Solutions¶
# Clean old logs
sudo journalctl --vacuum-time=7d
# Clean Docker (if used)
docker system prune -a
# Remove old deployments
# (Be careful - only remove apps you don't need)
Networking Issues¶
App Not Accessible Externally¶
Diagnosis¶
Solutions¶
Bind to all interfaces:
Open firewall:
DNS Resolution Issues¶
Diagnosis¶
Solutions¶
# Verify DNS A record points to server IP
# Check with your DNS provider
# For testing, add to /etc/hosts on client:
# <server-ip> myapp.example.com
Service Issues¶
hop3-server Won't Start¶
Diagnosis¶
Solutions¶
Configuration error:
Database locked:
# Check for stale locks
lsof /home/hop3/.config/hop3/hop3.db
# If locked, stop all services and restart
sudo systemctl stop hop3-server uwsgi-hop3
sudo systemctl start hop3-server uwsgi-hop3
Nginx Won't Start¶
Diagnosis¶
Solutions¶
Configuration syntax error:
# Find the error
sudo nginx -t
# Fix the problematic config file
sudo nano /etc/nginx/sites-enabled/<file>.conf
Port already in use:
uWSGI Won't Start¶
Diagnosis¶
Solutions¶
Socket directory missing:
Configuration error:
Getting More Help¶
Collect Diagnostic Information¶
# Full diagnostic dump
hop3 system:info > diagnostic.txt
hop3 system:check --verbose >> diagnostic.txt
hop3 apps >> diagnostic.txt
# Include logs for specific app
hop3 app:logs myapp --lines 200 >> diagnostic.txt
Where to Get Help¶
- Documentation: https://hop3.cloud/docs
- GitHub Issues: https://github.com/hop3-project/hop3/issues
- Community Chat: (link to Discord/Matrix if available)
When reporting issues, please include:
- Hop3 version: hop3 --version
- Operating system: cat /etc/os-release
- Error messages and logs
- Steps to reproduce