{"record":{"id":"e6a86ba02a9f92c5","repo":"JuliusBrussee/caveman","slug":"budget-d-is-below-sqlite-minimum-d","errorCode":null,"errorMessage":"budget %d is below SQLite minimum %d","messagePattern":"budget (.+?) is below SQLite minimum (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/ccr/store_sqlite.go","lineNumber":300,"sourceCode":"\t\treturn err\n\t}\n\tif !os.SameFile(info, opened) {\n\t\treturn fmt.Errorf(\"file changed while opening\")\n\t}\n\treturn file.Chmod(0o600)\n}\n\nfunc configureStorageBudget(db *sql.DB, maxBytes int64) error {\n\tvar pageSize int64\n\tif err := db.QueryRow(`PRAGMA page_size`).Scan(&pageSize); err != nil {\n\t\treturn fmt.Errorf(\"read page size: %w\", err)\n\t}\n\tif pageSize <= 0 {\n\t\treturn errors.New(\"invalid sqlite page size\")\n\t}\n\tmaxPages := maxBytes / pageSize\n\tif maxPages < 16 {\n\t\treturn fmt.Errorf(\"budget %d is below SQLite minimum %d\", maxBytes, 16*pageSize)\n\t}\n\tvar applied int64\n\tif err := db.QueryRow(fmt.Sprintf(`PRAGMA max_page_count=%d`, maxPages)).Scan(&applied); err != nil {\n\t\treturn err\n\t}\n\tif applied < maxPages {\n\t\tmaxPages = applied\n\t}\n\tautoCheckpoint := maxPages / 16\n\tif autoCheckpoint < 1 {\n\t\tautoCheckpoint = 1\n\t}\n\tif _, err := db.Exec(fmt.Sprintf(`PRAGMA wal_autocheckpoint=%d`, autoCheckpoint)); err != nil {\n\t\treturn err\n\t}\n\t_, err := db.Exec(fmt.Sprintf(`PRAGMA journal_size_limit=%d`, maxBytes/8))\n\treturn err\n}","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/engine/ccr/store_sqlite.go#L282-L318","documentation":"Error \"budget %d is below SQLite minimum %d\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at engine/ccr/store_sqlite.go:300 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Raise the budget to at least the SQLite minimum."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}