{"record":{"id":"ab8eaf5612d95dbf","repo":"risingwavelabs/risingwave","slug":"schemas-enable-is-expected-to-be-true-or-false","errorCode":null,"errorMessage":"schemas.enable is expected to be `true` or `false`, got {s}","messagePattern":"schemas\\.enable is expected to be `true` or `false`, got (.+?)","errorType":"validation","errorClass":"SinkError","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/formatter/mod.rs","lineNumber":158,"sourceCode":"            b.schema,\n            pk_indices,\n            DateHandlingMode::FromCe,\n            TimestampHandlingMode::Milli,\n            timestamptz_mode,\n            TimeHandlingMode::Milli,\n            jsonb_handling_mode,\n        );\n        let encoder = if let Some(s) = b.format_desc.options.get(\"schemas.enable\") {\n            match s.to_lowercase().parse::<bool>() {\n                Ok(true) => {\n                    let kafka_connect = KafkaConnectParams {\n                        schema_name: format!(\"{}.{}\", b.db_name, b.sink_from_name),\n                    };\n                    encoder.with_kafka_connect(kafka_connect)\n                }\n                Ok(false) => encoder,\n                _ => {\n                    return Err(SinkError::Config(anyhow!(\n                        \"schemas.enable is expected to be `true` or `false`, got {s}\",\n                    )));\n                }\n            }\n        } else {\n            encoder\n        };\n        Ok(encoder)\n    }\n}\n\nimpl EncoderBuild for ProtoEncoder {\n    async fn build(b: EncoderParams<'_>, pk_indices: Option<Vec<usize>>) -> Result<Self> {\n        // TODO: better to be a compile-time assert\n        assert!(pk_indices.is_none());\n        // By passing `None` as `aws_auth_props`, reading from `s3://` not supported yet.\n        let (descriptor, sid) =\n            crate::schema::protobuf::fetch_descriptor(&b.format_desc.options, b.topic, None)","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/formatter/mod.rs#L140-L176","documentation":"When building a Debezium/Avro encoder with Kafka Connect schema-registry metadata, the option `schemas.enable` must be the boolean `true` or `false`. If its string value parses to neither, `build` returns this Config error because the encoder cannot decide whether to embed schemas in records.","triggerScenarios":"Setting `schemas.enable='yes'`, `'1'`, `'on'`, or any non-boolean string in the sink/format options of a Kafka Connect-compatible formatter build.","commonSituations":"Copy-pasting Kafka Connect worker configs where schemas.enable is a Java boolean (which still requires true/false) or accidentally quoting/nesting the value incorrectly.","solutions":["Set `schemas.enable='true'` or `schemas.enable='false'` exactly (lowercase boolean)","Remove the option entirely if you want the default behavior (treated as disabled)","Check for quoting/nesting issues in the WITH clause that could prepend/append characters"],"exampleFix":"// before\nWITH (... schemas.enable = 'yes')\n// after\nWITH (... schemas.enable = 'true')","handlingStrategy":"validation","validationCode":"const v = opts['schemas.enable'];\nif (v !== undefined && v !== 'true' && v !== 'false') {\n  throw new Error(`schemas.enable must be 'true' or 'false', got ${v}`);\n}","typeGuard":"const isKafkaConnectBool = (v) => v === 'true' || v === 'false';","tryCatchPattern":"try { buildFormatter(opts); } catch (e) { if (String(e).includes('schemas.enable')) { opts['schemas.enable'] = 'false'; buildFormatter(opts); } else { throw e; } }","preventionTips":["Only pass strict lowercase boolean strings for schemas.enable","Drop the option to use defaults instead of inventing truthy values","Don't copy Java/JS truthy conventions into RisingWave options"],"tags":["kafka","config","avro","validation"],"backgroundTag":"invalid-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"}