{"record":{"id":"2fc9ef7ef92ebbc4","repo":"risingwavelabs/risingwave","slug":"cannot-find-key-format-please-set-it-or-use-j-2fc9ef","errorCode":null,"errorMessage":"Cannot find '{KEY_FORMAT}', please set it or use JSON (geo value type)","messagePattern":"Cannot find '(.+?)', please set it or use JSON \\(geo value type\\)","errorType":"validation","errorClass":"SinkError::Config","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/redis.rs","lineNumber":368,"sourceCode":"                // if not set, default to string\n                Some(REDIS_VALUE_TYPE_STRING) | None => {\n                    let key_format = self.format_desc.options.get(KEY_FORMAT).ok_or_else(|| {\n                        SinkError::Config(anyhow!(\n                            \"Cannot find '{KEY_FORMAT}', please set it or use JSON\"\n                        ))\n                    })?;\n                    TemplateStringEncoder::check_string_format(key_format, &pk_map)?;\n                    let value_format =\n                        self.format_desc.options.get(VALUE_FORMAT).ok_or_else(|| {\n                            SinkError::Config(anyhow!(\n                                \"Cannot find `{VALUE_FORMAT}`, please set it or use JSON\"\n                            ))\n                        })?;\n                    TemplateStringEncoder::check_string_format(value_format, &all_map)?;\n                }\n                Some(REDIS_VALUE_TYPE_GEO) => {\n                    let key_format = self.format_desc.options.get(KEY_FORMAT).ok_or_else(|| {\n                        SinkError::Config(anyhow!(\n                            \"Cannot find '{KEY_FORMAT}', please set it or use JSON\"\n                        ))\n                    })?;\n                    TemplateStringEncoder::check_string_format(key_format, &pk_map)?;\n\n                    let lon_name = self.format_desc.options.get(LON_NAME).ok_or_else(|| {\n                        SinkError::Config(anyhow!(\n                            \"Cannot find `{LON_NAME}`, please set it or use JSON or set `{REDIS_VALUE_TYPE}` to `{REDIS_VALUE_TYPE_STRING}`\"\n                        ))\n                    })?;\n                    let lat_name = self.format_desc.options.get(LAT_NAME).ok_or_else(|| {\n                        SinkError::Config(anyhow!(\n                            \"Cannot find `{LAT_NAME}`, please set it or use JSON or set `{REDIS_VALUE_TYPE}` to `{REDIS_VALUE_TYPE_STRING}`\"\n                        ))\n                    })?;\n                    let member_name = self.format_desc.options.get(MEMBER_NAME).ok_or_else(|| {\n                        SinkError::Config(anyhow!(\n                            \"Cannot find `{MEMBER_NAME}`, please set it or use JSON or set `{REDIS_VALUE_TYPE}` to `{REDIS_VALUE_TYPE_STRING}`\"","sourceCodeStart":350,"sourceCodeEnd":386,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/redis.rs#L350-L386","documentation":"When a Redis sink uses template encoding with `redis_value_type = 'geospatial'`, a `key_format` template defining the GEO set key is mandatory. RedisSink::validate raises this SinkError::Config when the `key_format` option cannot be found, suggesting either setting it or falling back to the string value type.","triggerScenarios":"CREATE SINK with connector='redis', encode template, `redis_value_type = 'geospatial'`, and no `key_format` option in the sink options (src/connector/src/sink/redis.rs:366-371).","commonSituations":"Configuring GEOADD-style sinks and providing only longitude/latitude/member but forgetting key_format; migrating a string-type sink config to geospatial without adding key_format; misspelling the option.","solutions":["Add `key_format = '<template>'` to the sink options, e.g. key_format = 'geo::{pk}'","Or change redis_value_type to 'string' which uses a different option set","Confirm the option key is spelled `key_format`"],"exampleFix":"-- before\n... encode template (redis_value_type = 'geospatial', longitude = 'lon', latitude = 'lat', member = 'm')\n-- after\n... encode template (redis_value_type = 'geospatial', key_format = 'geo::{pk}', longitude = 'lon', latitude = 'lat', member = 'm')","handlingStrategy":"validation","validationCode":"-- for redis_value_type='geospatial', verify key_format exists before DDL:\n-- options.contains_key(\"key_format\")","typeGuard":null,"tryCatchPattern":"match result.err() { Some(e) if e.contains(\"key_format\") => add_missing_option(\"key_format\"), _ => propagate(result) }","preventionTips":["Maintain one canonical GEO sink template with key_format, longitude, latitude, member","Run CREATE SINK against a dev cluster to surface validate() errors early","Never hand-edit redis_value_type without updating its required option set"],"tags":["redis","sink","configuration","geospatial"],"backgroundTag":"missing-required-config-field","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"}