{"record":{"id":"a332210397d0bb01","repo":"risingwavelabs/risingwave","slug":"invalid-field-allowed-fields","errorCode":null,"errorMessage":"Invalid field: {}, allowed fields: {:?}","messagePattern":"Invalid field: (.+?), allowed fields: (.+?)","errorType":"validation","errorClass":"ConnectorError","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/elasticsearch_opensearch/elasticsearch_opensearch_config.rs","lineNumber":146,"sourceCode":"}\n\nfn default_batch_size_kb() -> usize {\n    5 * 1024\n}\n\nfn default_concurrent_requests() -> usize {\n    1024\n}\n\nimpl TryFrom<&ElasticsearchConnection> for ElasticSearchOpenSearchConfig {\n    type Error = ConnectorError;\n\n    fn try_from(value: &ElasticsearchConnection) -> std::result::Result<Self, Self::Error> {\n        let allowed_fields: HashSet<&str> = hashset![\"url\", \"username\", \"password\"]; // from ElasticsearchOpenSearchConfig\n\n        for k in value.0.keys() {\n            if !allowed_fields.contains(k.as_str()) {\n                return Err(ConnectorError::from(anyhow!(\n                    \"Invalid field: {}, allowed fields: {:?}\",\n                    k,\n                    allowed_fields\n                )));\n            }\n        }\n\n        let config = serde_json::from_value::<ElasticSearchOpenSearchConfig>(\n            serde_json::to_value(value.0.clone()).unwrap(),\n        )\n        .map_err(|e| SinkError::Config(anyhow!(e)))?;\n        Ok(config)\n    }\n}\n\nimpl ElasticSearchConfig {\n    pub fn from_btreemap(properties: BTreeMap<String, String>) -> Result<Self> {\n        let config = serde_json::from_value::<ElasticSearchConfig>(","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/elasticsearch_opensearch/elasticsearch_opensearch_config.rs#L128-L164","documentation":"Strict validation of the connection properties when converting an ElasticsearchConnection into ElasticsearchOpenSearchConfig. Only `url`, `username`, and `password` are permitted; any other key in the connection's properties map causes this error, preventing silently ignored options.","triggerScenarios":"Defining an ES/OpenSearch connection (CREATE CONNECTION ... TYPE ELASTICSEARCH) whose properties include any key outside {url, username, password}, e.g. `index`, `delimiter`, or `primary_key` mistakenly placed on the connection instead of the sink.","commonSituations":"Copying sink-level WITH options into the connection definition; typos like `Username`; leftover options from a different connector type.","solutions":["Remove unknown keys from the connection definition; keep only url/username/password.","Move sink-specific options (index, primary_key, routing_column, delimiter) into the sink's WITH clause instead.","Check key spelling against the allowed set {url, username, password}."],"exampleFix":"// before\nCREATE CONNECTION es_conn WITH (\n  TYPE = ELASTICSEARCH,\n  url = 'http://localhost:9200',\n  index = 'my-index'\n)\n// after\nCREATE CONNECTION es_conn WITH (\n  TYPE = ELASTICSEARCH,\n  url = 'http://localhost:9200'\n)\n-- put 'index' in the sink WITH clause instead","handlingStrategy":"validation","validationCode":"-- before CREATE CONNECTION\n-- allowed keys are exactly: url, username, password\nCREATE CONNECTION es_conn WITH (TYPE = ELASTICSEARCH, url = 'http://localhost:9200');","typeGuard":null,"tryCatchPattern":"match err { ConnectorError(e) if e.to_string().contains(\"Invalid field\") => move_option_to_sink_with_clause(e), _ => return Err(err) }","preventionTips":["Treat the connection as transport-only config: url + credentials only.","Put index, primary_key, routing_column, delimiter in the sink's WITH clause.","Diff your connection DDL against the docs' allowed-field list before applying."],"tags":["elasticsearch","opensearch","config","validation","connection"],"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"}