{"record":{"id":"5a3772213858b8d5","repo":"benbjohnson/litestream","slug":"iterate-level-0-ltx-files-w","errorCode":null,"errorMessage":"iterate level 0 ltx files: %w","messagePattern":"iterate level 0 ltx files: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"replica.go","lineNumber":921,"sourceCode":"\t\t\t}\n\t\t}\n\n\t\t// Skip if already covered by a higher-level file.\n\t\tif info.MaxTXID <= currentTXID {\n\t\t\tcontinue\n\t\t}\n\n\t\tif err := r.applyLTXFile(ctx, f, info, pageSize); err != nil {\n\t\t\treturn closeLevel0(fmt.Errorf(\n\t\t\t\t\"apply ltx file (level=%d, min=%s, max=%s): %w\",\n\t\t\t\tinfo.Level, info.MinTXID, info.MaxTXID, err,\n\t\t\t))\n\t\t}\n\t\tcurrentTXID = info.MaxTXID\n\t}\n\n\tif iterErr := itr.Err(); iterErr != nil {\n\t\treturn closeLevel0(fmt.Errorf(\"iterate level 0 ltx files: %w\", iterErr))\n\t}\n\tif _, err := closeLevel0(nil); err != nil {\n\t\treturn currentTXID, err\n\t}\n\n\tif !sawLevel0 {\n\t\tbridgedTXID, err := r.fillFollowGap(ctx, f, currentTXID, currentTXID+1, pageSize)\n\t\tif err != nil {\n\t\t\treturn currentTXID, err\n\t\t}\n\t\tcurrentTXID = bridgedTXID\n\t}\n\n\treturn currentTXID, nil\n}\n\n// applyLTXFile applies a single LTX file's pages to the database file.\n// This follows the same pattern as Hydrator.ApplyLTX (vfs.go:712-747).","sourceCodeStart":903,"sourceCodeEnd":939,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/replica.go#L903-L939","documentation":"After iterating, the level-0 iterator reported an error (itr.Err) in applyNewLTXFiles — the listing failed partway through. Partially-seen files are not applied; the follow loop retries on the next tick.","triggerScenarios":"Thrown at replica.go:921 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check replica backend listing health","Follow mode retries automatically; fix the underlying backend error"],"exampleFix":null,"handlingStrategy":"retry","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"}