From 53c67be034ae04263353aa39fad9cea35fc2effd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Mon, 15 Dec 2025 15:56:44 +0100 Subject: [PATCH] daemon/c8d: Log correct error extractOCIErrors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When logging an unmarshal failure in the registry error handling code, the function was incorrectly logging the uninitialized `derrs` variable instead of the actual JSON unmarshal error `jerr`. Signed-off-by: Paweł Gronowski --- daemon/containerd/registry_errors.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/containerd/registry_errors.go b/daemon/containerd/registry_errors.go index 605fc87297..72c59bf07e 100644 --- a/daemon/containerd/registry_errors.go +++ b/daemon/containerd/registry_errors.go @@ -26,7 +26,7 @@ func translateRegistryError(ctx context.Context, err error) error { var derr docker.Error if errors.As(err, &remoteErr) { if jerr := json.Unmarshal(remoteErr.Body, &derrs); jerr != nil { - log.G(ctx).WithError(derrs).Debug("unable to unmarshal registry error") + log.G(ctx).WithError(jerr).Debug("unable to unmarshal registry error") return fmt.Errorf("%w: %w", cerrdefs.ErrUnknown, err) } if len(derrs) == 0 && (remoteErr.StatusCode == http.StatusUnauthorized || remoteErr.StatusCode == http.StatusForbidden) {