Improve error messages for script deployment failures
All checks were successful
Build and Push Container / build (push) Successful in 30s

Show stdout, stderr, or exit code when deployment fails to help debug issues

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Debian
2026-01-05 09:51:09 +00:00
parent ba1c65d15c
commit ae8f833b65

View File

@@ -283,17 +283,19 @@ class MonitorService:
write_cmd = f"sudo tee {script_path} > /dev/null << 'KUMA_SCRIPT_EOF'\n{script_content}KUMA_SCRIPT_EOF"
result = ssh.execute(hostname, write_cmd, username, port)
if not result.success:
error_detail = result.stderr or result.stdout or f"exit code {result.exit_code}"
return {
"status": "failed",
"error": f"Failed to write script: {result.stderr}",
"error": f"Failed to write script: {error_detail}",
}
# Make the script executable
chmod_result = ssh.execute(hostname, f"sudo chmod +x {script_path}", username, port)
if not chmod_result.success:
error_detail = chmod_result.stderr or chmod_result.stdout or f"exit code {chmod_result.exit_code}"
return {
"status": "failed",
"error": f"Failed to make script executable: {chmod_result.stderr}",
"error": f"Failed to make script executable: {error_detail}",
}
# Add cronjob entry (remove existing entry first to avoid duplicates)