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
|
|
@ -28,6 +28,13 @@ impl MongoDb {
|
|||
}
|
||||
Err(e) => {
|
||||
eprintln!("[MongoDB] ERROR: Failed to parse URI: {}", e);
|
||||
|
||||
let error_msg = e.to_string().to_lowercase();
|
||||
if error_msg.contains("dns") || error_msg.contains("resolution") || error_msg.contains("lookup") {
|
||||
eprintln!("[MongoDB] DNS RESOLUTION ERROR DETECTED!");
|
||||
eprintln!("[MongoDB] Cannot resolve hostname in: {}", uri);
|
||||
eprintln!("[MongoDB] Error: {}", e);
|
||||
}
|
||||
eprintln!("[MongoDB] Will continue in degraded mode (database operations will fail)");
|
||||
|
||||
// Create a minimal configuration that will allow the server to start
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue