Retain failed container stdout in authorized operation diagnostics

This commit is contained in:
Pavel Isaev 2026-11-08 08:11:11 +03:00
parent e8a7fdc15d
commit db1c54871c
2 changed files with 16 additions and 3 deletions

View file

@ -124,6 +124,13 @@ Required before claiming hardware readiness:
## Execution order after this audit
Retry `20261108T050444Z` reused the completed images in the normal pipeline and
captured authorized transaction logs. Catalog failure is in systemd-nspawn
(exit 1), but the worker retained only stderr; container console output on stdout
was lost. Failed workers now retain the bounded tail of both streams in private
GetLog diagnostics. This is a diagnostic fix; the catalog failure itself remains
unresolved until the next pipeline provides its guest error.
Run `20261108T000830Z` built all three ISO variants and passed Core installation,
boot, provisioning and login. Installed self-check failed on mtimes of the two
new package symlinks: OSTree does not retain their mtimes. CLI self-check now

View file

@ -139,9 +139,15 @@ impl Worker {
.map_err(|_| Failure::new(ErrorCode::ExecutionFailed, "Worker diagnostics unavailable or over limit"))?;
self.events.log(&format!("{program}: {}",status));
if !status.success() {
let diagnostics = String::from_utf8_lossy(&err);
let lines: Vec<_> = diagnostics.lines().collect();
for line in lines.iter().skip(lines.len().saturating_sub(32)) { self.events.log(line); }
// nspawn can multiplex guest stderr onto its stdout console. Keep
// both streams in the private, authorized operation log on failure.
for (name, bytes) in [("stdout", &out), ("stderr", &err)] {
let diagnostics = String::from_utf8_lossy(bytes);
let lines: Vec<_> = diagnostics.lines().collect();
for line in lines.iter().skip(lines.len().saturating_sub(32)) {
self.events.log(&format!("{name}: {line}"));
}
}
}
if let Some(failure) = stopped { return Err(failure); }
if !status.success() {