{"record":{"id":"4f875957f3223e18","repo":"JuliusBrussee/caveman","slug":"ccr-max-storage-bytes-must-be-positive","errorCode":null,"errorMessage":"ccr max storage bytes must be positive","messagePattern":"ccr max storage bytes must be positive","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/ccr/store_sqlite.go","lineNumber":149,"sourceCode":"\t\tif err != nil || parsed <= 0 {\n\t\t\treturn nil, fmt.Errorf(\"CAVEMAN_CCR_MAX_BYTES must be a positive integer\")\n\t\t}\n\t\tmaxBytes = parsed\n\t}\n\treturn OpenWithBudget(path, maxBytes)\n}\n\n// OpenWithBudget opens a persistent store with an explicit retained-payload\n// budget. New writes fail with ErrBudgetExceeded; existing recovery rows are\n// never evicted because an emitted transformed request may still reference any\n// handle.\nfunc OpenWithBudget(path string, maxBytes int64) (*Store, error) {\n\treturn openWithBudget(path, maxBytes, nil)\n}\n\nfunc openWithBudget(path string, maxBytes int64, afterPrepare func()) (*Store, error) {\n\tif maxBytes <= 0 {\n\t\treturn nil, fmt.Errorf(\"ccr max storage bytes must be positive\")\n\t}\n\tcanonicalPath, err := PrepareSQLitePathCanonical(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif afterPrepare != nil {\n\t\tafterPrepare()\n\t}\n\tdb, err := sql.Open(\"sqlite\", SQLiteDSN(canonicalPath))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"open sqlite %q: %w\", canonicalPath, err)\n\t}\n\t// One writer connection. With a single connection every statement serializes\n\t// in-process (no self-contention) while busy_timeout absorbs cross-process\n\t// contention; it is also mandatory for an in-memory DSN, where a second\n\t// pooled connection would be a second, empty database.\n\tdb.SetMaxOpenConns(1)\n\tdb.SetMaxIdleConns(1)","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/engine/ccr/store_sqlite.go#L131-L167","documentation":"Error \"ccr max storage bytes must be positive\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at engine/ccr/store_sqlite.go:149 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the ccr max storage bytes to a positive value."],"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-15T22:17:37.221Z"}