{"record":{"id":"cb1a21bd1f8e4085","repo":"ipfs/kubo","slug":"error-opening-gzip-reader-w","errorCode":null,"errorMessage":"error opening gzip reader: %w","messagePattern":"error opening gzip reader: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"repo/fsrepo/migrations/unpack.go","lineNumber":38,"sourceCode":"\tdefault:\n\t\terr = fmt.Errorf(\"unrecognized archive type: %s\", atype)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc unpackTgz(arcPath, root, name, out string) error {\n\tfi, err := os.Open(arcPath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot open archive file: %w\", err)\n\t}\n\tdefer fi.Close()\n\n\tgzr, err := gzip.NewReader(fi)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error opening gzip reader: %w\", err)\n\t}\n\tdefer gzr.Close()\n\n\tvar bin io.Reader\n\ttarr := tar.NewReader(gzr)\n\n\tlookFor := root + \"/\" + name\n\tfor {\n\t\tth, err := tarr.Next()\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"cannot read archive: %w\", err)\n\t\t}\n\n\t\tif th.Name == lookFor {\n\t\t\tbin = tarr","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/repo/fsrepo/migrations/unpack.go#L20-L56","documentation":"Fired by unpackTgz when gzip.NewReader fails on the opened archive — the file exists but is not valid gzip data (corrupted download, wrong format). It wraps the gzip error and aborts migration binary extraction.","triggerScenarios":"Thrown at repo/fsrepo/migrations/unpack.go:38 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry to get a fresh download; truncated transfers are the usual cause","Check proxy/AV interference that can mangle binary downloads","Download the migration archive manually if it persists"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}