{"record":{"id":"1b217331e3352489","repo":"risingwavelabs/risingwave","slug":"cannot-find-option-name-please-set-it","errorCode":null,"errorMessage":"Cannot find '{option_name}',please set it.","messagePattern":"Cannot find '(.+?)',please set it\\.","errorType":"validation","errorClass":"SinkError","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/formatter/mod.rs","lineNumber":326,"sourceCode":"        )\n    }\n}\n\nimpl EncoderBuild for TemplateEncoder {\n    async fn build(b: EncoderParams<'_>, pk_indices: Option<Vec<usize>>) -> Result<Self> {\n        let redis_value_type = b\n            .format_desc\n            .options\n            .get(REDIS_VALUE_TYPE)\n            .map_or(REDIS_VALUE_TYPE_STRING, |s| s.as_str());\n        match redis_value_type {\n            REDIS_VALUE_TYPE_STRING => {\n                let option_name = match pk_indices {\n                    Some(_) => KEY_FORMAT,\n                    None => VALUE_FORMAT,\n                };\n                let template = b.format_desc.options.get(option_name).ok_or_else(|| {\n                    SinkError::Config(anyhow!(\"Cannot find '{option_name}',please set it.\"))\n                })?;\n                Ok(TemplateEncoder::new_string(\n                    b.schema,\n                    pk_indices,\n                    template.clone(),\n                ))\n            }\n            REDIS_VALUE_TYPE_GEO => match pk_indices {\n                Some(_) => {\n                    let member_name = b.format_desc.options.get(MEMBER_NAME).ok_or_else(|| {\n                        SinkError::Config(anyhow!(\"Cannot find `{MEMBER_NAME}`,please set it.\"))\n                    })?;\n                    let template = b.format_desc.options.get(KEY_FORMAT).ok_or_else(|| {\n                        SinkError::Config(anyhow!(\"Cannot find `{KEY_FORMAT}`,please set it.\"))\n                    })?;\n                    TemplateEncoder::new_geo_key(\n                        b.schema,\n                        pk_indices,","sourceCodeStart":308,"sourceCodeEnd":344,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/formatter/mod.rs#L308-L344","documentation":"The Redis sink in RisingWave builds a TemplateEncoder from the sink's WITH options, and for `redis_value_type = 'string'` it requires a template option: `key_format` when the sink has a primary key, otherwise `value_format`. The option named in the message was absent from `format_desc.options`, so the sink fails during connector build with a SinkError::Config.","triggerScenarios":"Creating a Redis sink with `redis_value_type = 'string'` (the default) but omitting the required template option: no `key_format` when the sink defines a primary key, or no `value_format` when it does not.","commonSituations":"Users write `WITH (connector='redis', redis.url='...', redis_value_type='string')` and forget the format template; or they set `value_format` but their table has a primary key so the code actually looks up `key_format` (or vice versa).","solutions":["Determine whether your sink has a primary key: if yes add `key_format`, if no add `value_format` to the WITH options.","Provide the missing template string, e.g. `key_format = '%s:id'` or `value_format = '{\"id\": %s}'`, using RisingWave template placeholders for columns.","Check for typos in the option name — it must be exactly `key_format` or `value_format`, not `keyformat`/`key-format`."],"exampleFix":"// before\nCREATE SINK s FROM mv INTO redis WITH (\n  connector = 'redis',\n  redis.url = 'redis://127.0.0.1:6379',\n  redis_value_type = 'string'\n);\n// after\nCREATE SINK s FROM mv INTO redis WITH (\n  connector = 'redis',\n  redis.url = 'redis://127.0.0.1:6379',\n  redis_value_type = 'string',\n  key_format = '%s'   -- table has a primary key; use value_format if it does not\n);","handlingStrategy":"validation","validationCode":"let has_pk = <sink_has_primary_key>;\nlet required = if has_pk { \"key_format\" } else { \"value_format\" };\nif !with_options.contains_key(required) {\n    return Err(format!(\"Redis string sink requires `{}` in WITH options\", required));\n}","typeGuard":"fn has_option(opts: &HashMap<String, String>, key: &str) -> bool {\n    opts.get(key).map(|v| !v.trim().is_empty()).unwrap_or(false)\n}","tryCatchPattern":"match sink_build_result {\n    Err(e) if e.to_string().contains(\"please set it\") => {\n        eprintln!(\"Redis sink misconfigured: {}\", e); // add key_format/value_format and retry DDL\n    }\n    other => other?,\n}","preventionTips":["Always pair redis_value_type='string' with key_format when the sink has a primary key and value_format otherwise","Copy option names exactly from the RisingWave Redis sink documentation","Test sink DDL on a dev cluster before production"],"tags":["redis","sink","configuration","missing-option"],"backgroundTag":"missing-required-option","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}