{"record":{"id":"9c59394ad9b40169","repo":"risingwavelabs/risingwave","slug":"parse-iceberg-config","errorCode":null,"errorMessage":"parse iceberg config","messagePattern":"parse iceberg config","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/meta/src/manager/iceberg_pk_index_sink/mod.rs","lineNumber":60,"sourceCode":"        .unwrap_or(false);\n    let pk_index_enabled = properties\n        .get(ENABLE_PK_INDEX)\n        .map(|v| v.eq_ignore_ascii_case(\"true\"))\n        .unwrap_or(false);\n    connector_match && pk_index_enabled\n}\n\n/// Build an [`IcebergConfig`] from a [`PbSink`], filling secret refs along the\n/// way. Used at CREATE SINK time and during recovery to (re-)register the\n/// commit coordinator.\npub fn build_iceberg_config(pb_sink: &PbSink) -> anyhow::Result<IcebergConfig> {\n    let properties: BTreeMap<String, String> = pb_sink.properties.clone().into_iter().collect();\n    let secret_refs: BTreeMap<_, _> = pb_sink.secret_refs.clone().into_iter().collect();\n    let with_secrets = LocalSecretManager::global()\n        .fill_secrets(properties, secret_refs)\n        .map_err(|e| anyhow!(e).context(\"fill secrets for iceberg\"))?;\n    IcebergConfig::from_btreemap(with_secrets)\n        .map_err(|e| anyhow!(e).context(\"parse iceberg config\"))\n}\n","sourceCodeStart":42,"sourceCodeEnd":62,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/manager/iceberg_pk_index_sink/mod.rs#L42-L62","documentation":"After filling secrets, build_iceberg_config calls IcebergConfig::from_btreemap(with_secrets). If the resulting property map is missing required keys (catalog type, uri, warehouse) or has invalid values, the conversion fails and is wrapped with this context, aborting coordinator construction for the Iceberg pk-index sink.","triggerScenarios":"build_iceberg_config receives a PbSink whose properties (plus filled secrets) do not satisfy IcebergConfig::from_btreemap — e.g. missing warehouse/catalog.uri/catalog-type keys, malformed URL, or unsupported catalog type in the sink's WITH options.","commonSituations":"CREATE SINK with an incomplete Iceberg WITH clause; typo'd property key so the expected config key is absent; sink properties altered after creation; secrets resolved to empty strings and rejected.","solutions":["Log the resolved property keys and compare against IcebergConfig::from_btreemap's required keys (warehouse, catalog type, uri).","Fix the sink's WITH options via ALTER SINK or drop/recreate with the complete Iceberg property set.","Verify the catalog type is one supported by IcebergConfig (e.g. 'glue', 'rest', 's3', 'hadoop') and that endpoint/region/path-style values are valid.","Confirm secret values are non-empty after resolution; empty filled secrets can render the config unparseable."],"exampleFix":"-- before: incomplete WITH clause\nCREATE SINK s FROM mv WITH (connector='iceberg', warehouse='s3://bucket/');\n-- after: full required config\nCREATE SINK s FROM mv WITH (\n  connector='iceberg', type='append only',\n  catalog.type='rest', catalog.uri='http://iceberg-rest:8181',\n  warehouse='s3://bucket/wh', s3.access.key='...', s3.secret.key='...'\n);","handlingStrategy":"validation","validationCode":"// validate required iceberg keys before CREATE SINK\nlet required = [\"catalog.type\", \"catalog.uri\", \"warehouse\"];\nfor key in required {\n    if !sink.properties.contains_key(key) {\n        return Err(anyhow!(\"missing required iceberg sink property: {}\", key));\n    }\n}","typeGuard":null,"tryCatchPattern":"match build_iceberg_config(&sink) {\n    Ok(cfg) => cfg,\n    Err(e) if e.to_string().contains(\"parse iceberg config\") => {\n        // inspect resolved properties, fix WITH options, recreate sink\n        log_resolved_properties(&sink);\n        return Err(e);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Copy WITH clauses from a known-good CREATE SINK template for your catalog type.","Validate sink properties against IcebergConfig's expected keys before creating.","Beware typos in property keys — an unrecognized key silently drops the required value.","Keep catalog connection properties (uri, region, endpoint) in version-controlled config."],"tags":["iceberg","configuration","sink"],"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-23T08:17:48.524Z"}