{"record":{"id":"608950f1ff9f6bbb","repo":"risingwavelabs/risingwave","slug":"protobuf-key-is-not-supported","errorCode":null,"errorMessage":"protobuf key is not supported","messagePattern":"protobuf key is not supported","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/parser/protobuf/parser.rs","lineNumber":117,"sourceCode":"    }\n}\n\n#[derive(Debug, Clone)]\npub struct ProtobufParserConfig {\n    wire_type: WireType,\n    pub(crate) message_descriptor: MessageDescriptor,\n    messages_as_jsonb: HashSet<String>,\n}\n\nimpl ProtobufParserConfig {\n    pub async fn new(encoding_properties: EncodingProperties) -> ConnectorResult<Self> {\n        let protobuf_config = try_match_expand!(encoding_properties, EncodingProperties::Protobuf)?;\n        let message_name = &protobuf_config.message_name;\n\n        let wire_type = (&protobuf_config.schema_location).try_into()?;\n        if protobuf_config.key_message_name.is_some() {\n            // https://docs.confluent.io/platform/7.5/control-center/topics/schema.html#c3-schemas-best-practices-key-value-pairs\n            bail!(\"protobuf key is not supported\");\n        }\n        let pool = match protobuf_config.schema_location {\n            SchemaLocation::Confluent {\n                urls,\n                client_config,\n                name_strategy,\n                topic,\n            } => {\n                let url = handle_sr_list(urls.as_str())?;\n                let client = Client::new(url, &client_config)?;\n                let loader = SchemaLoader::Confluent(ConfluentSchemaLoader {\n                    client,\n                    name_strategy,\n                    topic,\n                    key_record_name: None,\n                    val_record_name: Some(message_name.clone()),\n                });\n                let (_schema_id, root_file_descriptor) = loader","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/parser/protobuf/parser.rs#L99-L135","documentation":"The Protobuf parser only supports decoding the message payload; a `key_message_name` in the Protobuf encoding config means a key schema was configured, which is rejected up front. Per Confluent schema-registry best practices, key and value are separate schemas and RisingWave's protobuf source path does not implement key decoding.","triggerScenarios":"`ProtobufParser::new` checks `protobuf_config.key_message_name.is_some()` while building the parser from `EncodingProperties::Protobuf` — any source/MV created with protobuf encoding that specifies a key message name (key schema) bails immediately at creation time.","commonSituations":"Copying a Debezium/Confluent protobuf config that includes a key message name; a generated config template that always sets `key_message_name`; confusion between Kafka message key handling and protobuf key schema support.","solutions":["Remove `key_message_name` (and key-schema settings) from the protobuf encoding config and recreate the source.","Encode all needed identifying fields inside the value message instead of the protobuf key.","If the key is needed, use JSON key encoding or another supported mechanism.","Check the source creation SQL / with-options and strip key-schema entries."],"exampleFix":"-- before\n... FORMAT ENCODE PROTOBUF (message = 'Enveloped', key.message = 'Key', schema.location = '...')\n-- after\n... FORMAT ENCODE PROTOBUF (message = 'Enveloped', schema.location = '...')","handlingStrategy":"validation","validationCode":"// Reject protobuf configs with a key schema before creating the source:\nif protobuf_config.key_message_name.is_some() {\n    return Err(\"protobuf key is not supported; remove key.message from with-options\");\n}","typeGuard":null,"tryCatchPattern":"match create_source(sql) {\n    Err(e) if e.to_string().contains(\"protobuf key is not supported\") => {\n        // strip key.message option and retry\n    }\n    other => other?,\n}","preventionTips":["Never include key.message / key_message_name in protobuf encoding with-options.","Put identifying fields inside the value message instead of a key schema.","Review copied configs (Debezium/Confluent templates) for key-schema entries."],"tags":["protobuf","cdc","configuration","kafka"],"backgroundTag":"unsupported-config-value","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"}