fix(2): echo abra backup output (backupbot pre-hook) into run log for diagnosis

This commit is contained in:
autonomic-bot
2026-05-31 00:04:05 +00:00
parent 2a8a38947f
commit 2f6a6842b0

View File

@ -184,7 +184,13 @@ def backup_create(domain: str, timeout: int = 900) -> str:
# remote and fails "authentication required: Unauthorized". Returns the captured output, whose
# restic JSON summary line carries the produced "snapshot_id" (the backup artifact, DG3) — note
# `abra app backup snapshots` needs a TTY and is awkward to script, so we read the create output.
return _run_pty(["app", "backup", "create", domain, "-n", "-C", "-o"], timeout=timeout).stdout
out = _run_pty(["app", "backup", "create", domain, "-n", "-C", "-o"], timeout=timeout).stdout or ""
# Echo the backup output (incl. backupbot's pre-hook run / any "Failed to run command" or
# "Container ... not running" ERROR) into the run log. Backup is otherwise opaque: a pre-hook that
# fails to register/run leaves the DB dump out of the snapshot, surfacing only as a downstream
# restore RED with no cause. Bounded tail keeps it readable.
print(f" [backup output]\n{out[-4000:]}", flush=True)
return out
def restore(domain: str, timeout: int = 900) -> None: