{"record":{"id":"c933c5fc8d4f0e7d","repo":"rqlite/rqlite","slug":"msg-c933c5","errorCode":null,"errorMessage":"msg","messagePattern":"msg","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/rqlited/config_flags.go","lineNumber":252,"sourceCode":"}\n\nfunc mustParseDuration(d string) time.Duration {\n\ttd, err := time.ParseDuration(d)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn td\n}\n\nfunc splitString(s, sep string) []string {\n\tif s == \"\" {\n\t\treturn nil\n\t}\n\treturn strings.Split(s, sep)\n}\n\nfunc fmtError(msg string) error {\n\treturn errors.New(msg)\n}\n\nfunc usage(msg string) {\n\tfmt.Fprintf(os.Stderr, \"%s\", msg)\n}\n","sourceCodeStart":234,"sourceCodeEnd":258,"githubUrl":"https://github.com/rqlite/rqlite/blob/7586a4d1bdbd9a5a80021664c5a863cd850adb60/cmd/rqlited/config_flags.go#L234-L258","documentation":"fmtError (cmd/rqlited/config_flags.go:252) is a trivial wrapper that converts a message string into a Go error via errors.New. It is used while building Config from command-line flags; any invalid flag value or combination detected during config forging produces this error carrying the specific message.","triggerScenarios":"Starting rqlited with a malformed or invalid value for a config flag, where Forge calls fmtError with the validation message.","commonSituations":"Passing a bad separator format, unparsable duration/size values, or otherwise malformed flags on the rqlited command line.","solutions":["Read the error message text, which names the offending flag or value","Correct the flag value on the rqlited command line","Run rqlited -h to see accepted flag formats"],"exampleFix":"// before\nrqlited -write-queue-capacity=abc\n// after\nrqlited -write-queue-capacity=5000","handlingStrategy":"validation","validationCode":"// validate flags before launching rqlited\nif !regexp.MustCompile(`^[0-9]+$`).MatchString(queueCapacity) {\n    return fmt.Errorf(\"-write-queue-capacity must be numeric, got %q\", queueCapacity)\n}","typeGuard":null,"tryCatchPattern":"if err := forgeConfig(flags); err != nil {\n    fmt.Fprintf(os.Stderr, \"config error: %v\\n\", err)\n    os.Exit(2)\n}","preventionTips":["Validate all flag values in launch scripts before exec'ing rqlited","Use systemd/supervisor configs checked with systemd-analyze or similar","Consult rqlited -h for accepted formats of each flag"],"tags":["cli","configuration","startup"],"backgroundTag":"invalid-cli-flag","analyzedSha":"7586a4d1bdbd9a5a80021664c5a863cd850adb60","analyzedAt":"2026-09-03T07:03:02.260Z","contentChangedAt":"2026-09-03T07:03:02.260Z","schemaVersion":2},"datasetVersion":"2026-09-10T12:17:11.382Z"}