dbt-labs/dbt-core · error
Failed to parse Vortex endpoint URL
Error message
Failed to parse Vortex endpoint URL
What it means
Panic from `.expect()` in `VortexClient::from_env` when `format!("{base_url}{ingest_endpoint}")` fails to parse as an `http::Uri`. Environment-provided endpoint configuration is treated as mandatory-correct: a malformed URL aborts startup instead of returning a Result.
Source
Thrown at crates/vortex-client/src/client.rs:424
sender: mpsc::Sender<(Box<VortexMessage>, bool)>,
thread_handle: WorkerThread,
/// Path to the file where messages will be written in dev mode.
///
/// Only set in development mode. MUST be `None` in production.
dev_mode_output_path: Option<PathBuf>,
/// Dev-mode output writer, used to write messages to a file in development mode.
dev_mode_output_writer: Mutex<Result<fs::File, io::Error>>,
}
impl VortexProducerClient {
pub fn from_env(env: &dyn VortexEnv) -> Self {
let endpoint = {
let base_url = env.base_url();
let ingest_endpoint = env.ingest_endpoint();
let full_url = format!("{base_url}{ingest_endpoint}");
full_url
.parse::<http::Uri>()
.expect("Failed to parse Vortex endpoint URL")
};
let vortex_client_platform = {
// Construct the X-Vortex-Client-Platform header with service, client, and proto library
// information. Format:
//
// {service}/{version} {client}/{version} {proto_library}/{version}
//
// This helps identify the client platform and its components for monitoring and debugging.
let service_name = env.service_name();
let service_version = env.service_version();
// TODO: Change this to the actual version of the proto-rust library.
let proto_version = "unknown";
#[allow(clippy::uninlined_format_args)]
let header_value_string = format!(
"{}/{} {}/{} {}/{}",
service_name,
service_version,
"vortex-client-rust",View on GitHub (pinned to 0267ce9170)
Solutions
- Fix the endpoint environment variables so the full URL includes a valid scheme and host, e.g. `https://vortex.example.com/ingest`.
- Validate with a quick check before launching: `python3 -c "from urllib.parse import urlparse; urlparse('YOUR_URL')"` or paste into `http::Uri::try_from` mentally — scheme://host[/path].
- Trim whitespace and remove stray characters from the env values (quotes pasted from docs are a common culprit).
- Prefer changing the code path to propagate a config error via `Result` instead of `.expect` if you maintain a fork, so misconfiguration fails with a clear message.
Example fix
// before (env) VORTEX_BASE_URL=myhost.example.com/ingest // after (env) VORTEX_BASE_URL=https://myhost.example.com VORTEX_INGEST_ENDPOINT=/ingest
Defensive patterns
Strategy: validation
Validate before calling
// validate endpoint env values before starting the client
let base = std::env::var("VORTEX_BASE_URL")?;
assert!(base.starts_with("http://") || base.starts_with("https://"), "VORTEX_BASE_URL must include scheme");
assert!(!base.trim().is_empty() && base.trim() == base, "VORTEX_BASE_URL must not be empty or contain whitespace"); Type guard
fn is_valid_uri(s: &str) -> bool {
s.parse::<http::Uri>().is_ok()
&& matches!(s.parse::<http::Uri>().unwrap().scheme_str(), Some("http" | "https"))
} Try / catch
// in a fork, replace expect with Result so misconfig fails cleanly
let uri: http::Uri = full_url.parse().map_err(|e|
VortexError::Config(format!("invalid VORTEX endpoint URL '{full_url}': {e}")))?; Prevention
- Always include the scheme (`https://`) in base-url env values.
- Trim whitespace and avoid pasting surrounding quotes from documentation.
- Validate endpoint URLs in CI/config loading with the same `http::Uri` parser.
- Keep base_url and ingest_endpoint values consistent (no duplicated or missing slashes) and test the concatenation.
When it happens
Trigger: Setting the Vortex base-URL / ingest-endpoint environment variables to values that are not valid `http::Uri`s — e.g. missing scheme (`my.host.com/path` instead of `https://my.host.com/path`), spaces, invalid characters, a double slash producing `http://a//b`, or an empty base_url yielding an unparseable concatenation.
Common situations: Config from profiles/CI with a hostname but no scheme; trailing/leading whitespace in the env var; typos like `http:/host`; self-hosted endpoints with custom ports written incorrectly (`host:port` without scheme).
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.
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- `http_status_as_error` is not enabled.
- Failed to create X-Vortex-Client-Platform header value
- Schema not found for canonical FQN: {}
- `EnterGuard` values dropped out of order. Guards returned by
- {e} {:?}
AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07).
Data as JSON: /api/errors/512c9f9369de01af.
Report an issue: GitHub.