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

progress: tweak progress error reporting #810

Merged
merged 2 commits into from
Jan 28, 2025

Conversation

mvo5
Copy link
Collaborator

@mvo5 mvo5 commented Jan 27, 2025

This commit adds catpure of os.Std{out,err} when running osbuild so that we capture the error log and can display it as part of an error from osbuild, e.g. when osbuild itself crashes.

This gives us more accurate error reporting if anything fails during the osbuild building.

[edit: this will also help https://github.com/osbuild/image-builder-cli/pull/21]

This commit adds catpure of os.Std{out,err} when running osbuild so
that we capture the error log and can display it as part of
an error from osbuild, e.g. when osbuild itself crashes.

This gives us more accurate error reporting if anything fails
during the osbuild building.
@mvo5 mvo5 force-pushed the tweak-progress-errors branch from eb97668 to dd38714 Compare January 27, 2025 12:54
This commit tweaks an issue that potentially an incorrect status
from osbuild would fail the build with a bad error message and
without us getting the full buildlog.
Copy link
Member

@supakeen supakeen left a comment

Choose a reason for hiding this comment

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

Cool, looks good to me. Thank you.

@supakeen supakeen enabled auto-merge January 27, 2025 17:11
@supakeen
Copy link
Member

Enabled auto-merge and retriggered the integration tests (which seem flaky lately, this time it failed on pulling a container image).

@supakeen supakeen added this pull request to the merge queue Jan 27, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 27, 2025
@supakeen supakeen added this pull request to the merge queue Jan 28, 2025
Merged via the queue into osbuild:main with commit f640340 Jan 28, 2025
10 of 12 checks passed
mvo5 added a commit to mvo5/bootc-image-builder that referenced this pull request Feb 5, 2025
This commit fixes a silly mistake from PR#810. The issue is that
in osbuild#810 we started to collect the osbuild stdout/stderr so that
we can show crashes from osbuild or other unexpected output.

However when a stage fails this is reported via the json progress
and not directly on stdout/stderr - this was missed when osbuild#810
was done.

This commit does a short term fix by collecting the buildlog again
and showing it in the error and also updates the test to be more
realistic. However we really need a test that actually tests
the real behavior, ideally a real osbuild run with a stage error
so that we can be sure we capture this (criticial!) functionality.
mvo5 added a commit to mvo5/bootc-image-builder that referenced this pull request Feb 5, 2025
This commit fixes a silly mistake from PR#810. The issue is that
in osbuild#810 we started to collect the osbuild stdout/stderr so that
we can show crashes from osbuild or other unexpected output.

However when a stage fails this is reported via the json progress
and not directly on stdout/stderr - this was missed when osbuild#810
was done.

This commit does a short term fix by collecting the buildlog again
and showing it in the error and also updates the test to be more
realistic. However we really need a test that actually tests
the real behavior, ideally a real osbuild run with a stage error
so that we can be sure we capture this (criticial!) functionality.
mvo5 added a commit to mvo5/bootc-image-builder that referenced this pull request Feb 5, 2025
This commit adds a proper integration test that ensures that we
always report the details of a failing osbuild run. This prevents
regressions like the one from osbuild#810.

This ensures that:
a) we report the messags from a broken stage
b) we report any osbuild messages as well to catch e.g.
   crashes that are not reported via the json progress

It is archived by creating a new build container fixture that is
deliberately broken, i.e:
a) the org.osbuild.selinux stage is replaced with a fake that
   will echo some msgs and then error
b) osbuild itself is is wrapped around so that we can reliably
   echo some canary strings before the real osbuild is executed
pull bot pushed a commit to centos-workstation/bootc-image-builder that referenced this pull request Feb 5, 2025
This commit fixes a silly mistake from PR#810. The issue is that
in osbuild#810 we started to collect the osbuild stdout/stderr so that
we can show crashes from osbuild or other unexpected output.

However when a stage fails this is reported via the json progress
and not directly on stdout/stderr - this was missed when osbuild#810
was done.

This commit does a short term fix by collecting the buildlog again
and showing it in the error and also updates the test to be more
realistic. However we really need a test that actually tests
the real behavior, ideally a real osbuild run with a stage error
so that we can be sure we capture this (criticial!) functionality.
mvo5 added a commit to mvo5/bootc-image-builder that referenced this pull request Feb 6, 2025
This commit adds a proper integration test that ensures that we
always report the details of a failing osbuild run. This prevents
regressions like the one from osbuild#810.

This ensures that:
a) we report the messags from a broken stage
b) we report any osbuild messages as well to catch e.g.
   crashes that are not reported via the json progress

It is archived by creating a new build container fixture that is
deliberately broken, i.e:
a) the org.osbuild.selinux stage is replaced with a fake that
   will echo some msgs and then error
b) osbuild itself is is wrapped around so that we can reliably
   echo some canary strings before the real osbuild is executed
github-merge-queue bot pushed a commit that referenced this pull request Feb 12, 2025
This commit adds a proper integration test that ensures that we
always report the details of a failing osbuild run. This prevents
regressions like the one from #810.

This ensures that:
a) we report the messags from a broken stage
b) we report any osbuild messages as well to catch e.g.
   crashes that are not reported via the json progress

It is archived by creating a new build container fixture that is
deliberately broken, i.e:
a) the org.osbuild.selinux stage is replaced with a fake that
   will echo some msgs and then error
b) osbuild itself is is wrapped around so that we can reliably
   echo some canary strings before the real osbuild is executed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants