ostree-ext/tar: Unset G_MESSAGES_DEBUG before spawning ostree commit#1917
Conversation
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>
67f7be0 to
7318538
Compare
cgwalters
left a comment
There was a problem hiding this comment.
Looks sane to me, however I think we can take as as a followup // TODO Switch over to using ostree via API instead of CLI for this
(don't need to amend the commit and rerun CI though)
There was a problem hiding this comment.
Code Review
This pull request addresses an issue where debug messages from GLib/OSTree could corrupt the stdout when G_MESSAGES_DEBUG is set, leading to silent data loss. The fix involves unsetting this environment variable before spawning the ostree commit process. The change is correct and well-commented. My only suggestion is to update the issue link in the code comment to point to the official bug tracker for better long-term traceability.
Thanks, created #1918 |
This updates ostree-ext and related dependencies (composefs-rs, bootc-internal-utils) to address an issue where G_MESSAGES_DEBUG=all causes packages to be incorrectly shown as "Removed" during rebase operations. The root cause was that GLib debug output was being written to stdout instead of stderr, corrupting the ostree commit hash parsing in ostree-ext's container layer import. When the subprocess output is polluted with debug messages, the merge commit ends up missing content from derived layers. Fixes: OCPBUGS-64692 Fixes: RHEL-130454 See: bootc-dev/bootc#1917
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)