{"record":{"id":"507dbdb5e1d3b268","repo":"dbt-labs/dbt-core","slug":"non-utf8-distribution-filename","errorCode":null,"errorMessage":"non-UTF8 distribution filename: {}","messagePattern":"non-UTF8 distribution filename: (.+?)","errorType":"validation","errorClass":"anyhow","httpStatus":null,"severity":"error","filePath":"crates/dbt-ci/src/publish.rs","lineNumber":349,"sourceCode":"        .user_agent(concat!(\"dbt-ci/\", env!(\"CARGO_PKG_VERSION\")))\n        .build()\n        .context(\"build http client\")\n}\n\n/// Mirrors twine's upload payload, reading metadata from the artifact's\n/// METADATA/PKG-INFO. Handles both wheels and sdists.\nasync fn upload_dist(\n    http: &reqwest::Client,\n    url: &str,\n    user: &str,\n    password: &str,\n    dist: &Path,\n    kind: DistKind,\n) -> Result<()> {\n    let filename = dist\n        .file_name()\n        .and_then(|s| s.to_str())\n        .ok_or_else(|| anyhow!(\"non-UTF8 distribution filename: {}\", dist.display()))?\n        .to_string();\n\n    let metadata = Distribution::new(dist)\n        .with_context(|| format!(\"read metadata from {}\", dist.display()))?\n        .metadata()\n        .clone();\n\n    // Wheels carry name/version/pyversion in the filename; the sdist's from PKG-INFO.\n    let (parsed, filetype) = match kind {\n        DistKind::Wheel => {\n            let parsed = parse_wheel_filename(&filename)\n                .ok_or_else(|| anyhow!(\"wheel filename not in PEP 491 form: {filename}\"))?;\n            (parsed, \"bdist_wheel\")\n        }\n        DistKind::Sdist => (\n            ParsedWheel {\n                name: metadata.name.clone(),\n                version: metadata.version.clone(),","sourceCodeStart":331,"sourceCodeEnd":367,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-ci/src/publish.rs#L331-L367","documentation":"upload_dist rejects a distribution artifact whose file name is not valid UTF-8: it cannot be placed into the multipart filename field nor parsed for name/version tags, so the upload is refused before any metadata is read.","triggerScenarios":"Thrown at crates/dbt-ci/src/publish.rs:349 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the artifact to a clean ASCII/UTF-8 filename before uploading","Rebuild the wheel/sdist so tooling produces a well-formed name","Reject the file with this error rather than lossily converting bytes"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}