Attach OCI Error details to status error so that we can log them#6743
Attach OCI Error details to status error so that we can log them#6743jcarter3 wants to merge 1 commit intomoby:masterfrom
Conversation
Signed-off-by: Jeff Carter <jeff.carter@docker.com>
tonistiigi
left a comment
There was a problem hiding this comment.
Is this supposed to be a change in remote cache backend? I don't see any mention about it in the PR title or description.
|
Yes. We're trying to debug an issue someone submitted where buildkit is printing a "400 bad request" error when it goes to push cache to Docker Hub. Docker Hub returns a detail message explaining the issue, but buildkit is swallowing that error so it's not visible to end users. This PR is an attempt to propagate the error message back to the user so it can be properly actioned upon. This is not the only place in buildkit this happens, but it is the instance that is affecting us now. |
tonistiigi
left a comment
There was a problem hiding this comment.
This might be better with a helper or defer to capture the possible error for manifest/config upload as well. Eg. 2cd52d8
Unless you specifically know that the error you want to debug only comes from the layers push.
When debugging errors from a registry, buildkit currenty just logs "400 Bad request". Registries usually send back a JSON error message with a
detailsfield that tells why the request was bad, which is very useful when trying to figure out what's going on. This PR is meant to propagate the details field back from the failed registry call so it can be logged appropriately in a debug statement.