fix(compose): move atomic backup out of stack folder, silence stale stats 404s (#498)

The Skipper/Admiral atomic deploy/update path used to create
.sencho-backup/ inside the user's stack folder, which silently failed
with EACCES whenever a container had chowned the bind mount (swag,
tautulli, linuxserver/* images, etc). That broke auto-rollback and the
manual rollback endpoint for those stacks. Stack backups now live under
<DATA_DIR>/backups/<stackName>/ next to sencho.db, which is always
writable by the Sencho user.

While stress-testing the same scenario, MonitorService also flooded the
error log with "Error parsing stats for container ... 404 no such
container" because per-container stats polls (30s tick) raced with
docker compose recreating containers. The 404 case is now skipped
silently; non-404 stats failures still log at error level.
This commit is contained in:
Anso
2026-04-10 20:06:17 -04:00
committed by GitHub
parent 9a861f0a76
commit ba9c4f4aa6
5 changed files with 133 additions and 11 deletions
+8
View File
@@ -294,6 +294,14 @@ export class MonitorService {
}
}
} catch (e) {
// Containers can be removed between getRunningContainers() and the
// per-container stats call (e.g., during a stack update). Dockerode
// throws a 404 in that case. That's expected churn, not a real
// error, so skip silently rather than flooding the logs.
const err = e as { statusCode?: number; reason?: string };
if (err?.statusCode === 404 || err?.reason === 'no such container') {
continue;
}
console.error(`Error parsing stats for container ${container.Id} on node ${node.name}`, e);
}
}