fix(2): echo abra backup output (backupbot pre-hook) into run log for diagnosis
This commit is contained in:
@ -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:
|
||||
|
||||
Reference in New Issue
Block a user