Index: /branches/amp_3_7_2/scripts/import_es_snapshot.sh
===================================================================
--- /branches/amp_3_7_2/scripts/import_es_snapshot.sh	(revision 2858)
+++ /branches/amp_3_7_2/scripts/import_es_snapshot.sh	(working copy)
@@ -157,20 +157,44 @@
 # ----------------------------------------------------------
 log "[5/9] Registering snapshot repository..."
 
-REPO_RESPONSE=$(curl -s -XPUT "http://localhost:9200/_snapshot/$REPO_NAME" \
-    -H "Content-Type: application/json" \
-    -d "{\"type\":\"fs\",\"settings\":{\"location\":\"$IMPORT_DIR\"}}")
+# Wait for Elasticsearch to be ready
+log "Waiting for Elasticsearch cluster to be ready..."
+for i in {1..30}; do
+    HEALTH=$(curl -s "http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=5s")
+    if echo "$HEALTH" | grep -q '"status":"yellow"\|"status":"green"'; then
+        log "Elasticsearch cluster is ready"
+        break
+    fi
+    sleep 5
+done
 
-echo "$REPO_RESPONSE" >> "$LOG_FILE"
+# Retry repository registration (up to 5 attempts)
+REPO_REGISTERED=0
+for attempt in {1..5}; do
+    log "Registering snapshot repository (attempt $attempt)..."
 
-if echo "$REPO_RESPONSE" | grep -qi '\"error\"'; then
-    log "ERROR: Failed to register snapshot repository"
+    REPO_RESPONSE=$(curl -s -XPUT "http://localhost:9200/_snapshot/$REPO_NAME" \
+        -H "Content-Type: application/json" \
+        -d "{\"type\":\"fs\",\"settings\":{\"location\":\"$IMPORT_DIR\"}}")
+
+    echo "$REPO_RESPONSE" >> "$LOG_FILE"
+
+    if ! echo "$REPO_RESPONSE" | grep -qi '"error"'; then
+        REPO_REGISTERED=1
+        log "Repository registered successfully"
+        break
+    fi
+
+    log "Repository registration failed, retrying in 10 seconds..."
+    sleep 10
+done
+
+if [ "$REPO_REGISTERED" -ne 1 ]; then
+    log "ERROR: Failed to register snapshot repository after retries"
     echo "Elasticsearch Response: $REPO_RESPONSE"
     fail "Repository registration failed"
 fi
 
-log "Repository registered"
-
 # -----------------------------------------------
 # STEP 5.5 — Increase max shards per node
 # -----------------------------------------------
\ No newline at end of file
Index: /branches/amp_3_7_2/src/webui/webui/htdocs/new/src/hive/controller/snapshot_controller.py
===================================================================
--- /branches/amp_3_7_2/src/webui/webui/htdocs/new/src/hive/controller/snapshot_controller.py	(revision 2858)
+++ /branches/amp_3_7_2/src/webui/webui/htdocs/new/src/hive/controller/snapshot_controller.py	(working copy)
@@ -183,9 +183,11 @@
             # Also check for "exception" for stack traces
             if "error:" in line_lower or "exception" in line_lower:
                 ts = extract_timestamp(line)
+                msg = extract_error_message(line)
                 result = {
                     "status": "Failed",
-                    "failed_at": ts
+                    "failed_at": ts,
+                    "message": msg
                 }
 
             # Check for success (overrides failure if it comes later)
@@ -231,9 +233,11 @@
             # Check for failures
             if "error:" in line_lower or "exception" in line_lower:
                 ts = extract_timestamp(line)
+                msg = extract_error_message(line)
                 result = {
                     "status": "Failed",
-                    "failed_at": ts
+                    "failed_at": ts,
+                    "message": msg
                 }
 
             # Check for success (overrides failure if it comes later)
@@ -251,6 +255,27 @@
         return json_response({"status": "Failed", "message": "Error fetching export status"}, 500)
 
 
+def extract_error_message(line):
+    """
+    Extracts a meaningful error message from a log line.
+    Handles:
+      - ERROR: <message>
+      - Exception lines / stack traces
+    """
+    # ERROR: message
+    err_match = re.search(r'ERROR:\s*(.*)', line)
+    if err_match:
+        return err_match.group(1).strip()
+
+    # Python exception (ValueError, RuntimeError, etc.)
+    exc_match = re.search(r'([A-Za-z]+Error|Exception):\s*(.*)', line)
+    if exc_match:
+        return "{}: {}".format(exc_match.group(1), exc_match.group(2)).strip()
+
+    # Fallback
+    return line.strip()
+
+
 def extract_timestamp(line):
     """
     Extract 'YYYY-MM-DD HH:MM:SS' anywhere in the line.
