{"record":{"id":"1ae5239c526db65b","repo":"risingwavelabs/risingwave","slug":"failed-to-create-iceberg-namespace-namespace","errorCode":null,"errorMessage":"failed to create iceberg namespace: {namespace}","messagePattern":"failed to create iceberg namespace: (.+?)","errorType":"exception","errorClass":"SinkError::Iceberg","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/iceberg/create_table.rs","lineNumber":293,"sourceCode":"    namespace: &NamespaceIdent,\n) -> Result<()> {\n    let mut namespaces = vec![namespace.clone()];\n    let mut parent = namespace.parent();\n    while let Some(parent_namespace) = parent {\n        parent = parent_namespace.parent();\n        namespaces.push(parent_namespace);\n    }\n\n    for namespace in namespaces.into_iter().rev() {\n        if !catalog\n            .namespace_exists(&namespace)\n            .await\n            .map_err(|e| SinkError::Iceberg(anyhow!(e)))?\n        {\n            catalog\n                .create_namespace(&namespace, HashMap::default())\n                .await\n                .map_err(|e| SinkError::Iceberg(anyhow!(e)))\n                .with_context(|| format!(\"failed to create iceberg namespace: {namespace}\"))?;\n        }\n    }\n\n    Ok(())\n}\n\nconst MAP_KEY: &str = \"key\";\nconst MAP_VALUE: &str = \"value\";\n\nfn field_is_compatible(\n    rw_type: &risingwave_common::types::DataType,\n    arrow_field: &ArrowField,\n) -> anyhow::Result<bool> {\n    use risingwave_common::types::DataType as RwDataType;\n\n    // A Variant is physically an Arrow struct, but its extension metadata makes it a leaf\n    // Iceberg type. The binding is exclusive in both directions: a plain struct mimicking","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/iceberg/create_table.rs#L275-L311","documentation":"After confirming a namespace does not exist, RisingWave calls `catalog.create_namespace`; if that call fails the error is wrapped in `SinkError::Iceberg` and annotated with `failed to create iceberg namespace: {namespace}`. It means the catalog backend rejected or failed the namespace creation request.","triggerScenarios":"Called from `create_table_if_not_exists_impl` (via `create_namespace_if_not_exists`) when `catalog.create_namespace(&namespace, HashMap::default())` returns Err during Iceberg sink table creation.","commonSituations":"Insufficient permissions on the catalog to create namespaces; namespace already exists but `namespace_exists` gave a stale/false negative (eventual consistency or race with another writer); invalid namespace characters for the catalog backend.","solutions":["Read the wrapped underlying error for the real cause (permission denied, conflict, etc.).","Pre-create the namespace manually in the catalog (or with spark/trino) with correct permissions.","Check catalog credentials/ACLs allow namespace creation.","If it's a race, re-run the sink creation; the namespace now exists and the check will skip creation."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-create the namespace via the catalog CLI/API before sinking\n// REST: PUT /v1/{prefix}/namespaces/{ns} with {\"namespace\": [\"ns\"]}","typeGuard":null,"tryCatchPattern":"// match on the wrapped catalog error kind\nif let Err(e) = create_sink().await {\n    if e.to_string().contains(\"failed to create iceberg namespace\") {\n        log::error!(\"namespace creation failed; check ACLs: {e:#}\");\n    }\n}","preventionTips":["Grant the sink's credentials namespace-create permissions on the catalog.","Pre-create namespaces with your infrastructure tooling so sink creation only handles the table.","Avoid concurrent sink creations targeting the same new namespace."],"tags":["iceberg","catalog","namespace","sink"],"backgroundTag":"database-write-failed","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"}