Troubleshooting
Service Won’t Start (0/1 Replicas)
Section titled “Service Won’t Start (0/1 Replicas)”-
Check the service task errors:
Terminal window docker service ps dev_api --no-truncLook at the
ERRORcolumn for the most recent task. -
Common causes:
- Image not found — The image doesn’t exist in Harbor. Push it first.
- Port conflict — Another service is using the same port.
- Config missing — The service references a Docker config that doesn’t exist.
- Resource constraint — Node doesn’t have enough memory or CPU.
- Health check failing — Container starts but health check fails, causing restart loop.
-
Check container logs (if it started briefly):
Terminal window docker service logs dev_api --tail 200 -
Force redeploy:
Terminal window docker service update --force dev_api
502 Bad Gateway
Section titled “502 Bad Gateway”This means Nginx is running but can’t reach the backend service.
-
Check if the backend service is running:
Terminal window docker service ls | grep <service_name> -
Check if the service is on the correct network:
Terminal window docker service inspect <service_name> --format '{{.Spec.TaskTemplate.Networks}}' -
Check Nginx config references the correct service name and port:
Terminal window docker config inspect <nginx_config> --pretty -
Test from inside the Nginx container:
Terminal window docker exec $(docker ps -q -f name=dev_nginx) curl -s http://<service_name>:<port>/
Container Restart Loop
Section titled “Container Restart Loop”The service keeps restarting — replicas show 0/1 or tasks show repeated failures.
# See the restart historydocker service ps dev_api --no-trunc
# Check logs from the failing containerdocker service logs dev_api --tail 300Common causes:
- Application crash on startup (bad config, missing env var, DB connection failure)
- Out of memory (OOM killed) — check
docker inspect <container_id>for OOMKilled - Health check timeout too aggressive
Can’t Pull Images from Harbor
Section titled “Can’t Pull Images from Harbor”# Check if you're logged indocker login harbor.ayinza.dev
# Check if Harbor is reachablecurl -sk https://harbor.ayinza.dev/api/v2.0/ping
# Check Harbor servicesdocker stack services shared | grep harborIf Harbor itself is down: Restart it:
docker stack deploy -c /home/kaks/stacks/shared-infrastructure.yml sharedWireGuard Tunnel Down
Section titled “WireGuard Tunnel Down”Symptoms: Services on one node can’t talk to services on the other node.
# Check WireGuard statuswg show
# Look for "latest handshake" — if it's more than 2 minutes ago, the tunnel may be down
# Restart WireGuardsystemctl restart wg-quick@wg0
# Verify connectivityping 10.10.0.1 # Azure (from Contabo)ping 10.10.0.2 # Contabo (from Azure)Node Shows “Down” in Swarm
Section titled “Node Shows “Down” in Swarm”docker node ls# If a node shows "Down":
# 1. Check if the server itself is reachableping 4.180.181.86 # Azureping 84.247.134.135 # Contabo
# 2. SSH into the node and check Docker daemonsystemctl status docker
# 3. Restart Docker if neededsystemctl restart docker
# 4. Check WireGuard (nodes communicate over VPN)wg showDatabase Connection Issues
Section titled “Database Connection Issues”# Check if PostgreSQL container is runningdocker ps -f name=postgresql
# Test connection from inside the containerdocker exec $(docker ps -q -f name=dev_postgresql) pg_isready -U postgres
# Check PgBouncer (connection pooler)docker service logs dev_pgbouncer --tail 50
# Check max connectionsdocker exec $(docker ps -q -f name=dev_postgresql) psql -U postgres -c "SHOW max_connections;"docker exec $(docker ps -q -f name=dev_postgresql) psql -U postgres -c "SELECT count(*) FROM pg_stat_activity;"Disk Full
Section titled “Disk Full”-
Check what’s using space:
Terminal window df -hdu -sh /var/lib/docker/ 2>/dev/nulldu -sh /data/* 2>/dev/null # Contabo - Harbor data -
Clean up Docker:
Terminal window # Remove unused imagesdocker image prune -a# Remove unused volumes (CAREFUL — only removes truly unused ones)docker volume prune# Full cleanupdocker system prune -
Harbor garbage collection:
- Log into Harbor UI → Administration → Garbage Collection → GC Now
-
Remove old database backups:
Terminal window ls -lah ~/sseris-*.sql.gz# Delete backups older than 7 days
SSL Certificate Expired
Section titled “SSL Certificate Expired”# Check expiry dateecho | openssl s_client -connect ayinza.dev:443 2>/dev/null | openssl x509 -noout -dates
# If using Let's Encrypt:certbot renew
# After renewal, restart/reload the proxy:docker service update --force dev_nginxGitHub Actions Runner Not Picking Up Jobs
Section titled “GitHub Actions Runner Not Picking Up Jobs”# Check runner status on Contabosystemctl status actions.runner.*
# View runner logsjournalctl -u actions.runner.* --no-pager --since "1 hour ago"
# Restart the runnersystemctl restart actions.runner.*General Debugging Checklist
Section titled “General Debugging Checklist”- Is the server reachable? —
pingthe IP - Is Docker running? —
systemctl status docker - Is the WireGuard tunnel up? —
wg show - Is the service running? —
docker service ls | grep <name> - What do the logs say? —
docker service logs <name> --tail 200 - Is there disk space? —
df -h - Is there memory? —
free -h - Can the service reach its dependencies? — Test from inside the container