Add DNS error logging and server diagnostic script
- Enhanced MongoDB connection error handling with DNS-specific logging - DNS resolution errors now display clear diagnostic messages - Added diagnose-server.sh script for remote server troubleshooting - Graceful degradation continues when database connection fails
This commit is contained in:
parent
cd5c1709c6
commit
7b48f04fd1
2 changed files with 45 additions and 0 deletions
38
backend/diagnose-server.sh
Executable file
38
backend/diagnose-server.sh
Executable file
|
|
@ -0,0 +1,38 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo "=========================================="
|
||||
echo "Backend Diagnostic Script for 10.0.10.30"
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
|
||||
echo "1. Checking Docker containers..."
|
||||
docker ps --filter "name=normogen" --format "table {{.Names}} {{.Status}} {{.Ports}}"
|
||||
echo ""
|
||||
|
||||
echo "2. Checking if port 6500 is listening..."
|
||||
sudo ss -tlnp | grep 6500 || echo "Port 6500 NOT listening"
|
||||
echo ""
|
||||
|
||||
echo "3. Checking firewall status..."
|
||||
sudo ufw status || echo "UFW not installed"
|
||||
echo ""
|
||||
|
||||
echo "4. Checking Docker network..."
|
||||
docker network ls | grep normogen
|
||||
echo ""
|
||||
|
||||
echo "5. Backend container logs (last 20 lines)..."
|
||||
docker logs --tail 20 normogen-backend-dev 2>&1
|
||||
echo ""
|
||||
|
||||
echo "6. Testing local connection..."
|
||||
curl -s --max-time 3 http://localhost:6500/health || echo "Local connection failed"
|
||||
echo ""
|
||||
|
||||
echo "7. Testing container connection..."
|
||||
docker exec normogen-backend-dev curl -s --max-time 3 http://localhost:8000/health || echo "Container connection failed"
|
||||
echo ""
|
||||
|
||||
echo "=========================================="
|
||||
echo "Diagnostic complete"
|
||||
echo "=========================================="
|
||||
Loading…
Add table
Add a link
Reference in a new issue