{"record":{"id":"77379a7f1811756e","repo":"ipfs/kubo","slug":"error-extracting-binary-from-archive-w","errorCode":null,"errorMessage":"error extracting binary from archive: %w","messagePattern":"error extracting binary from archive: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"repo/fsrepo/migrations/unpack.go","lineNumber":81,"sourceCode":"\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 {\n\t\treturn fmt.Errorf(\"error opening zip reader: %w\", err)\n\t}\n\tdefer zipr.Close()\n\n\tlookFor := root + \"/\" + name\n\tvar bin io.ReadCloser\n\tfor _, fis := range zipr.File {\n\t\tif fis.Name == lookFor {\n\t\t\trc, err := fis.Open()\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error extracting binary from archive: %w\", err)\n\t\t\t}\n\n\t\t\tbin = rc\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 writeToPath(rc io.Reader, out string) error {\n\tbinfi, err := os.Create(out)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating output file '%s': %w\", out, err)","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/repo/fsrepo/migrations/unpack.go#L63-L99","documentation":"Fired by unpackZip when opening the matching zip entry (fis.Open) for the migration binary fails — e.g. entry corruption or unsupported compression. It wraps the error and aborts extraction of the migration binary.","triggerScenarios":"Thrown at repo/fsrepo/migrations/unpack.go:81 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry with a fresh download; corrupt entries come from truncated transfers","Verify disk space and file permissions","Extract the binary manually from a re-downloaded archive"],"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"}