{"record":{"id":"de6089711aa387e7","repo":"weaviate/weaviate","slug":"read-bucket-dir-w","errorCode":null,"errorMessage":"read bucket dir: %w","messagePattern":"read bucket dir: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/repos/db/lsmkv/bucket_snapshot.go","lineNumber":207,"sourceCode":"// (segment_edit_ops.db.bolt): it is a live, mutating bolt file — hard-linking\n// it shares the inode with every later mutation, and even a copy could pair a\n// stale pending set with these segments. With recovery now trusting the\n// recorded pending set, a stale sidecar could mark unstripped segments clean.\n// Excluding it is safe (same rule as the backup file list): a consumer that\n// resurrects data from a snapshot has no op state, so a still-live drop\n// re-arms with a fresh snapshot and re-cleans, and a marker restored with the\n// schema mints a fresh epoch.\n//\n// On error, dstDir may contain a partial set of files. The caller is\n// responsible for removing dstDir on failure.\nfunc snapshotBucketFiles(srcDir, dstDir string, includeWAL bool) error {\n\tif err := os.MkdirAll(dstDir, 0o755); err != nil {\n\t\treturn fmt.Errorf(\"create snapshot dir: %w\", err)\n\t}\n\n\tentries, err := os.ReadDir(srcDir)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"read bucket dir: %w\", err)\n\t}\n\n\tfor _, entry := range entries {\n\t\tif entry.IsDir() {\n\t\t\tcontinue\n\t\t}\n\t\tif entry.Name() == segmentEditOpsFileName {\n\t\t\tcontinue\n\t\t}\n\n\t\text := filepath.Ext(entry.Name())\n\t\tif ext == \".tmp\" {\n\t\t\tcontinue\n\t\t}\n\t\tif ext == \".wal\" && !includeWAL {\n\t\t\tcontinue\n\t\t}\n","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/lsmkv/bucket_snapshot.go#L189-L225","documentation":"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.","triggerScenarios":"Thrown at adapters/repos/db/lsmkv/bucket_snapshot.go:207 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}