{"record":{"id":"7ad5cbf983ce8746","repo":"ipfs/kubo","slug":"cannot-open-archive-file-w","errorCode":null,"errorMessage":"cannot open archive file: %w","messagePattern":"cannot open archive file: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"repo/fsrepo/migrations/unpack.go","lineNumber":32,"sourceCode":"\tvar err error\n\tswitch atype {\n\tcase \"tar.gz\":\n\t\terr = unpackTgz(arcPath, root, name, out)\n\tcase \"zip\":\n\t\terr = unpackZip(arcPath, root, name, out)\n\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","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/repo/fsrepo/migrations/unpack.go#L14-L50","documentation":"Raised by unpackTgz when os.Open fails on the downloaded migrations archive path; the wrapped error is typically a 'no such file or directory' or permission error, indicating the archive was not downloaded, was cleaned up, or the path is wrong before tar extraction begins.","triggerScenarios":"Thrown at repo/fsrepo/migrations/unpack.go:32 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the download/migration; a partial download can leave a missing/partial file","Check the migrations download/cache directory permissions","Verify disk space"],"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"}