fix(update): pass --create-missing when rollback recreates a destroyed container

The update flow removes the old container before starting the new
one. If the update fails after removal, the rollback path tries
`podman start <name>` first, then falls back to reconcile. But
reconcile without --create-missing treats the now-absent container
as an optional one that the install flow will (re)create later,
and skips it. Result: container stays destroyed until someone
notices and runs reconcile manually.

Add --create-missing to the rollback reconcile invocation so the
fallback actually rebuilds the container from its canonical spec.

Fixes the failure mode observed on .228 where a bitcoin-knots
update left the node with no bitcoin-knots container at all.
This commit is contained in:
archipelago 2026-04-23 10:06:55 -04:00
parent 0f1ad47aec
commit 694e5b0a9d

View File

@ -306,11 +306,14 @@ impl RpcHandler {
Ok(o) => {
let stderr = String::from_utf8_lossy(&o.stderr);
warn!("Rollback: could not restart {}: {}", name, stderr.trim());
// Container was already removed — try reconcile to recreate with old image
// Container was already removed (forward path ran `podman rm`).
// Use --create-missing so reconcile rebuilds it from its
// canonical spec instead of skipping it as optional.
let _ = tokio::process::Command::new("bash")
.args([
"/opt/archipelago/scripts/reconcile-containers.sh",
&format!("--container={}", name),
"--create-missing",
"--force",
])
.output()