{"record":{"id":"6711b1638aeb4b3c","repo":"benbjohnson/litestream","slug":"invalid-integrity-check-value-s","errorCode":null,"errorMessage":"invalid -integrity-check value: %s","messagePattern":"invalid -integrity-check value: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/litestream/restore.go","lineNumber":84,"sourceCode":"\t\t\tselect {\n\t\t\tcase <-ch:\n\t\t\t\tcancel()\n\t\t\tcase <-cancelCtx.Done():\n\t\t\t}\n\t\t}()\n\t\tctx = cancelCtx\n\t\tdefer cancel()\n\t}\n\n\tswitch *integrityCheck {\n\tcase \"none\":\n\t\topt.IntegrityCheck = litestream.IntegrityCheckNone\n\tcase \"quick\":\n\t\topt.IntegrityCheck = litestream.IntegrityCheckQuick\n\tcase \"full\":\n\t\topt.IntegrityCheck = litestream.IntegrityCheckFull\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid -integrity-check value: %s\", *integrityCheck)\n\t}\n\n\t// Parse timestamp, if specified.\n\tif *timestampStr != \"\" {\n\t\tif opt.Timestamp, err = time.Parse(time.RFC3339, *timestampStr); err != nil {\n\t\t\treturn errors.New(\"invalid -timestamp, must specify in ISO 8601 format (e.g. 2000-01-01T00:00:00Z)\")\n\t\t}\n\t}\n\n\t// Determine replica to restore from.\n\tvar r *litestream.Replica\n\tif litestream.IsURL(fs.Arg(0)) {\n\t\tif *configPath != \"\" {\n\t\t\treturn fmt.Errorf(\"cannot specify a replica URL and the -config flag\")\n\t\t}\n\t\tif r, err = c.loadFromURL(ctx, fs.Arg(0), *ifDBNotExists, &opt); errors.Is(err, errSkipDBExists) {\n\t\t\tslog.Info(\"database already exists, skipping\")\n\t\t\treturn nil","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/cmd/litestream/restore.go#L66-L102","documentation":"The `restore` command's -integrity-check flag only accepts the enum values \"none\", \"quick\", or \"full\", which map to litestream.IntegrityCheckNone/Quick/Full. Any other string fails the switch's default branch with this error. It is a strict enum validation of a CLI flag value.","triggerScenarios":"`litestream restore -integrity-check <value> ...` where value is not exactly none|quick|full — e.g. \"NONE\", \"off\", \"true\", \"basic\", or a misspelling like \"quik\".","commonSituations":"Case-sensitivity surprises (NONE vs none); assuming boolean-style values (true/false); copying flags from other sqlite tools that use different integrity-check vocabularies.","solutions":["Use one of the exact lowercase values: -integrity-check none, quick, or full","Default is fine to omit entirely if you don't need a custom level","Check `litestream restore -h` for the accepted values"],"exampleFix":"// before\nlitestream restore -integrity-check FULL -o out.db s3://bucket/prefix\n// after\nlitestream restore -integrity-check full -o out.db s3://bucket/prefix","handlingStrategy":"validation","validationCode":"valid := map[string]bool{\"none\": true, \"quick\": true, \"full\": true}\nif !valid[integrityCheck] {\n    return fmt.Errorf(\"-integrity-check must be none|quick|full, got %q\", integrityCheck)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the exact lowercase enum strings","Check `litestream restore -h` for accepted values","Keep flag values in shell variables sourced from a validated allowlist"],"tags":["cli","flags","enum","restore"],"backgroundTag":"invalid-enum-value","analyzedSha":"4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3","analyzedAt":"2026-09-06T18:29:25.564Z","contentChangedAt":"2026-09-06T18:29:25.564Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}