{"record":{"id":"88cf769f49dc1eed","repo":"benbjohnson/litestream","slug":"no-matching-backup-files-available-88cf76","errorCode":null,"errorMessage":"no matching backup files available","messagePattern":"no matching backup files available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"replica.go","lineNumber":715,"sourceCode":"\t\t\t\t_ = closer.Close()\n\t\t\t}\n\t\t}\n\t}()\n\n\tfor _, info := range infos {\n\t\t// Validate file size - must be at least header size to be readable\n\t\tif info.Size < ltx.HeaderSize {\n\t\t\treturn fmt.Errorf(\"invalid ltx file: level=%d min=%s max=%s has size %d bytes (minimum %d)\",\n\t\t\t\tinfo.Level, info.MinTXID, info.MaxTXID, info.Size, ltx.HeaderSize)\n\t\t}\n\n\t\tr.Logger().Debug(\"opening ltx file for restore\", \"level\", info.Level, \"min\", info.MinTXID, \"max\", info.MaxTXID)\n\n\t\trdrs = append(rdrs, internal.NewResumableReader(ctx, r.Client, info.Level, info.MinTXID, info.MaxTXID, info.Size, nil, r.Logger()))\n\t}\n\n\tif len(rdrs) == 0 {\n\t\treturn fmt.Errorf(\"no matching backup files available\")\n\t}\n\n\t// Create parent directory if it doesn't exist.\n\tvar dirInfo os.FileInfo\n\tif db := r.DB(); db != nil {\n\t\tdirInfo = db.dirInfo\n\t}\n\tif err := internal.MkdirAll(filepath.Dir(opt.OutputPath), dirInfo); err != nil {\n\t\treturn fmt.Errorf(\"create parent directory: %w\", err)\n\t}\n\n\t// Output to temp file & atomically rename.\n\ttmpOutputPath := opt.OutputPath + \".tmp\"\n\tr.Logger().Debug(\"compacting into database\", \"path\", tmpOutputPath, \"n\", len(rdrs))\n\tdefer func() { _ = os.Remove(tmpOutputPath) }()\n\n\tf, err := os.Create(tmpOutputPath)\n\tif err != nil {","sourceCodeStart":697,"sourceCodeEnd":733,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/replica.go#L697-L733","documentation":"Guard in Replica.Restore when the iterator of LTX files from the replica client yielded no usable files to apply. Fires when the replica contains no LTX files matching the restore criteria, so there is no backup data from which to reconstruct the database.","triggerScenarios":"Thrown at replica.go:715 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the replica actually contains LTX files (litestream ltx)","Relax the -timestamp/-txid filter to match available history","Take a fresh backup if the replica is empty"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3","analyzedAt":"2026-09-06T18:29:25.564Z","contentChangedAt":"2026-09-06T18:29:25.564Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}