{"record":{"id":"58d07fe00bf616db","repo":"GoogleContainerTools/skaffold","slug":"reading-from-image-load-response-w","errorCode":null,"errorMessage":"reading from image load response: %w","messagePattern":"reading from image load response: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/docker/image.go","lineNumber":566,"sourceCode":"\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"pulling image from repository: %w\", err)\n\t}\n\tdefer rc.Close()\n\n\treturn streamDockerMessages(out, rc, nil)\n}\n\n// Load loads an image from a tar file. Returns the imageID for the loaded image.\nfunc (l *localDaemon) Load(ctx context.Context, out io.Writer, input io.Reader, ref string) (string, error) {\n\tresp, err := l.apiClient.ImageLoad(ctx, input)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"loading image into docker daemon: %w\", err)\n\t}\n\tdefer resp.Close()\n\n\tif err := streamDockerMessages(out, resp, nil); err != nil {\n\t\treturn \"\", fmt.Errorf(\"reading from image load response: %w\", err)\n\t}\n\n\treturn l.ImageID(ctx, ref)\n}\n\n// Tag adds a tag to an image.\nfunc (l *localDaemon) Tag(ctx context.Context, image, ref string) error {\n\t_, err := l.apiClient.ImageTag(ctx, client.ImageTagOptions{Source: image, Target: ref})\n\treturn err\n}\n\n// For k8s, we need a unique, immutable ID for the image.\n// k8s doesn't recognize the imageID or any combination of the image name\n// suffixed with the imageID, as a valid image name.\n// So, the solution we chose is to create a tag, just for Skaffold, from\n// the imageID, and use that in the manifests.\nfunc (l *localDaemon) TagWithImageID(ctx context.Context, ref string, imageID string) (string, error) {\n\tparsed, err := ParseReference(ref)","sourceCodeStart":548,"sourceCodeEnd":584,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/docker/image.go#L548-L584","documentation":"In localDaemon.Load, after ImageLoad succeeds, the daemon's JSON response stream is consumed by streamDockerMessages. If that stream reports an error (e.g. the daemon rejected the archive mid-load, or the stream was interrupted), it is wrapped as \"reading from image load response: %w\". This is a failure during the load operation itself, after the request was accepted.","triggerScenarios":"Calling Load() where the response JSON stream from ImageLoad carries an error message: invalid layer data inside the tar, daemon ran out of disk space while unpacking, or the stream/connection was cut before completion.","commonSituations":"Docker disk full during image unpack, truncated tar stream (reader closed early), daemon restarted mid-load, incompatible image format inside an otherwise valid tar.","solutions":["Free disk space on the daemon host (`docker system prune`) — full disks commonly abort the unpack mid-stream.","Validate the tar by loading it manually: `docker load -i <file>` to get the raw daemon error.","Regenerate the image archive — truncated or partially written tars fail mid-stream.","Retry after checking daemon logs (`journalctl -u docker` or Docker Desktop logs) for the underlying unpack error."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// check daemon disk space before loading large images\ndu, err := client.DiskUsage(ctx)\nif err == nil && freeDiskLow(du) { return errors.New(\"docker disk nearly full; prune first\") }","typeGuard":null,"tryCatchPattern":"id, err := daemon.Load(ctx, out, tar, ref)\nif err != nil && strings.Contains(err.Error(), \"reading from image load response\") {\n    log.Printf(\"load stream aborted; run `docker load -i <tar>` and `docker system prune`, then retry: %v\", err)\n}","preventionTips":["Run `docker system prune` periodically to avoid disk-full aborts mid-load.","Regenerate tars that were written by interrupted builds.","Avoid killing the process while Load is streaming.","Check daemon logs when loads repeatedly fail mid-stream."],"tags":["docker","load","stream","disk"],"backgroundTag":"docker-load-failed","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}