dbt-labs/dbt-core · warning

'api_endpoint' is missing a trailing '/', which dbt appends…

Error message

'api_endpoint' is missing a trailing '/', which dbt appends automatically. We suggest setting it to '{endpoint}/' instead.

What it means

This is a non-fatal warning emitted while validating the BigQuery `api_endpoint` connection setting. The endpoint URL does not end with a trailing '/', and dbt appends one automatically when building request URLs. The validator normalizes the value to '{endpoint}/' and prints a suggestion so the user can make the configuration explicit; the connection still proceeds with the corrected value.

Solutions

  1. Add a trailing slash to api_endpoint in profiles.yml: api_endpoint: 'https://your-proxy.example.com/'.
  2. If the value comes from an environment variable, ensure the exported value ends with '/'.
  3. No action strictly required — dbt appends the slash automatically — but fix the config to silence the warning.

Example fix

# before (profiles.yml)
api_endpoint: 'https://your-proxy.example.com'
# after
api_endpoint: 'https://your-proxy.example.com/'
Defensive patterns

Strategy: validation

Validate before calling

// Python pre-check on profiles.yml values before invoking dbt
def check_api_endpoint(endpoint: str) -> str:
    if not endpoint.endswith('/'):
        print(f"warning: 'api_endpoint' is missing a trailing '/'; dbt appends it automatically. Use '{endpoint}/'.")
        return endpoint + '/'
    return endpoint

Type guard

def is_normalized_endpoint(endpoint: str) -> bool:
    return endpoint.startswith('https://') and endpoint.endswith('/')

Try / catch

// This is a warning, not an exception; dbt normalizes and continues.
// To surface it explicitly when invoking dbt programmatically, scan stderr:
if "missing a trailing '/'" in stderr_text:
    print("api_endpoint should end with '/' — update profiles.yml to silence this warning.")

Prevention

When it happens

Trigger: Setting profiles.yml `api_endpoint` for a BigQuery connection (e.g. 'https://your-proxy.example.com') without a trailing slash, then running any dbt command; validate_api_endpoint() (called from apply_connection_args) detects the missing '/' and warns while returning the normalized URL.

Common situations: Configuring a custom BigQuery API proxy or regional endpoint and copying the bare host from browser address bars or docs, which typically omit the trailing slash; also common when the endpoint comes from an environment variable assembled without a trailing slash.

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 dbt-labs/dbt-core@0267ce9170 (2026-09-07). Data as JSON: /api/errors/24b2c568e25d48e3. Report an issue: GitHub.

Appendix: source

Thrown at crates/dbt-auth/src/bigquery/mod.rs:169

        AuthError::config(format!(
            "'api_endpoint' must start with 'http://' or 'https://': {endpoint:?}"
        ))
    })?;

    if url.scheme() != "http" && url.scheme() != "https" {
        return Err(AuthError::config(format!(
            "'api_endpoint' must start with 'http://' or 'https://': {endpoint:?}"
        )));
    }

    if url.path() != "/" || url.query().is_some() || url.fragment().is_some() {
        return Err(AuthError::config(format!(
            "'api_endpoint' must be a bare host (with optional port), e.g. 'https://your-proxy.example.com/': {endpoint:?}"
        )));
    }

    if !endpoint.ends_with('/') {
        warning_printer.warn(&format!(
            "'api_endpoint' is missing a trailing '/', which dbt appends automatically. We suggest setting it to '{endpoint}/' instead."
        ));
        Ok(Cow::Owned(format!("{endpoint}/")))
    } else {
        Ok(Cow::Borrowed(endpoint))
    }
}

fn parse_auth<'a>(
    config: &'a AdapterConfig,
    _warning_printer: &dyn AuthWarningPrinter,
) -> Result<BigqueryAuthIR<'a>, AuthError> {
    let method = config
        .get_str("method")
        .ok_or_else(|| AuthError::config("Missing required 'method' field in BigQuery config"))?;

    match method {
        "oauth" => Ok(BigqueryAuthIR::Oauth),

View on GitHub (pinned to 0267ce9170)