{"record":{"id":"5e58ea43e83f9cf4","repo":"Tencent/WeKnora","slug":"read-md-file-w","errorCode":null,"errorMessage":"read md file: %w","messagePattern":"read md file: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/infrastructure/docparser/mineru_cloud_converter.go","lineNumber":401,"sourceCode":"\t\tentries[f.Name] = f\n\t\tif strings.HasSuffix(f.Name, \".md\") {\n\t\t\tmdFiles = append(mdFiles, f.Name)\n\t\t}\n\t}\n\tif len(mdFiles) == 0 {\n\t\treturn \"\", nil, fmt.Errorf(\"no .md file found in zip\")\n\t}\n\tsort.Slice(mdFiles, func(i, j int) bool {\n\t\tdi, dj := strings.Count(mdFiles[i], \"/\"), strings.Count(mdFiles[j], \"/\")\n\t\tif di != dj {\n\t\t\treturn di < dj\n\t\t}\n\t\treturn mdFiles[i] < mdFiles[j]\n\t})\n\n\tmdText, err := readZipEntry(entries[mdFiles[0]])\n\tif err != nil {\n\t\treturn \"\", nil, fmt.Errorf(\"read md file: %w\", err)\n\t}\n\n\tmdDir := filepath.Dir(mdFiles[0])\n\n\t// Extract referenced images\n\tvar imageRefs []types.ImageRef\n\tseen := map[string]bool{}\n\tfor _, match := range imgRefPattern.FindAllStringSubmatch(mdText, -1) {\n\t\timgPath := match[1]\n\t\tif strings.HasPrefix(imgPath, \"http://\") || strings.HasPrefix(imgPath, \"https://\") || strings.HasPrefix(imgPath, \"data:\") {\n\t\t\tcontinue\n\t\t}\n\t\tif seen[imgPath] {\n\t\t\tcontinue\n\t\t}\n\t\tseen[imgPath] = true\n\n\t\tresolved := resolveInZip(imgPath, mdDir, entries)","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/infrastructure/docparser/mineru_cloud_converter.go#L383-L419","documentation":"The chosen .md entry inside the result ZIP could not be read/decompressed by readZipEntry. The archive lists the Markdown file but extracting its bytes failed (corrupt deflate stream, CRC mismatch, entry truncated).","triggerScenarios":"readZipEntry(entries[mdFiles[0]]) returns an error when calling f.Open()/io.ReadAll on the selected .md member — typically a truncated or corrupt ZIP member.","commonSituations":"ZIP truncated during upload to result storage (upload interrupted, size limit hit); storage backend corruption; very large md entry hitting memory limits in readZipEntry's implementation.","solutions":["Re-run the parse job — a corrupt archive is usually not recoverable client-side.","Check MinerU's upload path for size limits or interrupted multipart uploads of the result ZIP.","Retry downloadAndExtractZip first to rule out a download-side truncation that only surfaces here.","If it recurs for specific documents, try parsing a smaller/simpler file to isolate size-related corruption."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"md, _, err := conv.Read(ctx, req)\nif err != nil && strings.Contains(err.Error(), \"read md file\") {\n    // corrupt archive member: one retry, then fail with the document id for reprocessing\n    md, _, err = conv.Read(ctx, req)\n    if err != nil {\n        return markDocumentForReprocess(req, err)\n    }\n}","preventionTips":["Retry the parse job once before surfacing the failure","Check storage upload paths for size limits and multipart completion","Track which documents repeatedly produce corrupt archives","Keep request timeouts generous so large ZIPs aren't truncated"],"tags":["zip","corrupt-data","io","mineru"],"backgroundTag":"corrupt-zip-entry","analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}