risingwavelabs/risingwave · error · SinkError::DeltaLake

Url parse error for S3 deltalake location (wrapped error)

Error message

Url parse error for S3 deltalake location (wrapped error)

What it means

When creating the DeltaLake client for an S3-located table, the connector parses the s3 path into a `Url` via Url::parse. Any parse failure (invalid characters, missing scheme, malformed host) is wrapped into SinkError::DeltaLake, surfacing the underlying url crate error message.

Source

Thrown at src/connector/src/sink/deltalake.rs:103

        AwsAuthProps::enforce_one(prop)?;
        if Self::ENFORCE_SECRET_PROPERTIES.contains(prop) {
            return Err(EnforceSecretError {
                key: prop.to_owned(),
            }
            .into());
        }

        Ok(())
    }
}

impl DeltaLakeCommon {
    pub async fn create_deltalake_client(&self) -> Result<DeltaTable> {
        let table = match Self::get_table_url(&self.location)? {
            DeltaTableUrl::S3(s3_path) => {
                let storage_options = self.build_delta_lake_config_for_aws().await?;
                deltalake::aws::register_handlers(None);
                let url = Url::parse(&s3_path).map_err(|e| SinkError::DeltaLake(anyhow!(e)))?;
                deltalake::open_table_with_storage_options(url, storage_options).await?
            }
            DeltaTableUrl::Local(local_path) => {
                let url = Url::parse(&format!("file://{}", local_path))
                    .map_err(|e| SinkError::DeltaLake(anyhow!(e)))?;
                deltalake::open_table(url).await?
            }
            DeltaTableUrl::Gcs(gcs_path) => {
                let mut storage_options = HashMap::new();
                storage_options.insert(
                    GCS_SERVICE_ACCOUNT.to_owned(),
                    self.gcs_service_account.clone().ok_or_else(|| {
                        SinkError::Config(anyhow!(
                            "gcs.service.account is required with Google Cloud Storage (GCS)"
                        ))
                    })?,
                );
                deltalake::gcp::register_handlers(None);

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Fix the location option so it is a well-formed URL like s3://bucket/path.
  2. Trim whitespace/newlines around the configured location value.
  3. URL-encode or remove invalid characters from bucket/path names.

Example fix

// before
CREATE SINK s INTO DELTALAKE LOCATION = 's3://my bucket/table';
// after
CREATE SINK s INTO DELTALAKE LOCATION = 's3://my-bucket/table';
Defensive patterns

Strategy: validation

Validate before calling

let loc = location.trim();
if !loc.starts_with("s3://") && !loc.starts_with("s3a://") {
    return Err("S3 deltalake location must start with s3:// or s3a://");
}
Url::parse(loc).map_err(|e| format!("invalid location URL: {e}"))?;

Prevention

When it happens

Trigger: create_deltalake_client with a location classified as DeltaTableUrl::S3 whose path fails Url::parse — e.g. 's3://bad host/table', spaces, or control characters in the location string.

Common situations: Typo or extra characters in the sink's deltalake location option; copying a location with trailing spaces/newlines from docs or a config file; special characters in bucket names.

Understand the failure class

Background: "Invalid URL" errors: why new URL(), URI.parse, and reqwest::Url reject your string — missing scheme, whitespace, and bad path format — this error's family across 39 libraries.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/63ef233451e1554b. Report an issue: GitHub.