{"record":{"id":"d6295012101cc8fd","repo":"benbjohnson/litestream","slug":"too-many-arguments-d62950","errorCode":null,"errorMessage":"too many arguments","messagePattern":"too many arguments","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/litestream/start.go","lineNumber":38,"sourceCode":"// Run executes the start command.\nfunc (c *StartCommand) Run(ctx context.Context, args []string) error {\n\tfs := flag.NewFlagSet(\"litestream-start\", flag.ContinueOnError)\n\ttimeout := fs.Int(\"timeout\", 30, \"timeout in seconds\")\n\tsocketPath := fs.String(\"socket\", \"/var/run/litestream.sock\", \"control socket path\")\n\tjsonOutput := fs.Bool(\"json\", false, \"output raw JSON\")\n\tfs.Usage = c.Usage\n\tif err := fs.Parse(args); err != nil {\n\t\treturn err\n\t}\n\n\tif fs.NArg() == 0 {\n\t\treturn &usageError{\n\t\t\tmessage: \"database path required\",\n\t\t\thint:    \"litestream start /path/to/db\",\n\t\t}\n\t}\n\tif fs.NArg() > 1 {\n\t\treturn fmt.Errorf(\"too many arguments\")\n\t}\n\n\tdbPath := fs.Arg(0)\n\n\t// Create HTTP client that connects via Unix socket with timeout\n\tclientTimeout := time.Duration(*timeout) * time.Second\n\tclient := &http.Client{\n\t\tTimeout: clientTimeout,\n\t\tTransport: &http.Transport{\n\t\t\tDialContext: func(_ context.Context, _, _ string) (net.Conn, error) {\n\t\t\t\treturn net.DialTimeout(\"unix\", *socketPath, clientTimeout)\n\t\t\t},\n\t\t},\n\t}\n\n\treq := litestream.StartRequest{\n\t\tPath:    dbPath,\n\t\tTimeout: *timeout,","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/cmd/litestream/start.go#L20-L56","documentation":"`litestream start <dbpath>` sends a start command over the IPC control socket and therefore accepts exactly one positional argument: the database path. Run returns the plain error 'too many arguments' when fs.NArg() > 1. This is a usage error enforced by the command's flag parser before any socket work happens.","triggerScenarios":"Invoking `litestream start` with more than one positional argument, e.g. quoting mistakes like `litestream start /var/lib/my db.sqlite` (unquoted space), passing extra paths, or trailing stray tokens after the db path.","commonSituations":"Paths containing spaces passed without quotes; copy-pasting a command line with multiple databases (start handles one db at a time); accidentally appending flags that were misspelled so they are parsed as positional args.","solutions":["Pass exactly one database path and quote it if it contains spaces: `litestream start \"/var/lib/My App/db.sqlite\"`","Run one `litestream start` per database instead of passing multiple paths","Check for misspelled flags — an unrecognized flag can end up treated as a positional argument","Run `litestream start -h` to review the accepted argument form"],"exampleFix":"// before\nlitestream start /var/lib/my app/db.sqlite\n// error: too many arguments\n\n// after — quote the path\nlitestream start \"/var/lib/my app/db.sqlite\"","handlingStrategy":"validation","validationCode":"// shell pre-flight: assert exactly one positional arg and quote it\n[ $# -eq 1 ] || { echo \"usage: litestream start <dbpath>\"; exit 2; }\nlitestream start \"$1\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Quote database paths in scripts and shell history","Pass only one database path per start invocation","Verify flags are spelled correctly so they aren't parsed as positional args","Check `litestream start -h` when unsure of the argument form"],"tags":["cli","arguments","ipc"],"backgroundTag":"invalid-cli-argument","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"}