{"record":{"id":"b54892bee8407b72","repo":"quickwit-oss/quickwit","slug":"desired-num-pipelines-must-be-strictly-positive","errorCode":null,"errorMessage":"`desired_num_pipelines` must be strictly positive","messagePattern":"`desired_num_pipelines` must be strictly positive","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-config/src/source_config/serialize.rs","lineNumber":105,"sourceCode":"\n    Ok(new_source_config)\n}\n\nimpl SourceConfigForSerialization {\n    /// Checks the validity of the `SourceConfig` as a \"deserializable source\".\n    ///\n    /// Two remarks:\n    /// - This does not check connectivity, it just validate configuration, without performing any\n    ///   IO. See `check_connectivity(..)`.\n    /// - This is used each time the `SourceConfig` is deserialized (at creation but also during\n    ///   communications with the metastore). When ingesting from stdin, we programmatically create\n    ///   an invalid `SourceConfig` and only use it locally.\n    fn validate_and_build(self) -> anyhow::Result<SourceConfig> {\n        if !RESERVED_SOURCE_IDS.contains(&self.source_id.as_str()) {\n            validate_identifier(\"source\", &self.source_id)?;\n        }\n        let num_pipelines = NonZeroUsize::new(self.num_pipelines)\n            .ok_or_else(|| anyhow::anyhow!(\"`desired_num_pipelines` must be strictly positive\"))?;\n        match &self.source_params {\n            SourceParams::Stdin => {\n                bail!(\n                    \"stdin can only be used as source through the CLI command `quickwit tool \\\n                     local-ingest`\"\n                );\n            }\n            SourceParams::File(_)\n            | SourceParams::Kafka(_)\n            | SourceParams::Kinesis(_)\n            | SourceParams::Pulsar(_) => {\n                // TODO consider any validation opportunity\n            }\n            SourceParams::PubSub(_)\n            | SourceParams::Ingest\n            | SourceParams::IngestApi\n            | SourceParams::IngestCli\n            | SourceParams::Vec(_)","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-config/src/source_config/serialize.rs#L87-L123","documentation":"SourceConfig validation requires the number of indexing pipelines (`num_pipelines`) to be a positive non-zero value. The builder converts it into a `NonZeroUsize`, and if the user supplied 0 the construction fails with this message naming the YAML/JSON key `desired_num_pipelines`. It is a config validation error raised before any indexing work starts.","triggerScenarios":"Creating or updating a source config (via `load_source_config_from_user_config` or `load_source_config_update` such as REST POST/PATCH on a source, or index config deserialization) with `desired_num_pipelines: 0` or the field set to 0 programmatically.","commonSituations":"Templated YAML where a variable defaulted to 0, automation computing pipeline counts from an empty/zero value, or copy-pasted configs where the field was zeroed to 'disable' the source.","solutions":["Set `desired_num_pipelines` to a positive integer (>= 1) in the source config.","If the count comes from a variable/templeting, default it to 1 when the computed value is 0.","To effectively disable a source, remove the source or set `enabled: false` instead of setting pipelines to 0."],"exampleFix":"# before\nsource:\n  desired_num_pipelines: 0\n# after\nsource:\n  desired_num_pipelines: 1","handlingStrategy":"validation","validationCode":"if let Some(n) = source_config.desired_num_pipelines {\n    if n == 0 {\n        return Err(\"desired_num_pipelines must be >= 1\");\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate pipeline counts against >= 1 in config CI checks.","Default templated values to 1 rather than 0.","Use removal/`enabled: false` to disable sources, not zero pipelines."],"tags":["config","validation","indexing"],"backgroundTag":"invalid-config-value","analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}