{"record":{"id":"6c83bb81717b1c4d","repo":"quickwit-oss/quickwit","slug":"commit-timeout-can-only-be-used-with-wait-or","errorCode":null,"errorMessage":"`--commit-timeout` can only be used with --wait or --force options","messagePattern":"`--commit-timeout` can only be used with --wait or --force options","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-cli/src/index.rs","lineNumber":397,"sourceCode":"                .map(|path| path.to_path_buf())\n        } else {\n            None\n        };\n        let detailed_response: bool = matches.get_flag(\"detailed-response\");\n        let batch_size_limit_opt = matches\n            .remove_one::<String>(\"batch-size-limit\")\n            .map(|limit| limit.parse::<ByteSize>())\n            .transpose()\n            .map_err(|error| anyhow!(error))?;\n        let commit_type = match (matches.get_flag(\"wait\"), matches.get_flag(\"force\")) {\n            (false, false) => CommitType::Auto,\n            (false, true) => CommitType::Force,\n            (true, false) => CommitType::WaitFor,\n            (true, true) => bail!(\"`--wait` and `--force` are mutually exclusive options\"),\n        };\n\n        if commit_type == CommitType::Auto && client_args.commit_timeout.is_some() {\n            bail!(\"`--commit-timeout` can only be used with --wait or --force options\");\n        }\n\n        Ok(Self::Ingest(IngestDocsArgs {\n            client_args,\n            index_id,\n            input_path_opt,\n            batch_size_limit_opt,\n            commit_type,\n            detailed_response,\n        }))\n    }\n\n    fn parse_search_args(mut matches: ArgMatches) -> anyhow::Result<Self> {\n        let index_id = matches\n            .remove_one::<String>(\"index\")\n            .expect(\"`index` should be a required arg\");\n        let query = matches\n            .remove_one::<String>(\"query\")","sourceCodeStart":379,"sourceCodeEnd":415,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-cli/src/index.rs#L379-L415","documentation":"Quickwit's `quickwit index ingest` CLI rejects `--commit-timeout` unless the user also explicitly chooses a commit behavior via `--wait` or `--force`. In Auto commit mode the timeout is meaningless because indexing is fire-and-forget, so passing it is treated as a configuration mistake rather than a runtime failure. The check runs during argument parsing, before any client or network work starts.","triggerScenarios":"Running `quickwit index ingest --index <idx> --commit-timeout 30` (or reading the timeout from env/config via client args) without passing either `--wait` or `--force`, so `commit_type == CommitType::Auto` while `client_args.commit_timeout.is_some()`.","commonSituations":"Scripts copied from a `--wait` example but with `--wait` stripped out; users who want faster commits and assume the timeout alone enables waiting; automation that always injects `--commit-timeout` regardless of the commit mode selected elsewhere.","solutions":["Add either `--wait` (block until the commit completes) or `--force` (force an immediate commit) to the ingest command.","Remove `--commit-timeout` if you genuinely want Auto commit (default fire-and-forget behavior).","If driven by a script, make the commit flag and timeout consistent (e.g. only append `--commit-timeout` when `--wait`/`--force` is present)."],"exampleFix":"// before\nquickwit index ingest --index my-index --commit-timeout 30\n// after\nquickwit index ingest --index my-index --wait --commit-timeout 30","handlingStrategy":"validation","validationCode":"const COMMIT_MODES = [\"--wait\", \"--force\"];\nfunction validateIngestArgs(args: string[]): string | null {\n  const hasTimeout = args.some(a => a.startsWith(\"--commit-timeout\"));\n  const hasMode = args.some(a => COMMIT_MODES.includes(a));\n  return hasTimeout && !hasMode\n    ? \"--commit-timeout requires --wait or --force\"\n    : null;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair `--commit-timeout` with `--wait` or `--force` in scripts.","Wrap ingest invocations in a helper function that appends the timeout only when a commit mode is set.","Run ingest commands with `--help` first when assembling new flag combinations."],"tags":["cli","argument-validation","quickwit"],"backgroundTag":"conflicting-config-options","analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}