databendlabs/databend · error

endpoint_url is required for storage azblob

Error message

endpoint_url is required for storage azblob

What it means

parse_azure_params builds StorageParams::Azblob from a URI location's CONNECTION options and requires an `endpoint_url` entry. When the connection string lacks it, it fails with ErrorKind::InvalidInput and "endpoint_url is required for storage azblob". Unlike S3, the azblob storage config here does not default the endpoint from the URL host.

Solutions

  1. Add ENDPOINT_URL to the CONNECTION options: CONNECTION=(ENDPOINT_URL='https://<account>.blob.core.windows.net' ...)
  2. Include the storage account name and container consistently with the endpoint
  3. Use an azure storage connection-string based config if supported instead of raw azblob params
  4. Check documentation for azblob stage requirements and compare with a working example

Example fix

-- before
CREATE STAGE s URL='azblob://mycontainer/data/' CONNECTION=(ACCOUNT_NAME='acct');
-- after
CREATE STAGE s URL='azblob://mycontainer/data/'
  CONNECTION=(ENDPOINT_URL='https://acct.blob.core.windows.net' ACCOUNT_NAME='acct');
Defensive patterns

Strategy: validation

Validate before calling

// check connection options before issuing the statement
if !conn.contains_key("ENDPOINT_URL") {
    return Err(anyhow!("azblob stage requires ENDPOINT_URL in CONNECTION"));
}

Try / catch

match parse_uri_location_resolved(loc) {
    Err(e) if e.to_string().contains("endpoint_url is required") => {
        eprintln!("Add CONNECTION=(ENDPOINT_URL='https://<account>.blob.core.windows.net' ...)");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Issuing a location/COPY/STAGE statement with STORAGE_CONNECTION_STRING style options like 'connection = { ... }' targeting azblob without `endpoint_url`, e.g. CREATE STAGE ... URL='azblob://container/path' CONNECTION=(CONTAINER='x') with no ENDPOINT_URL.

Common situations: Copy-pasting S3-style stage definitions to Azure; forgetting that Azure Blob requires the account-specific https endpoint; omitting the endpoint in connection options while only setting account/container.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of databendlabs/databend@288d84d76e (2026-09-11). Data as JSON: /api/errors/460175f76ae829c0. Report an issue: GitHub.

Appendix: source

Thrown at src/query/sql/src/planner/binder/location.rs:68

use opendal::raw::normalize_path;
use opendal::raw::normalize_root;

/// secure_omission will fix omitted endpoint url schemes into 'https://'
#[inline]
fn secure_omission(endpoint: String) -> String {
    // checking with starts_with() should be enough here
    if !endpoint.starts_with("https://") && !endpoint.starts_with("http://") {
        format!("https://{}", endpoint)
    } else {
        endpoint
    }
}

fn parse_azure_params(l: &mut UriLocation, root: String) -> Result<StorageParams> {
    let endpoint = l.connection.get("endpoint_url").cloned().ok_or_else(|| {
        Error::new(
            ErrorKind::InvalidInput,
            anyhow!("endpoint_url is required for storage azblob"),
        )
    })?;
    let endpoint = secure_omission(endpoint);
    let sp = StorageParams::Azblob(StorageAzblobConfig {
        endpoint_url: endpoint,
        container: l.name.to_string(),
        account_name: l
            .connection
            .get("account_name")
            .cloned()
            .unwrap_or_default(),
        account_key: l.connection.get("account_key").cloned().unwrap_or_default(),
        root,
        network_config: None,
    });

    l.connection
        .check()

View on GitHub (pinned to 288d84d76e)