Skip to content

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

hop3 app:logs myapp --lines 100

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:

# List all config
hop3 config:show myapp

# Set missing variables
hop3 config:set myapp KEY=value


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:

# Restart application
hop3 app:restart myapp

# Check if it started
hop3 app:status myapp

Socket permission issues:

# Check socket permissions
ls -la /tmp/uwsgi-myapp.sock

# Should be owned by hop3:www-data

uWSGI worker crashed:

# Check uWSGI logs
sudo journalctl -u uwsgi-hop3 -n 50

# Restart uWSGI
sudo systemctl restart uwsgi-hop3

Nginx config error:

# Test configuration
sudo nginx -t

# Reload after fixing
sudo systemctl reload nginx


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:

# Set hostname
hop3 config:set myapp HOST_NAME=myapp.example.com

# Redeploy
hop3 deploy myapp

DNS not configured:

# Check DNS resolution
dig myapp.example.com

# Should return your server's IP

Wrong Nginx server_name:

# Check Nginx config
cat /etc/nginx/sites-enabled/myapp.conf | grep 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:

# Verify DNS
dig myapp.example.com

# Wait for propagation (up to 48 hours)

Port 80 blocked:

# Check firewall
sudo ufw status

# Allow HTTP
sudo ufw allow 80/tcp

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:

hop3 config:set myapp UWSGI_WORKERS=4
hop3 app:restart myapp

Enable caching:

# Add Redis
hop3 addons:create redis myapp-cache
hop3 addons:attach myapp-cache --app myapp

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

# Check memory usage
free -h

# Check for OOM killer
dmesg | grep -i oom

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

# Check if app listens on correct interface
ss -tlnp | grep <port>

# Check firewall
sudo ufw status

Solutions

Bind to all interfaces:

# Most apps need to bind to 0.0.0.0, not 127.0.0.1
hop3 config:set myapp BIND_ADDRESS=0.0.0.0

Open firewall:

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

DNS Resolution Issues

Diagnosis

# Check DNS
dig myapp.example.com

# Check /etc/hosts
cat /etc/hosts

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

systemctl status hop3-server
journalctl -u hop3-server -n 50

Solutions

Configuration error:

# Validate config
cat /home/hop3/.config/hop3/server.toml

# Check for syntax errors (TOML format)

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

sudo nginx -t
journalctl -u nginx -n 50

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:

ss -tlnp | grep :80
# Kill the process using the port, or change Nginx port

uWSGI Won't Start

Diagnosis

systemctl status uwsgi-hop3
journalctl -u uwsgi-hop3 -n 50

Solutions

Socket directory missing:

sudo mkdir -p /run/uwsgi
sudo chown hop3:www-data /run/uwsgi

Configuration error:

# Check all app configs
ls /etc/uwsgi-hop3/
cat /etc/uwsgi-hop3/*.ini


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

  1. Documentation: https://hop3.cloud/docs
  2. GitHub Issues: https://github.com/hop3-project/hop3/issues
  3. 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