{"record":{"id":"66e2354d8d573089","repo":"tinyhumansai/openhuman","slug":"expected-one-top-level-folder-under-found-none-66e235","errorCode":null,"errorMessage":"expected one top-level folder under {}, found none","messagePattern":"expected one top-level folder under (.+?), found none","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/runtime/python/extractor.rs","lineNumber":51,"sourceCode":"    .context(\"spawn_blocking join failure during extraction\")?\n}\n\nfn find_single_top_level(extract_root: &Path) -> Result<PathBuf> {\n    let mut entries = fs::read_dir(extract_root)\n        .with_context(|| format!(\"listing {}\", extract_root.display()))?\n        .collect::<Result<Vec<_>, _>>()\n        .with_context(|| format!(\"reading entries of {}\", extract_root.display()))?;\n    entries.sort_by_key(|e| e.file_name());\n\n    let mut dirs = entries\n        .into_iter()\n        .filter(|e| e.file_type().map(|t| t.is_dir()).unwrap_or(false))\n        .map(|e| e.path())\n        .collect::<Vec<_>>();\n\n    match dirs.len() {\n        1 => Ok(dirs.pop().expect(\"single dir\")),\n        0 => Err(anyhow!(\n            \"expected one top-level folder under {}, found none\",\n            extract_root.display()\n        )),\n        n => Err(anyhow!(\n            \"expected one top-level folder under {}, found {n}\",\n            extract_root.display()\n        )),\n    }\n}\n\npub async fn atomic_install(staged: &Path, final_dest: &Path) -> Result<PathBuf> {\n    let staged = staged.to_path_buf();\n    let final_dest = final_dest.to_path_buf();\n\n    tokio::task::spawn_blocking(move || -> Result<PathBuf> {\n        if let Some(parent) = final_dest.parent() {\n            fs::create_dir_all(parent)\n                .with_context(|| format!(\"creating parent {}\", parent.display()))?;","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/runtime/python/extractor.rs#L33-L69","documentation":"Thrown by find_single_top_level() after extracting a python-build-standalone tarball: the extract root contains zero top-level directories. The extractor's contract is that the archive unpacks to exactly one folder (e.g. cpython-3.x.y+.../) which is then renamed into place. Zero directories means the archive was empty, the download was corrupt/truncated, or the wrong artifact was extracted — a generic integrity guard where the faulty input is the extracted directory contents.","triggerScenarios":"Thrown at src/openhuman/runtime/python/extractor.rs:51 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Delete the extract root and re-download the distribution, verifying the sha256 against expected_sha256 before extracting.","Verify the artifact name/URL corresponds to an install_only tarball, not a source or docs archive.","Check available disk space — an extraction that silently failed can leave an empty directory."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}