{"record":{"id":"b7838377adb3f1da","repo":"risingwavelabs/risingwave","slug":"error-from-iceberg-library-err-defaultlocation","errorCode":null,"errorMessage":"error from iceberg library: {err} (DefaultLocationGenerator::new failed)","messagePattern":"error from iceberg library: (.+?) \\(DefaultLocationGenerator::new failed\\)","errorType":"exception","errorClass":"SinkError::Iceberg","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/iceberg/writer.rs","lineNumber":396,"sourceCode":"            target_file_size_mb = config.target_file_size_mb(),\n            parquet_compression = ?config.get_parquet_compression(),\n            \"iceberg_sink_writer_initialized\",\n        );\n\n        let parquet_writer_properties = WriterProperties::builder()\n            .set_compression(config.get_parquet_compression())\n            .set_max_row_group_bytes(config.write_parquet_max_row_group_bytes())\n            .set_created_by(PARQUET_CREATED_BY.to_owned())\n            .build();\n\n        let parquet_writer_builder =\n            ParquetWriterBuilder::new(parquet_writer_properties, schema.clone());\n        let rolling_builder = RollingFileWriterBuilder::new(\n            parquet_writer_builder,\n            (config.target_file_size_mb() * 1024 * 1024) as usize,\n            table.file_io().clone(),\n            DefaultLocationGenerator::new(table.metadata())\n                .map_err(|err| SinkError::Iceberg(anyhow!(err)))?,\n            DefaultFileNameGenerator::new(\n                writer_param.actor_id.to_string(),\n                Some(unique_uuid_suffix.to_string()),\n                iceberg::spec::DataFileFormat::Parquet,\n            ),\n        );\n        let data_file_builder = DataFileWriterBuilder::new(rolling_builder);\n        let monitored_builder = MonitoredGeneralWriterBuilder::new(\n            data_file_builder,\n            write_qps.clone(),\n            write_latency.clone(),\n        );\n        let writer_builder = TaskWriterBuilderWrapper::new(\n            monitored_builder,\n            fanout_enabled,\n            schema.clone(),\n            partition_spec.clone(),\n            true,","sourceCodeStart":378,"sourceCodeEnd":414,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/iceberg/writer.rs#L378-L414","documentation":"DefaultLocationGenerator::new(table.metadata()) failed inside the iceberg-rs library while building the append-only writer; the library error is wrapped in SinkError::Iceberg with the note '(DefaultLocationGenerator::new failed)'. The location generator derives data file paths from table metadata and can fail when metadata is malformed for path generation (e.g. invalid table location).","triggerScenarios":"Calling build_append_only when the Iceberg table's metadata carries a location that the DefaultLocationGenerator rejects — typically an empty, relative, or otherwise invalid table URI.","commonSituations":"Table created against a misconfigured warehouse/object-store path; table location containing characters the path generator cannot encode; a table registered with a location that is not a valid URL (e.g. missing scheme).","solutions":["Verify the Iceberg table's `location` in metadata is an absolute, well-formed URI (s3://, gs://, file:// etc.) and fix the table or the catalog configuration","Print the underlying library error (it is inside SinkError::Iceberg) to see the exact reason DefaultLocationGenerator rejected the metadata","If on an older iceberg-rs version, check known bugs in DefaultLocationGenerator and upgrade the crate","Re-create the table with a correct location and point the RisingWave sink at the new table"],"exampleFix":"// before\nDefaultLocationGenerator::new(table.metadata())\n    .map_err(|err| SinkError::Iceberg(anyhow!(err)))?,\n// after\nDefaultLocationGenerator::new(table.metadata())\n    .map_err(|err| SinkError::Iceberg(anyhow!(\n        \"DefaultLocationGenerator::new failed: {err}; table location = {}\",\n        table.metadata().location()\n    )))?","handlingStrategy":"validation","validationCode":"let loc = table.metadata().location();\nif !loc.starts_with(\"s3://\") && !loc.starts_with(\"gs://\") && !loc.starts_with(\"file://\") && !loc.starts_with(\"/\") {\n    return Err(format!(\"invalid table location: {loc}\"));\n}","typeGuard":null,"tryCatchPattern":"let location_generator = DefaultLocationGenerator::new(table.metadata())\n    .map_err(|err| SinkError::Iceberg(anyhow!(\"DefaultLocationGenerator::new failed: {err} (table location: {})\", table.metadata().location())))?;","preventionTips":["Verify the Iceberg table location URI is absolute and well-formed before creating the sink","Check catalog/warehouse configuration in the environment the sink runs in","Pin iceberg-rs and review its DefaultLocationGenerator validation rules on upgrades","Print the inner library error rather than discarding it — it names the exact cause"],"tags":["rust","iceberg","writer","table-location"],"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"}