Skip to content

Commit b76d75d

Browse files
jmarrerocgwalters
authored andcommitted
ostree-ext/tar: Unset G_MESSAGES_DEBUG before spawning ostree commit
When G_MESSAGES_DEBUG is set (e.g., 'all'), GLib and OSTree emit debug messages to stdout instead of stderr. This corrupts the commit hash that we parse from the ostree commit subprocess output, causing derived layer content to be silently lost during container imports. The issue manifests as packages installed via 'dnf install' in a Containerfile not appearing in the deployed system's rpmdb after a rebase/upgrade operation. Fixes: https://issues.redhat.com/browse/OCPBUGS-64692 Assisted-by: OpenCode (Claude Opus 4.5) Signed-off-by: Joseph Marrero Corchado <jmarrero@redhat.com>
1 parent e074a41 commit b76d75d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

crates/ostree-ext/src/tar/write.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,12 @@ pub async fn write_tar(
400400
None
401401
};
402402
let mut c = std::process::Command::new("ostree");
403+
// Unset G_MESSAGES_DEBUG to prevent GLib debug messages from corrupting stdout.
404+
// When G_MESSAGES_DEBUG is set (e.g., "all"), GLib and OSTree emit debug messages
405+
// to stdout instead of stderr, which corrupts the commit hash we parse from
406+
// the subprocess output. This causes derived layer content to be silently lost
407+
// during container imports.
408+
c.env_remove("G_MESSAGES_DEBUG");
403409
let repofd = repo.dfd_as_file()?;
404410
let repofd: Arc<io_lifetimes::OwnedFd> = Arc::new(repofd.into());
405411
{

0 commit comments

Comments
 (0)