dbt-labs/dbt-core · error
Failed to create X-Vortex-Client-Platform header value
Error message
Failed to create X-Vortex-Client-Platform header value
What it means
This panic occurs when the X-Vortex-Client-Platform header value, assembled from the crate name, crate version, proto identifier, and proto_version, cannot be parsed into a valid HTTP HeaderValue. HeaderValue::from_str only accepts visible ASCII characters (0x21-0x7E plus space/tab), so any non-ASCII or control character in the interpolated version strings causes the .expect() to panic. It is an internal invariant: the static parts of the string are always safe, so only a corrupt CARGO_PKG_VERSION or proto_version could trigger it.
Source
Thrown at crates/vortex-client/src/client.rs:448
// {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",
env!("CARGO_PKG_VERSION"),
"proto-rust",
proto_version
);
HeaderValue::from_str(&header_value_string)
.expect("Failed to create X-Vortex-Client-Platform header value")
};
let dev_mode_output_path = {
if env.dev_mode() {
Some(env.dev_mode_output_path())
} else {
None
}
};
let agent = BatchSenderAgentImpl::new(endpoint, vortex_client_platform, env);
let agent: Box<dyn SenderAgent> = Box::new(agent);
Self::new(agent, dev_mode_output_path)
}
fn new(agent: Box<dyn SenderAgent>, dev_mode_output_path: Option<PathBuf>) -> Self {
let dev_mode_output_writer = if let Some(path) = &dev_mode_output_path {
match fs::OpenOptions::new().create(true).append(true).open(path) {
Ok(file) => Mutex::new(Ok(file)),
Err(e) => Mutex::new(Err(e)),View on GitHub (pinned to 0267ce9170)
Solutions
- Check the crate's CARGO_PKG_VERSION in Cargo.toml and any patched version metadata for invalid characters
- Verify the proto_version constant used in client.rs is plain visible ASCII
- Upgrade the vortex-client-rust crate; in a healthy release build this panic is unreachable
- If you control the source, replace .expect() with a fallback to a fixed header value
Example fix
// before
HeaderValue::from_str(&header_value_string)
.expect("Failed to create X-Vortex-Client-Platform header value")
// after
HeaderValue::from_str(&header_value_string)
.unwrap_or(HeaderValue::from_static("vortex-client-rust")) Defensive patterns
Strategy: try-catch
Validate before calling
let v = env!("CARGO_PKG_VERSION");
assert!(v.chars().all(|c| c.is_ascii_graphic() || c == ' '), "invalid version chars"); Type guard
fn is_valid_header_value(s: &str) -> bool {
s.bytes().all(|b| (0x21..=0x7E).contains(&b) || b == b' ' || b == b'\t')
} Try / catch
let header = HeaderValue::from_str(&header_value_string)
.unwrap_or(HeaderValue::from_static("vortex-client-rust")); Prevention
- Keep CARGO_PKG_VERSION plain semver ASCII
- Do not patch the platform string constants with non-ASCII text
- Pin to official crate releases
When it happens
Trigger: Calling VortexClient::from_env when env!("CARGO_PKG_VERSION") or the embedded proto_version contains characters outside visible ASCII — practically only when the crate was built with a non-standard patched version string containing spaces after the comma, control characters, or UTF-8 characters.
Common situations: Building the crate with a customized Cargo version containing unusual characters; a build script injecting a malformed version; a fork that changed the platform string constants to include non-ASCII values.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- Schema not found for canonical FQN: {}
- Parent span must have a SpanStartInfo record in its extensio
- `http_status_as_error` is not enabled.
- Failed to parse Vortex endpoint URL
- `EnterGuard` values dropped out of order. Guards returned by
AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07).
Data as JSON: /api/errors/82d097a4f5db4dc0.
Report an issue: GitHub.