{"record":{"id":"4c9ac9eb7aad9c50","repo":"kubernetes/kops","slug":"error-decoding-image-archive-from-q-v","errorCode":null,"errorMessage":"error decoding image archive from %q: %v","messagePattern":"error decoding image archive from %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/nodeup/nodetasks/load_image.go","lineNumber":159,"sourceCode":"func importContainerImage(ctx context.Context, url string, expectedHash *hashing.Hash, cacheDir string) error {\n\t// Phase 1: fetch (or reuse cached) verified bytes. fi.DownloadURL writes via a\n\t// temp-file + atomic rename and short-circuits if cacheFile already matches the hash,\n\t// so a re-run of nodeup that already populated the cache skips the network round-trip.\n\tcacheFile := filepath.Join(cacheDir, expectedHash.Hex()+\"_\"+utils.SanitizeString(path.Base(url)))\n\tif _, err := fi.DownloadURL(ctx, url, cacheFile, expectedHash); err != nil {\n\t\treturn err\n\t}\n\n\t// Phase 2: stream verified bytes (transparently gunzipped) to ctr.\n\tfile, err := os.Open(cacheFile)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error opening verified image file: %v\", err)\n\t}\n\tdefer file.Close()\n\n\treader, err := maybeGzipReader(file)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error decoding image archive from %q: %v\", url, err)\n\t}\n\tdefer reader.Close()\n\n\targs := []string{\"ctr\", \"--namespace\", \"k8s.io\", \"images\", \"import\", \"-\"}\n\thuman := strings.Join(args, \" \")\n\n\tklog.Infof(\"running command %s\", human)\n\tcmd := exec.Command(args[0], args[1:]...)\n\tcmd.Stdin = reader\n\tif output, err := cmd.CombinedOutput(); err != nil {\n\t\treturn fmt.Errorf(\"%w: error loading docker image with '%s': %v: %s\", errCtrImport, human, err, string(output))\n\t}\n\treturn nil\n}\n","sourceCodeStart":141,"sourceCodeEnd":174,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/nodeup/nodetasks/load_image.go#L141-L174","documentation":"Error \"error decoding image archive from %q: %v\" thrown in kubernetes/kops.","triggerScenarios":"Thrown at upup/pkg/fi/nodeup/nodetasks/load_image.go:159 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}