{"record":{"id":"b533efbec786c510","repo":"benbjohnson/litestream","slug":"apply-ltx-file-level-d-min-s-max-s-w","errorCode":null,"errorMessage":"apply ltx file (level=%d, min=%s, max=%s): %w","messagePattern":"apply ltx file \\(level=(.+?), min=(.+?), max=(.+?)\\): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"replica.go","lineNumber":912,"sourceCode":"\t\t\t}\n\t\t\tcurrentTXID = bridgedTXID\n\n\t\t\t// Re-check if this file is still needed after bridging.\n\t\t\tif info.MaxTXID <= currentTXID {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif info.MinTXID > currentTXID+1 {\n\t\t\t\treturn closeLevel0(nil)\n\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","sourceCodeStart":894,"sourceCodeEnd":930,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/replica.go#L894-L930","documentation":"applyLTXFile failed to apply a single LTX file's pages to the followed database — opening, decoding, locking, or writing the file failed. The wrapped error identifies the step; the follow loop counts it as a consecutive error and retries.","triggerScenarios":"Thrown at replica.go:912 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error (open/decode/lock/write)","Check file permissions and concurrent access to the followed database","The follow loop retries; persistent failure may require a full re-restore"],"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"}