{"record":{"id":"9b5a06903b295d38","repo":"weaviate/weaviate","slug":"open-not-found-at-original-or-delete-marker-path","errorCode":null,"errorMessage":"open: not found at original or delete-marker path: %w","messagePattern":"open: not found at original or delete-marker path: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"usecases/backup/zip.go","lineNumber":506,"sourceCode":"\t\t\t}\n\t\t\treturn info, nil\n\t\t}\n\t\treturn nil, fmt.Errorf(\"stat: %w\", err)\n\t}\n\treturn info, nil\n}\n\n// openWithDeleteMarkerFallback opens the file at relPath under the source\n// directory. If the file does not exist, it retries with the delete-marker\n// prefix in case the collection was renamed during an ongoing backup.\nfunc (z *zip) openWithDeleteMarkerFallback(relPath string) (*os.File, error) {\n\tabsPath := filepath.Join(z.sourcePath, relPath)\n\tf, err := os.Open(absPath)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\tf, err = os.Open(filepath.Join(z.sourcePath, entBackup.DeleteMarkerAdd(relPath)))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"open: not found at original or delete-marker path: %w\", err)\n\t\t\t}\n\t\t\treturn f, nil\n\t\t}\n\t\treturn nil, fmt.Errorf(\"open: %w\", err)\n\t}\n\treturn f, nil\n}\n\ntype zstdWrapper struct {\n\tz *zstd.Decoder\n}\n\nfunc (z zstdWrapper) Read(p []byte) (n int, err error) {\n\treturn z.z.Read(p)\n}\n\nfunc (z zstdWrapper) Close() error {\n\tz.z.Close()","sourceCodeStart":488,"sourceCodeEnd":524,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/usecases/backup/zip.go#L488-L524","documentation":"This error is returned by openWithDeleteMarkerFallback in usecases/backup/zip.go when, during a backup write, neither the original relative path nor the delete-marker-derived path (entBackup.DeleteMarkerAdd(relPath)) could be opened under the backup source directory. It wraps the underlying os.Open error, so the cause is almost always a missing file in the source tree. The library throws it because backup streaming expects every file listed in the iteration to exist either at its original location or at its delete-marker location.","triggerScenarios":"WriteRegular calls openWithDeleteMarkerFallback with a relPath enumerated from the backup contents, but the file was removed from the source path between listing and opening, or the delete-marker companion file is also absent (e.g. partially deleted source directory, incomplete backup destination).","commonSituations":"Source data deleted while a backup is running (concurrent deletion), restoring from a source directory that was pruned by retention/cleanup, misconfigured sourcePath pointing at the wrong or truncated directory, NFS/shared-filesystem sync issues where the delete-marker file was not yet flushed.","solutions":["Verify the file exists at z.sourcePath/<relPath>; if not, check for a delete-marker-named variant and restore whichever is missing from a prior backup or the live shard.","Check that the backup sourcePath configuration points to the correct, complete backup destination directory.","Re-run the backup/restore operation against a source directory that is not being concurrently modified; pause deletion/cleanup jobs during backup.","Inspect the wrapped error in the message (%w) for the concrete path and syscall failure (e.g. no such file or directory vs permission denied)."],"exampleFix":"// before (opaque failure)\nf, err := openWithDeleteMarkerFallback(relPath)\nif err != nil { return err }\n\n// after (skip-and-log files that vanished mid-backup)\nf, err := openWithDeleteMarkerFallback(relPath)\nif err != nil {\n    var pe *fs.PathError\n    if errors.As(err, &pe) && errors.Is(pe, fs.ErrNotExist) {\n        logger.Warnf(\"skipping vanished backup file: %v\", err)\n        return nil // continue with next file\n    }\n    return err\n}","handlingStrategy":"try-catch","validationCode":"p := filepath.Join(sourcePath, relPath)\nif _, err := os.Stat(p); err != nil {\n    if _, err2 := os.Stat(filepath.Join(sourcePath, entBackup.DeleteMarkerAdd(relPath))); err2 != nil {\n        return fmt.Errorf(\"backup source incomplete, missing %s: %w\", relPath, err2)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err != nil {\n    var pe *fs.PathError\n    if errors.As(err, &pe) && errors.Is(pe.Err, fs.ErrNotExist) {\n        // reconcile: re-list backup contents or abort cleanly\n        logger.Warnf(\"backup file vanished: %v\", err)\n        return errSkipFile\n    }\n    return err\n}","preventionTips":["Pause data deletion/retention jobs while a backup is running","Verify sourcePath contains the complete backup file set before starting","Monitor for concurrent writers on the backup source directory"],"tags":["filesystem","backup","file-not-found","restore"],"backgroundTag":"backup-file-not-found","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"}