{"record":{"id":"ee8d1c9e9e8e6d7f","repo":"risingwavelabs/risingwave","slug":"unused-format-encode-option-key-message-name","errorCode":null,"errorMessage":"unused FORMAT ENCODE option: key.message='{name}'","messagePattern":"unused FORMAT ENCODE option: key\\.message='(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/parser/avro/parser.rs","lineNumber":190,"sourceCode":"        let AvroProperties {\n            schema_location,\n            record_name,\n            key_record_name,\n            map_handling,\n        } = try_match_expand!(encoding_properties, EncodingProperties::Avro)?;\n        match schema_location {\n            SchemaLocation::Confluent {\n                urls: schema_location,\n                client_config,\n                name_strategy,\n                topic,\n            } => {\n                let url = handle_sr_list(schema_location.as_str())?;\n                let client = Client::new(url, &client_config)?;\n                let resolver = ConfluentSchemaCache::new(client);\n\n                if let Some(name) = &key_record_name {\n                    bail!(\"unused FORMAT ENCODE option: key.message='{name}'\");\n                }\n                let subject_value = get_subject_by_strategy(\n                    &name_strategy,\n                    topic.as_str(),\n                    record_name.as_deref(),\n                    false,\n                )?;\n                tracing::debug!(\"value subject {subject_value}\");\n\n                Ok(Self {\n                    schema: Arc::new(ResolvedAvroSchema::create(\n                        resolver.get_by_subject(&subject_value).await?,\n                    )?),\n                    writer_schema_cache: WriterSchemaCache::Confluent(Arc::new(resolver)),\n                    map_handling,\n                })\n            }\n            SchemaLocation::File {","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/parser/avro/parser.rs#L172-L208","documentation":"When creating an Avro parser from a schema_location (schema registry URL), the optional key_record_name option (key.message) has no meaning — the key schema is derived by subject-name strategy, not by a record name. The parser rejects the combination instead of silently ignoring it.","triggerScenarios":"Calling ParserConfig::new with SourceFormat::Plain + SourceEncode::Avro and schema_location set, while also passing the `key.message` option.","commonSituations":"Copy-pasting DEBEZIUM/protobuf-style config (where key.message is valid) into a plain Avro source; applying a template config from an upsert-avro source.","solutions":["Remove the `key.message` option from the source definition","If a specific key record name is required, switch to the upsert Avro path (row_schema_location / confluent-wire-schema) where key.record.name is honored","Verify with SHOW SOURCE / CREATE SOURCE DDL that key.message is not present"],"exampleFix":"-- before\nCREATE SOURCE s (...) WITH (...) FORMAT PLAIN ENCODE AVRO (schema.location='http://sr:8081', key.message='MyKey');\n-- after\nCREATE SOURCE s (...) WITH (...) FORMAT PLAIN ENCODE AVRO (schema.location='http://sr:8081');","handlingStrategy":"validation","validationCode":"const unused = [\"key.message\"].filter(k => Object.keys(avroOptions).includes(k));\nif (schemaLocation && unused.length) throw new Error(`Remove option(s) ${unused} for schema.location-based Avro sources`);","typeGuard":null,"tryCatchPattern":"catch (e) { if (/unused FORMAT ENCODE option/.test(e.message)) { strip key.message and retry } else throw e; }","preventionTips":["Use distinct config templates for schema.location vs registry-subject Avro sources","Validate DDL options against documented per-format allowlists before CREATE SOURCE"],"tags":["avro","schema-registry","config","source-definition"],"backgroundTag":"conflicting-config-options","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"}