Tencent/WeKnora · error
no .md file found in zip
Error message
no .md file found in zip
What it means
The downloaded ZIP contains no file ending in .md, but the MinerU cloud converter requires exactly such a Markdown file to extract the parsed document text. The ZIP opened fine; its contents don't match the expected output layout.
Source
Thrown at internal/infrastructure/docparser/mineru_cloud_converter.go:389
return "", nil, fmt.Errorf("read zip body: %w", err)
}
zr, err := zip.NewReader(bytes.NewReader(zipData), int64(len(zipData)))
if err != nil {
return "", nil, fmt.Errorf("open zip: %w", err)
}
// Find .md files
var mdFiles []string
entries := make(map[string]*zip.File)
for _, f := range zr.File {
entries[f.Name] = f
if strings.HasSuffix(f.Name, ".md") {
mdFiles = append(mdFiles, f.Name)
}
}
if len(mdFiles) == 0 {
return "", nil, fmt.Errorf("no .md file found in zip")
}
sort.Slice(mdFiles, func(i, j int) bool {
di, dj := strings.Count(mdFiles[i], "/"), strings.Count(mdFiles[j], "/")
if di != dj {
return di < dj
}
return mdFiles[i] < mdFiles[j]
})
mdText, err := readZipEntry(entries[mdFiles[0]])
if err != nil {
return "", nil, fmt.Errorf("read md file: %w", err)
}
mdDir := filepath.Dir(mdFiles[0])
// Extract referenced images
var imageRefs []types.ImageRefView on GitHub (pinned to 988cbb0330)
Solutions
- Log the ZIP entry list (zr.File names) to confirm what MinerU actually returned.
- Check the MinerU deployment's output options — ensure Markdown output is enabled and the version matches what this converter expects.
- If needed, broaden the suffix match (e.g. also accept .markdown) or use the content_list JSON as a fallback source.
- Verify the job's status/progress field before treating the ZIP as a finished result.
Example fix
// before
if len(mdFiles) == 0 {
return "", nil, fmt.Errorf("no .md file found in zip")
}
// after
if len(mdFiles) == 0 {
names := make([]string, 0, len(entries))
for n := range entries {
names = append(names, n)
}
return "", nil, fmt.Errorf("no .md file found in zip (entries: %v)", names)
} Defensive patterns
Strategy: fallback
Try / catch
md, _, err := conv.Read(ctx, req)
if err != nil && strings.Contains(err.Error(), "no .md file found in zip") {
// fall back to content_list JSON or surface a clear parse-failure to the caller
return handleMissingMarkdown(err)
} Prevention
- Pin and test against the MinerU server version your converter expects
- Log ZIP entry names on every failure to detect output-format drift early
- Keep an integration test that parses a fixture document end-to-end
- Alert on this error rate — it usually means a server-side config change
When it happens
Trigger: extractDoneResult downloads a job's result ZIP whose entries contain only images/JSON (e.g. layout.json, *_content_list.json) and no *.md entry.
Common situations: MinerU server version or config change (output format toggled, markdown disabled or renamed to .markdown); job failed server-side and an empty/partial archive was uploaded; polling endpoint returned the wrong artifact (e.g. input echo instead of result).
Related errors
AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02).
Data as JSON: /api/errors/ddbd654367ea3165.
Report an issue: GitHub.