{"record":{"id":"5bf637f6aebb6f85","repo":"multica-ai/multica","slug":"open-zip-entry-w","errorCode":null,"errorMessage":"open zip entry: %w","messagePattern":"open zip entry: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/internal/cli/update.go","lineNumber":528,"sourceCode":"// extractBinaryFromZip reads a .zip stream and returns the contents of the\n// named file entry. The zip format requires random access, so the full archive\n// is buffered in memory.\nfunc extractBinaryFromZip(r io.Reader, name string) ([]byte, error) {\n\tbuf, err := io.ReadAll(r)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"read zip data: %w\", err)\n\t}\n\n\tzr, err := zip.NewReader(bytes.NewReader(buf), int64(len(buf)))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"zip reader: %w\", err)\n\t}\n\n\tfor _, f := range zr.File {\n\t\tif filepath.Base(f.Name) == name && !f.FileInfo().IsDir() {\n\t\t\trc, err := f.Open()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"open zip entry: %w\", err)\n\t\t\t}\n\t\t\tdefer rc.Close()\n\n\t\t\tdata, err := io.ReadAll(rc)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"read binary: %w\", err)\n\t\t\t}\n\t\t\treturn data, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"binary %q not found in archive\", name)\n}\n","sourceCodeStart":510,"sourceCodeEnd":541,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/internal/cli/update.go#L510-L541","documentation":"Returned by extractBinaryFromZip when the matching zip entry's Open() call fails. zip.File.Open fails when the entry header is corrupt, the compression method is unsupported by the Go zip package, or the local file header disagrees with the central directory. The archive parsed, but this specific member cannot be opened for reading.","triggerScenarios":"Calling extractBinaryFromZip on an archive where the target entry (the platform binary) uses an exotic compression method, was corrupted in transit while the central directory stayed intact, or was produced by a packager with local-header/central-directory mismatches.","commonSituations":"Hand-crafted or repacked release zips (e.g. stripped with a nonstandard tool), partial corruption that only affects the entry's local header, or archives created with compression settings Go's archive/zip does not support (e.g. some LZMA variants).","solutions":["Unzip the downloaded artifact manually ('unzip -t release.zip') to confirm which entry is corrupt","Re-download the release; if it reproduces, the published asset itself is broken — rebuild/re-upload it","If you control packaging, create zips with standard Deflate or Store methods via archive/zip itself"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Pre-flight: confirm the entry opens cleanly before relying on it.\nfunc zipEntryOpens(zr *zip.Reader, name string) bool {\n    for _, f := range zr.File {\n        if filepath.Base(f.Name) == name && !f.FileInfo().IsDir() {\n            rc, err := f.Open()\n            if err != nil {\n                return false\n            }\n            rc.Close()\n            return true\n        }\n    }\n    return false\n}","typeGuard":null,"tryCatchPattern":"Treat this error as 'corrupt artifact': do not retry in-process; re-download once from the source URL and abort if it reproduces.","preventionTips":["Create release archives with archive/zip itself (Deflate/Store) rather than exotic packagers","Run 'unzip -t' on published artifacts in CI before release","Checksum-verify downloads to catch corruption before extraction"],"tags":["zip","self-update","entry-open"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}