{"record":{"id":"1962ebacf73bb166","repo":"jdx/mise","slug":"pkgx-bottle-for-did-not-contain","errorCode":null,"errorMessage":"pkgx bottle for {} did not contain {}","messagePattern":"pkgx bottle for (.+?) did not contain (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/backend/pkgx.rs","lineNumber":620,"sourceCode":"        format,\n        &ExtractOptions {\n            strip_components: 0,\n            pr: Some(ctx.pr.as_ref()),\n            preserve_mtime: false,\n        },\n    )?;\n    if tmp\n        .path()\n        .join(&package.name)\n        .join(format!(\"v{}\", package.version))\n        .exists()\n    {\n        file::copy_dir_all(tmp.path(), pkgx_root)?;\n    } else {\n        file::rename(tmp.path(), &prefix)?;\n    }\n    if !prefix.exists() {\n        bail!(\n            \"pkgx bottle for {} did not contain {}\",\n            package.name,\n            prefix.display()\n        );\n    }\n    file::write(package_receipt_path(&prefix), package_receipt(bottle))?;\n    Ok(())\n}\n\nfn package_is_installed(prefix: &Path, bottle: &PkgxPackageInfo) -> Result<bool> {\n    if !prefix.exists() {\n        return Ok(false);\n    }\n    if fs::read_to_string(package_receipt_path(prefix)).ok() == Some(package_receipt(bottle)) {\n        return Ok(true);\n    }\n    file::remove_all(prefix)?;\n    Ok(false)","sourceCodeStart":602,"sourceCodeEnd":638,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/backend/pkgx.rs#L602-L638","documentation":"Thrown by `install_package` in the pkgx backend: after downloading and extracting a pkgx bottle into a temp dir and copying/renaming it to the expected install prefix, mise verifies the prefix directory exists. If the extracted bottle didn't contain the expected prefix path, the install is aborted because the layout doesn't match what pkgx bottles are supposed to contain.","triggerScenarios":"Installing a pkgx package (`install_version_` / `install_from_locked` -> `install_package`) where the downloaded bottle's extracted contents lack the expected prefix directory (e.g. `prefix.display()` path not present after extraction) — a truncated download, an unexpected bottle layout, or an empty archive.","commonSituations":"Network interruption produced a partial bottle cached on disk; upstream pkgx changed the bottle directory layout for the package/version; a proxy or mirror served an HTML error page saved as the bottle; platform-specific bottle missing for the current OS/arch.","solutions":["Clear the pkgx/bottle cache and reinstall (`mise cache clear`, then `mise install pkgx:<name>@<version>`) to force a fresh, complete download.","Try a different version of the package, which may have a correctly-built bottle for your platform.","Check network path (corporate proxy/mirror) for content rewriting, and retry on a direct connection.","If the bottle is consistently broken, report the malformed bottle to the pkgx package maintainers or fall back to another backend for this tool."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"# clear caches and retry on truncated downloads\nmise cache clear && mise install pkgx:mytool@1.2.3","typeGuard":null,"tryCatchPattern":"try { await $`mise install` } catch (e) { if (String(e).includes('did not contain')) { await $`mise cache clear`; await $`mise install`; } else throw e; }","preventionTips":["Avoid unreliable proxies/mirrors for bottle downloads","Retry installs once after network interruptions","Switch versions or backends when a bottle is consistently malformed"],"tags":["pkgx","install","bottle","archive","rust"],"backgroundTag":"empty-api-response","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}