-
Notifications
You must be signed in to change notification settings - Fork 357
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
base: main
Are you sure you want to change the base?
Conversation
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]>
I think this will work but trying to test it out locally with |
# 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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's part of the output_string that it's returned (stderr is redirected for that method by default to stdout):
https://github.com/rhinstaller/anaconda/blob/master/pyanaconda/core/util.py#L192
args | ||
) | ||
# TODO refactor things so we can log stdout to the program log or journal. | ||
# For now we just use anaconda's stdout. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can make it log to Journal, it should be captured even now when something goes wrong - Journal is the de-facto primary log sink for Anaconda these days & what we gather and ask users to attach to bugs. :)
Sure, it would be better if Anaconda got distinct event/callback when something happens, but just making sure everything ends up in Journal would help already. :)
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.