Skip to content

history: print build errors at the end of history logs - #4087

Open
crazy-max wants to merge 1 commit into
docker:masterfrom
crazy-max:fix-history-logs-error
Open

crazy-max wants to merge 1 commit into
docker:masterfrom
crazy-max:fix-history-logs-error

Conversation

@crazy-max

@crazy-max crazy-max commented Sep 17, 2026

Copy link
Copy Markdown
Member

fixes #3132
supersedes and closes #3756

history logs now prints the stored build error after replaying progress output. This makes failures that are not directly associated with a build vertex, such as cache-key computation errors, visible without requiring a separate history inspect command. Error sources and failed-vertex logs use the same formatting as history inspect, while raw JSON output remains valid NDJSON.

The change also ensures status streams and progress printers are cleaned up on every exit path.

Can be reproduced with a cache-key failure caused by a missing build context file.

FROM scratch
COPY missing /
$ docker buildx build --progress=quiet --output=type=cacheonly .
ERROR: failed to build: failed to solve: failed to compute cache key: "/missing": not found

$ docker buildx history logs <build-ref> --progress=plain

Before this change, the output ends without the stored error details:

#4 [1/1] COPY missing /
#4 ERROR: failed to calculate checksum: "/missing": not found
------
 > [1/1] COPY missing /:
------

After this change, history logs prints the stored error and source location at the end:

#4 [1/1] COPY missing /
#4 ERROR: failed to calculate checksum: "/missing": not found
------
 > [1/1] COPY missing /:
------

Error: Unknown failed to compute cache key: failed to calculate checksum: "/missing": not found
Dockerfile:2
--------------------
   1 |     FROM scratch
   2 | >>> COPY missing /
   3 |
--------------------

Enable --debug to see stack traces for error

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max added this to the v0.38.0 milestone Sep 17, 2026
@crazy-max
crazy-max marked this pull request as ready for review September 17, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Always print error in the end of history logs command

1 participant