siyuan-note/siyuan · warning
no entry
Error message
no entry
What it means
During UploadAssets, when an uploaded .rtfd.zip archive is unzipped, the kernel reads the extracted directory expecting at least one RTFD entry. If the extracted directory is empty (no entries), it records 'no entry' as the failure reason for that file, cleans up the temp dirs, and continues with the remaining files. It guards against malformed or empty RTFD zip uploads.
Solutions
- Re-create the zip so it contains the <name>.rtfd directory bundle at the archive root (zip -r foo.rtfd.zip foo.rtfd)
- Check the failed files in the UploadAssets response to confirm which upload failed, then re-upload a corrected archive
- If the content is plain files, upload them individually instead of as an RTFD zip
Example fix
// before: zip containing loose files
mydoc.rtfd.zip
├─ TXT.rtf
└─ image.png
// after: zip containing the .rtfd bundle
mydoc.rtfd.zip
└─ mydoc.rtfd/
├─ TXT.rtf
└─ image.png Defensive patterns
Strategy: validation
Validate before calling
// before upload, verify the RTFD zip has a top-level directory entry
entries, err := zip.OpenReader(path)
if err == nil {
defer entries.Close()
hasDir := false
for _, f := range entries.File {
if strings.HasSuffix(f.Name, ".rtfd/") { hasDir = true; break }
}
if !hasDir { return fmt.Errorf("%s is not a valid .rtfd.zip bundle", path) }
} Try / catch
// inspect per-file failures in the upload result
result, _ := UploadAssets(...)
for _, f := range result.FailedFiles {
if f.Err.Error() == "no entry" { /* re-zip and retry that file */ }
} Prevention
- Zip the .rtfd bundle itself, not the files inside it
- Test RTFD zips by listing top-level entries before uploading
- Show users a clear message when an RTFD upload fails in the errFiles/failed list
When it happens
Trigger: Uploading a .rtfd.zip file whose archive contains no inner RTFD directory entries — e.g. an empty zip, a zip whose top-level entry is a plain file rather than the expected <name>.rtfd directory, or an archive already pruned by another tool. The error is returned per-file in the upload result's failed list, not as a thrown exception.
Common situations: Users drag Apple Pages/TextEdit RTFD exports that were re-zipped incorrectly (zipping the files inside the .rtfd instead of the .rtfd bundle itself), producing a zip with no recognizable top-level directory.
Understand the failure class
Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.
Related errors
- 199
- Account authentication failed, please login again
- archive entry resolves outside destination
- asset path is sensitive
- BASE64_IMAGE_SIZE_LIMIT
AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19).
Data as JSON: /api/errors/ba024e3084d741f9.
Report an issue: GitHub.
Appendix: source
Thrown at kernel/model/upload.go:529
fName = newAssetFileName(fName)
tmpDir2 := filepath.Join(util.TempDir, "convert", "zip", gulu.Rand.String(7))
if err = gulu.Zip.Unzip(writePath, tmpDir2); err != nil {
recordFailure(index, file.Filename, fName, err)
_ = os.RemoveAll(tmpDir)
_ = os.RemoveAll(tmpDir2)
continue
}
entries, readErr := readRTFDDir(tmpDir2)
if nil != readErr {
recordFailure(index, file.Filename, fName, readErr)
_ = os.RemoveAll(tmpDir)
_ = os.RemoveAll(tmpDir2)
continue
}
if 1 > len(entries) {
logging.LogErrorf("read dir [%s] failed: no entry", tmpDir2)
noEntryErr := errors.New("no entry")
recordFailure(index, file.Filename, fName, noEntryErr)
_ = os.RemoveAll(tmpDir)
_ = os.RemoveAll(tmpDir2)
continue
}
dirName := entries[0].Name()
srcDir := filepath.Join(tmpDir2, dirName)
entries, readErr = readRTFDDir(srcDir)
if nil != readErr {
recordFailure(index, file.Filename, fName, readErr)
_ = os.RemoveAll(tmpDir)
_ = os.RemoveAll(tmpDir2)
continue
}
destDir := filepath.Join(assetsDirPath, fName)
if copyErr := copyRTFDEntries(entries, srcDir, destDir, gulu.File.Copy); nil != copyErr {
logging.LogErrorf("copy RTFD directory [%s] failed: %s", srcDir, copyErr)
recordFailure(index, file.Filename, fName, copyErr)View on GitHub (pinned to 9f775e8a12)