{"record":{"id":"82d097a4f5db4dc0","repo":"dbt-labs/dbt-core","slug":"failed-to-create-x-vortex-client-platform-header-v","errorCode":null,"errorMessage":"Failed to create X-Vortex-Client-Platform header value","messagePattern":"Failed to create X-Vortex-Client-Platform header value","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/vortex-client/src/client.rs","lineNumber":448,"sourceCode":"            //     {service}/{version} {client}/{version} {proto_library}/{version}\n            //\n            // This helps identify the client platform and its components for monitoring and debugging.\n            let service_name = env.service_name();\n            let service_version = env.service_version();\n            // TODO: Change this to the actual version of the proto-rust library.\n            let proto_version = \"unknown\";\n            #[allow(clippy::uninlined_format_args)]\n            let header_value_string = format!(\n                \"{}/{} {}/{} {}/{}\",\n                service_name,\n                service_version,\n                \"vortex-client-rust\",\n                env!(\"CARGO_PKG_VERSION\"),\n                \"proto-rust\",\n                proto_version\n            );\n            HeaderValue::from_str(&header_value_string)\n                .expect(\"Failed to create X-Vortex-Client-Platform header value\")\n        };\n        let dev_mode_output_path = {\n            if env.dev_mode() {\n                Some(env.dev_mode_output_path())\n            } else {\n                None\n            }\n        };\n        let agent = BatchSenderAgentImpl::new(endpoint, vortex_client_platform, env);\n        let agent: Box<dyn SenderAgent> = Box::new(agent);\n        Self::new(agent, dev_mode_output_path)\n    }\n\n    fn new(agent: Box<dyn SenderAgent>, dev_mode_output_path: Option<PathBuf>) -> Self {\n        let dev_mode_output_writer = if let Some(path) = &dev_mode_output_path {\n            match fs::OpenOptions::new().create(true).append(true).open(path) {\n                Ok(file) => Mutex::new(Ok(file)),\n                Err(e) => Mutex::new(Err(e)),","sourceCodeStart":430,"sourceCodeEnd":466,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/vortex-client/src/client.rs#L430-L466","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nHeaderValue::from_str(&header_value_string)\n    .expect(\"Failed to create X-Vortex-Client-Platform header value\")\n// after\nHeaderValue::from_str(&header_value_string)\n    .unwrap_or(HeaderValue::from_static(\"vortex-client-rust\"))","handlingStrategy":"try-catch","validationCode":"let v = env!(\"CARGO_PKG_VERSION\");\nassert!(v.chars().all(|c| c.is_ascii_graphic() || c == ' '), \"invalid version chars\");","typeGuard":"fn is_valid_header_value(s: &str) -> bool {\n    s.bytes().all(|b| (0x21..=0x7E).contains(&b) || b == b' ' || b == b'\\t')\n}","tryCatchPattern":"let header = HeaderValue::from_str(&header_value_string)\n    .unwrap_or(HeaderValue::from_static(\"vortex-client-rust\"));","preventionTips":["Keep CARGO_PKG_VERSION plain semver ASCII","Do not patch the platform string constants with non-ASCII text","Pin to official crate releases"],"tags":["http","headers","panic","internal"],"backgroundTag":"internal-invariant-violation","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}