{"record":{"id":"12be166c33c5676d","repo":"pkgxdev/pkgx","slug":"no-inventory-for","errorCode":null,"errorMessage":"No inventory for {}","messagePattern":"No inventory for (.+?)","errorType":"error_code","errorClass":"io::Error (NotFound)","httpStatus":null,"severity":"error","filePath":"crates/lib/src/inventory.rs","lineNumber":43,"sourceCode":"        \"{}/{}/{}/{}/versions.txt\",\n        base_url, project, platform, arch\n    ))?;\n\n    let rsp = build_client()?\n        .get(url.clone())\n        .send()\n        .await?\n        .error_for_status()?;\n\n    let releases = rsp.text().await?;\n    let mut versions: Vec<Version> = releases\n        .lines()\n        .map(Version::parse)\n        .filter_map(Result::ok)\n        .collect();\n\n    if versions.is_empty() {\n        return Err(Box::new(std::io::Error::new(\n            std::io::ErrorKind::NotFound,\n            format!(\"No inventory for {}\", project),\n        )));\n    }\n\n    if project == \"openssl.org\" {\n        // Workaround: Remove specific version\n        let excluded_version = Version::parse(\"1.1.118\")?;\n        versions.retain(|x| x != &excluded_version);\n    }\n\n    Ok(versions)\n}\n\n//TODO xz bottles are preferred\npub fn get_url(pkg: &Package, config: &Config) -> String {\n    let (platform, arch) = host();\n    format!(","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/pkgxdev/pkgx/blob/6de1d7e953b98061f69db95d4bd45a2a6ee5d7da/crates/lib/src/inventory.rs#L25-L61","documentation":"`inventory::ls` fetches a package's available versions from the upstream inventory (dist server), parses each line into a Version, and requires at least one valid entry. If the response is empty or yields no parseable versions, it raises `No inventory for {project}`. This is `select`'s dependency: without an inventory the library cannot resolve any version requirement for that project.","triggerScenarios":"Calling `select()` (or anything that resolves a version, e.g. `ls` for a package) where the inventory HTTP response is empty, all lines fail `Version::parse`, or the project has no entry on the dist server.","commonSituations":"Requesting a nonexistent or misspelled project name, an offline/behind-a-mirror dist endpoint (PKGX_DIST_URL pointing somewhere without that project's inventory), a brand-new package not yet published to the pantry dist, or a server returning an error page/empty body instead of version lines.","solutions":["Verify the project name is correct and exists in the pantry (check spelling/fully-qualified name like `openssl.org`, not `openssl`)","Check network access and the PKGX_DIST_URL value — hit the same URL manually to confirm an inventory is served","Update pkgx/pantry data so the project's inventory is known, or pick a project version that is published","If you run a mirror, ensure it proxies the inventory route for the requested project"],"exampleFix":"// before\npkgx ls openssl  // No inventory for openssl\n// after\npkgx ls openssl.org","handlingStrategy":"try-catch","validationCode":"async fn inventory_exists(project: &str, dist_url: &str) -> bool {\n    // cheap pre-check: ask the inventory endpoint directly\n    let url = format!(\"{}/{}.txt\", dist_url.trim_end_matches('/'), project);\n    reqwest::get(&url).await\n        .map(|r| r.status().is_success() && !r.text().await.unwrap_or_default().trim().is_empty())\n        .unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":"match select(&project, &constraint, &config).await {\n    Err(e) if e.to_string().starts_with(\"No inventory for\") => {\n        eprintln!(\"{} has no published inventory; check name (e.g. openssl.org) or dist URL\", project);\n    }\n    Err(e) => return Err(e),\n    Ok(v) => Ok(v),\n}","preventionTips":["Use fully-qualified pantry project names (domain-style: openssl.org, deno.land)","Verify PKGX_DIST_URL reachability before batch installs","Keep pantry data updated so newly published packages resolve","When mirroring, ensure inventory routes are proxied, not just bottles"],"tags":["inventory","network","versioning","package-resolution"],"backgroundTag":"empty-response-body","analyzedSha":"6de1d7e953b98061f69db95d4bd45a2a6ee5d7da","analyzedAt":"2026-09-10T09:59:03.886Z","contentChangedAt":"2026-09-10T09:59:03.886Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}