weaviate/weaviate · error
read bucket dir: %w
Error message
read bucket dir: %w
What it means
snapshotBucketFiles fails to read the source bucket directory (os.ReadDir error), so the set of files to snapshot cannot be enumerated. This typically means the bucket directory vanished or is unreadable (concurrent drop, filesystem error); the snapshot operation aborts, possibly leaving a partial destination directory.
Source
Thrown at adapters/repos/db/lsmkv/bucket_snapshot.go:207
// (segment_edit_ops.db.bolt): it is a live, mutating bolt file — hard-linking
// it shares the inode with every later mutation, and even a copy could pair a
// stale pending set with these segments. With recovery now trusting the
// recorded pending set, a stale sidecar could mark unstripped segments clean.
// Excluding it is safe (same rule as the backup file list): a consumer that
// resurrects data from a snapshot has no op state, so a still-live drop
// re-arms with a fresh snapshot and re-cleans, and a marker restored with the
// schema mints a fresh epoch.
//
// On error, dstDir may contain a partial set of files. The caller is
// responsible for removing dstDir on failure.
func snapshotBucketFiles(srcDir, dstDir string, includeWAL bool) error {
if err := os.MkdirAll(dstDir, 0o755); err != nil {
return fmt.Errorf("create snapshot dir: %w", err)
}
entries, err := os.ReadDir(srcDir)
if err != nil {
return fmt.Errorf("read bucket dir: %w", err)
}
for _, entry := range entries {
if entry.IsDir() {
continue
}
if entry.Name() == segmentEditOpsFileName {
continue
}
ext := filepath.Ext(entry.Name())
if ext == ".tmp" {
continue
}
if ext == ".wal" && !includeWAL {
continue
}
View on GitHub (pinned to 75aa4b6d11)
Solutions
- Verify the source bucket directory exists and is readable
- Check whether the bucket/shard was dropped concurrently during snapshotting
- Clean up any partial destination directory before retrying
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at adapters/repos/db/lsmkv/bucket_snapshot.go:207 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04).
Data as JSON: /api/errors/de6089711aa387e7.
Report an issue: GitHub.