{"record":{"id":"3ab8e69f0fcc2d6e","repo":"ipfs/kubo","slug":"cannot-read-archive-w","errorCode":null,"errorMessage":"cannot read archive: %w","messagePattern":"cannot read archive: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"repo/fsrepo/migrations/unpack.go","lineNumber":52,"sourceCode":"\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\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif bin == nil {\n\t\treturn errors.New(\"no binary found in archive\")\n\t}\n\n\treturn writeToPath(bin, out)\n}\n\nfunc unpackZip(arcPath, root, name, out string) error {\n\tzipr, err := zip.OpenReader(arcPath)\n\tif err != nil {","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/repo/fsrepo/migrations/unpack.go#L34-L70","documentation":"Raised by unpackTgz when tar.Reader.Next returns a non-EOF error while scanning the .tar.gz for the expected root/name entry; this means the archive is corrupt, truncated, or not a valid tar stream, so the migration binary cannot be located and extracted.","triggerScenarios":"Thrown at repo/fsrepo/migrations/unpack.go:52 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the download for an intact archive","Verify checksum if available","Fetch the binary manually from the official source 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"}