From 44b0740735956af93f3f2baf5ab11f7f4fe6a27b Mon Sep 17 00:00:00 2001 From: Jake Cannell Date: Tue, 17 Feb 2026 17:18:11 -0800 Subject: [PATCH] CLN-2826: handle server-side log errors gracefully in CLI Check the success field before polling S3 for logs. When the server reports that the instance isn't running or ready, print the friendly message and an actionable hint instead of polling and timing out. Co-Authored-By: Claude Opus 4.6 --- vast.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vast.py b/vast.py index 4d737770..5a7d00b4 100755 --- a/vast.py +++ b/vast.py @@ -3595,6 +3595,14 @@ def logs(args): if r.status_code == 200: rj = r.json() + if not rj.get("success", True): + print(rj.get("msg", "Could not retrieve logs.")) + error_type = rj.get("error", "") + if error_type == "not_ready": + print("Hint: The instance is still starting up. Wait a moment and try again.") + elif error_type == "not_running": + print("Hint: Check your instance status with 'vastai show instances'.") + return for i in range(0, 30): time.sleep(0.3) url = rj["result_url"]