Append journal output to build failure errors - #4703
Draft
kingsleyzissou wants to merge 3 commits into
Draft
Conversation
kingsleyzissou
force-pushed
the
journal-logs
branch
from
August 5, 2026 09:13
f26a08e to
94ebaec
Compare
Collaborator
Author
|
I added a convenience script for simulating a build failure. You can run it with: ./scripts/simulate-failed-build.sh <blueprint-uuid> |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #4703 +/- ##
==========================================
- Coverage 77.85% 77.75% -0.10%
==========================================
Files 263 263
Lines 7036 7036
Branches 2551 2587 +36
==========================================
- Hits 5478 5471 -7
- Misses 1462 1472 +10
+ Partials 96 93 -3
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
kingsleyzissou
force-pushed
the
journal-logs
branch
from
August 5, 2026 09:21
94ebaec to
3fe0bf9
Compare
Collaborator
Author
|
@lucasgarfield fyi |
Uses cockpit.spawn() to call journalctl directly rather than the cockpit/journal module, whose Deferred-based API doesn't reliably settle when the underlying spawn rejects. Co-authored-by: Claude Sonnet 4 <noreply@anthropic.com>
When a build fails and no buildlog or upload result is available, the error is generic. Reading the systemd journal for the transient unit surfaces richer diagnostic info in those cases. Co-authored-by: Claude Sonnet 4 <noreply@anthropic.com>
Simulates a failed image build for manual testing of journal log output in the Cockpit UI. Uses a fixed UUID so repeated runs don't create multiple fake composes. Includes a --cleanup flag to remove the simulated compose directory and blueprint entry. Co-authored-by: Claude Sonnet 4 <noreply@anthropic.com>
kingsleyzissou
force-pushed
the
journal-logs
branch
from
August 5, 2026 09:25
3fe0bf9 to
ae8ccda
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a Cockpit image build fails and no buildlog or upload result is available, the error shown to users is generic and unhelpful. This PR reads the systemd journal for the build's transient unit and surfaces that output in the error details, giving users actual diagnostic information.
Changes
readJournalLogshelper that reads the last 50 journal lines for a compose's systemd unit viacockpit.spawn, returningundefinedon failure so journal errors never mask the original build errorgetComposeStatusfailure branches where no buildlog exists (error ids 10 and 28)simulate-failed-build.shscript for manual testing in a Cockpit VM