Skip to content

ostree-ext/tar: Unset G_MESSAGES_DEBUG before spawning ostree commit#1917

Merged
cgwalters merged 1 commit intobootc-dev:mainfrom
jmarrero:fix-g-messages-debug-stdout
Jan 15, 2026
Merged

ostree-ext/tar: Unset G_MESSAGES_DEBUG before spawning ostree commit#1917
cgwalters merged 1 commit intobootc-dev:mainfrom
jmarrero:fix-g-messages-debug-stdout

Conversation

@jmarrero
Copy link
Contributor

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)

@github-actions github-actions bot added the area/ostree Issues related to ostree label Jan 15, 2026
@bootc-bot bootc-bot bot requested a review from cgwalters January 15, 2026 15:14
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>
@jmarrero jmarrero force-pushed the fix-g-messages-debug-stdout branch from 67f7be0 to 7318538 Compare January 15, 2026 15:15
Copy link
Collaborator

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jmarrero
Copy link
Contributor Author

(don't need to amend the commit and rerun CI though)

Thanks, created #1918

@cgwalters cgwalters merged commit b76d75d into bootc-dev:main Jan 15, 2026
62 of 67 checks passed
jmarrero added a commit to jmarrero/rpm-ostree that referenced this pull request Jan 15, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ostree Issues related to ostree

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants