{"record":{"id":"ce91b8271f9fb409","repo":"risingwavelabs/risingwave","slug":"invalid-warehouse-path-ce91b8","errorCode":null,"errorMessage":"Invalid warehouse path: {}","messagePattern":"Invalid warehouse path: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/iceberg/create_table.rs","lineNumber":168,"sourceCode":"        let mut names = namespace.clone().inner();\n        names.push(table_name.clone());\n        match &config.common.warehouse_path {\n            Some(warehouse_path) => {\n                let is_s3_tables = warehouse_path.starts_with(\"arn:aws:s3tables\");\n                // Lakehouse Iceberg REST catalog federation uses bq:// prefix for BigQuery-managed Iceberg tables.\n                let is_bq_catalog_federation = warehouse_path.starts_with(\"bq://\");\n                let url = Url::parse(warehouse_path);\n                if url.is_err() || is_s3_tables || is_bq_catalog_federation {\n                    // For rest catalog, the warehouse_path could be a warehouse name.\n                    // In this case, we should specify the location when creating a table.\n                    if config\n                        .common\n                        .is_rest_catalog()\n                        .map_err(|err| SinkError::Config(anyhow!(err)))?\n                    {\n                        None\n                    } else {\n                        bail!(format!(\"Invalid warehouse path: {}\", warehouse_path))\n                    }\n                } else if warehouse_path.ends_with('/') {\n                    Some(format!(\"{}{}\", warehouse_path, names.join(\"/\")))\n                } else {\n                    Some(format!(\"{}/{}\", warehouse_path, names.join(\"/\")))\n                }\n            }\n            None => None,\n        }\n    };\n\n    let partition_spec = match &config.partition_by {\n        Some(partition_by) => {\n            let mut partition_fields = Vec::<UnboundPartitionField>::new();\n            for (i, (column, transform)) in parse_partition_by_exprs(partition_by.clone())?\n                .into_iter()\n                .enumerate()\n            {","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/iceberg/create_table.rs#L150-L186","documentation":"The computed table location is derived from `warehouse` plus the namespace/table name. If the warehouse path is not a parseable URL and the catalog is not a REST catalog (where a logical warehouse name is allowed), creating a location is impossible and the code bails with 'Invalid warehouse path: {}'.","triggerScenarios":"In create_table_if_not_exists_impl, url parsing of warehouse_path fails (or is_s3_tables/is_bq_catalog_federation apply) and is_rest_catalog() returns false, so the code cannot derive None for the location and calls bail! with the raw warehouse_path value.","commonSituations":"Using a Hive/JDBC/Glue catalog with `warehouse` set to a logical name instead of an object-store URI; missing s3://, gs://, or file:// prefix; trailing placeholder text in warehouse option.","solutions":["Change `warehouse` to an absolute object-store URL like `s3://bucket/iceberg/`.","Alternatively switch to a REST catalog, which permits warehouse names without a URL.","Validate the warehouse URI format before creating the sink.","Check for typos or empty values in the warehouse option."],"exampleFix":"// before\nWITH (connector='iceberg', catalog.type='jdbc', warehouse='prod_warehouse')\n// after\nWITH (connector='iceberg', catalog.type='jdbc', warehouse='s3://my-bucket/prod_warehouse/')","handlingStrategy":"validation","validationCode":"// Validate warehouse URI format before invoking sink creation\nmatch url::Url::parse(warehouse) {\n    Ok(_) => {},\n    Err(_) if is_rest_catalog => {}, // logical names allowed\n    Err(_) => eprintln!(\"Invalid warehouse path: {warehouse} — use e.g. s3://bucket/path/\"),\n}","typeGuard":"fn is_valid_warehouse(warehouse: &str, is_rest: bool) -> bool {\n    is_rest || url::Url::parse(warehouse).is_ok()\n}","tryCatchPattern":"match result {\n    Err(e) if e.to_string().starts_with(\"Invalid warehouse path\") => {\n        // correct the warehouse option to an absolute URL or switch to a REST catalog\n    }\n    other => other?,\n}","preventionTips":["Include the URI scheme in warehouse for object-store catalogs.","Don't leave placeholder values in warehouse options.","Document that REST catalogs accept logical warehouse names, others don't."],"tags":["rust","iceberg","config","url"],"backgroundTag":"invalid-url-format","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"}