Let a failed image build leave the rootfs that explains it - #274
Merged
Conversation
Both errors in #265 name a path inside the builder's rootfs, and the cleanup defer deletes that rootfs on the way out. Three attempts, three destroyed artifacts, and two sessions reasoning about the failure from the message alone. The issue's own next step asks for a preserved builder. The flag is opt-in, so the default still deletes and a routine failure cannot strand a member. It is never silent: the preserved case wraps the original error with the instance name, the member it sits on and the command that removes it, because a preserved builder holds disk and an image-maintenance lease until someone does. Wrapping rather than replacing keeps errors.Is working, so preserving cannot hide the reason the builder is worth inspecting. One test drives a build to a failing publish twice, with and without the flag, and fails on the rollback of either half.
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.
Issue #265 has three failed integration-image publishes and two distinct errors:
Both name a path inside the builder's rootfs, and the orchestrator's cleanup
deferdeletes that rootfs on the way out. So every attempt destroyed the only artifact that could explain it, and two sessions have now reasoned about the failure from the message alone. The issue's own suggested next step asks for exactly this: "reproduce withincus publishrun directly against a preserved builder, so the container survives the failure and the rootfs can be inspected."--preserve-failed-builderis opt-in, so the default still deletes and a routine failure cannot strand a member.It is never silent. The preserved case wraps the original error with the instance name, the member it sits on, and the command that removes it, because a preserved builder holds disk and an image-maintenance capacity lease until someone does:
The underlying error is wrapped, not replaced —
errors.Isstill finds it, so preserving cannot hide the reason the builder is worth inspecting.One test drives a build to a failing publish twice, with and without the flag, and asserts: the default still deletes and does not claim to preserve; the flag keeps the instance, wraps rather than discards the cause, and names all three of instance, member and removal command. It fails on the rollback of the flag.
make verifygreen.https://claude.ai/code/session_01NpzpgiRaxi5mHVTMoRYndt