Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

payload/rpm-ostree: Copy stderr to our output #6019

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cgwalters
Copy link
Contributor

The rpm-ostree container deployment path can fail for many reasons from networking to details in mount setup.

What we really want is a proper API with progress out of bootc/ostree; I will work on that at some point.

In the meantime though, just capture stderr on failure and include it in the payload installation error so people don't have to dig into program.log which is very obscure.

The rpm-ostree container deployment path can fail for many reasons
from networking to details in mount setup.

What we really want is a proper API with progress out of bootc/ostree;
I will work on that at some point.

In the meantime though, just capture stderr on failure and include
it in the payload installation error so people don't have to
dig into `program.log` which is very obscure.

Signed-off-by: Colin Walters <[email protected]>
@cgwalters
Copy link
Contributor Author

I think this will work but trying to test it out locally with scripts/makeupdates I'm hitting skew between the current rawhide ISO I think.

@github-actions github-actions bot added the f42 Fedora 42 label Nov 24, 2024
# For now we just use anaconda's stdout.
# Also TODO: Add a progress/status API to bootc and use it here
# https://github.com/containers/bootc/issues/522
proc = startProgram(args, stdout=None, stderr=subprocess.PIPE)
Copy link
Contributor

Choose a reason for hiding this comment

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

You can pass to execWithRedirect the stderr and stdout parameters and achieve the same.

Copy link
Contributor

Choose a reason for hiding this comment

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

And for printing the error in the PayloadInstallationError it should be enough to catch the exception

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you sure? I didn't actually try it but just reading the code for _run_program it sure looks to me like err_string (i.e. the result of stderr, which is what we want to capture) never ends up being included in a thrown exception (which is what we want to show to the user).

I am fine with any solution that results in stderr from this process being shown to the user, to be clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f42 Fedora 42
Development

Successfully merging this pull request may close these issues.

2 participants