{"record":{"id":"7f4a6e28300f52bb","repo":"denoland/deno","slug":"downloaded-artifact-does-not-contain-content","errorCode":null,"errorMessage":"Downloaded artifact does not contain '{}'. Contents: {:?}","messagePattern":"Downloaded artifact does not contain '(.+?)'\\. Contents: (.+?)","errorType":"exception","errorClass":"AnyError","httpStatus":null,"severity":"error","filePath":"cli/tools/upgrade.rs","lineNumber":773,"sourceCode":"      break;\n    }\n  }\n\n  if !downloaded {\n    bail!(\n      \"Could not find a \\\"{}\\\" artifact for PR #{pr_number}.\\n\\\n       Available artifacts may have expired or CI may not have completed.\\n\\\n       Only release builds on linux-x86_64 and debug builds are typically available for PRs.\",\n      artifact_name\n    );\n  }\n\n  // Find the downloaded binary\n  let exe_name = if cfg!(windows) { \"deno.exe\" } else { \"deno\" };\n  let new_exe_path = download_dir.join(exe_name);\n\n  if !new_exe_path.exists() {\n    bail!(\n      \"Downloaded artifact does not contain '{}'. Contents: {:?}\",\n      exe_name,\n      fs::read_dir(download_dir)?\n        .filter_map(|e| e.ok())\n        .map(|e| e.file_name().to_string_lossy().to_string())\n        .collect::<Vec<_>>()\n    );\n  }\n\n  // Set executable permissions\n  #[cfg(unix)]\n  {\n    use std::os::unix::fs::PermissionsExt;\n    fs::set_permissions(&new_exe_path, std::fs::Permissions::from_mode(0o755))?;\n  }\n\n  // Verify the binary works\n  check_exe(&new_exe_path)?;","sourceCodeStart":755,"sourceCodeEnd":791,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/tools/upgrade.rs#L755-L791","documentation":"A PR artifact was downloaded and unpacked into a temp dir, but the expected `deno` (or `deno.exe` on Windows) executable is not among the extracted files; Deno lists the actual directory contents to help diagnose. This means the artifact zip has an unexpected layout — the binary is missing, nested under a subdirectory, or the artifact is not the build you assumed.","triggerScenarios":"CI artifact packaging changes (binary moved into a subfolder or renamed); downloading an artifact type (e.g. libs/tests) that contains no binary; partial/corrupted download that unpacked only metadata; the code at cli/tools/upgrade.rs:773 finding `download_dir.join(exe_name)` missing.","commonSituations":"Upgrading Deno from a PR right after the CI packaging workflow was refactored; disk-full temp dirs producing incomplete extraction; mixed-release/debug artifact layouts.","solutions":["Read the 'Contents:' list in the error — if the binary sits in a subfolder or has a different name, that is a packaging change; report it against the PR/Deno.","Retry the download in case of a truncated transfer (the temp dir is recreated each run).","Check the PR's CI workflow for how artifacts are packaged and pick the correct artifact.","Fall back to building the PR branch locally (`cargo build --bin deno`) until packaging is fixed."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"# pre-inspect the artifact layout before letting deno download it\ntmp=$(mktemp -d)\ngh run download <run-id> -n release-linux-x86_64-deno --repo denoland/deno -D \"$tmp\"\ntest -x \"$tmp/deno\" || echo \"layout changed — binary not at archive root\"","typeGuard":null,"tryCatchPattern":"deno upgrade --pr 12345 2>err.log || { grep -q 'does not contain' err.log && gh run download <run-id> -D manual && ./manual/deno -V; }","preventionTips":["Report packaging changes on the PR when the binary is not at the archive root.","Keep temp-dir disk space available so extraction is not partial.","Fall back to `cargo build --bin deno` when artifacts are malformed."],"tags":["upgrade","pr-build","ci-artifacts","download","packaging"],"backgroundTag":"ci-artifact-invalid","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}