Systematic troubleshooting
When your DMIT cloud server has issues, a systematic approach beats random guessing. This article provides troubleshooting flows for common problem types to help you locate and fix issues quickly.
Core principle: check logs first, then resources, then config.
SSH connection issues
Can't SSH in
# 1. Check network reachability
ping <server_ip>
# 2. Check if port is open
nc -zv <server_ip> 22
# 3. If port unreachable, use DMIT panel VNC/Console
# 4. Check SSH service
systemctl status sshd
# 5. Check SSH config
grep -E "Port|PermitRootLogin|PasswordAuthentication" /etc/ssh/sshd_config
# 6. Check firewall
iptables -L -n | grep 22
ufw status
# 7. Check SSH logs
journalctl -u sshd --since "1 hour ago" -n 50
Common causes: firewall rule changes, SSH port changed but not allowed in firewall, key config errors.
Slow SSH login
# Common cause: DNS reverse lookup timeout
# Edit /etc/ssh/sshd_config
UseDNS no
GSSAPIAuthentication no
systemctl restart sshd
Web service issues
502 Bad Gateway
# 1. Check backend service
systemctl status your-app
ps aux | grep your-app
# 2. Check backend port
ss -tlnp | grep :3000
# 3. Check Nginx error log
tail -20 /var/log/nginx/error.log
# 4. Test backend manually
curl -I http://127.0.0.1:3000
# 5. Check Nginx upstream config
grep -A5 "upstream" /etc/nginx/sites-enabled/*
504 Gateway Timeout
# Increase Nginx timeouts
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
# Or optimise backend speed
# Check for infinite loops or slow queries
403 Forbidden
# Check permissions
ls -la /var/www/
chown -R www-data:www-data /var/www/
find /var/www/ -type d -exec chmod 755 {} \;
find /var/www/ -type f -exec chmod 644 {} \;
# Check Nginx deny directives
grep -r "deny" /etc/nginx/
Database issues
Connection limit reached
# MySQL
mysql -e "SHOW VARIABLES LIKE 'max_connections'"
mysql -e "SHOW STATUS LIKE 'Threads_connected'"
mysql -e "SHOW PROCESSLIST" | awk '{print $3}' | sort | uniq -c | sort -rn
# PostgreSQL
psql -c "SELECT count(*) FROM pg_stat_activity"
psql -c "SELECT state, count(*) FROM pg_stat_activity GROUP BY state"
Slow queries
# MySQL slow query log
SET GLOBAL slow_query_log = 'ON';
SET GLOBAL long_query_time = 1;
tail -20 /var/log/mysql/slow.log
# PostgreSQL
# postgresql.conf: log_min_duration_statement = 1000
EXPLAIN ANALYZE SELECT ...;
Disk issues
Disk full
df -h
du -sh /* 2>/dev/null | sort -rh | head -10
# Clean common space hogs
journalctl --vacuum-size=500M
apt clean
find /var/log -name "*.gz" -mtime +30 -delete
Inode exhaustion
df -i
find / -xdev -type f | cut -d/ -f2 | sort | uniq -c | sort -rn | head
Network issues
Service unreachable from outside
# 1. Check if service listens on 0.0.0.0 (not just 127.0.0.1)
ss -tlnp | grep :80
# 2. Check firewall
ufw status
iptables -L -n
# 3. Test from outside
curl -I http://<server_ip>:80
DNS resolution failure
cat /etc/resolv.conf
nslookup example.com
dig example.com
# Temporary fix with public DNS
echo "nameserver 8.8.8.8" > /etc/resolv.conf
Performance issues
System sluggish
top -b -n1 | head -5
top -b -n1 | grep "%Cpu" | awk '{print "I/O wait: " $8}'
ps aux --sort=-%cpu | head -5
ps aux --sort=-%mem | head -5
For performance tuning methods, see Performance Tuning Guide.
OOM (out of memory)
dmesg | grep -i "out of memory"
dmesg | grep -i "oom killer"
journalctl --since "1 hour ago" | grep -i "killed process"
# Fix: add swap
fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
# Or: optimise app memory, or upgrade plan
Troubleshooting checklist
| Problem | First step | Key command |
|---|---|---|
| SSH unreachable | ping + nc | systemctl status sshd |
| 502 | Check backend | ss -tlnp + nginx error log |
| 504 | Check backend response time | nginx error log + backend log |
| 403 | Check permissions | ls -la + chown/chmod |
| DB conn limit | Check connections | SHOW PROCESSLIST / pg_stat_activity |
| Disk full | df -h | du -sh + clean logs/cache |
| Service unreachable | Check listen + firewall | ss -tlnp + ufw status |
| OOM | dmesg grep oom | Add swap or upgrade |
| Sluggish | top | ps aux --sort=-%cpu |
Related: SSH Hardening, IPv6 Setup Guide, Monitoring and Backup, First Deploy Checklist.
Checked 2026-08-18. Commands depend on your OS version.