{"record":{"id":"5e453edb482822f3","repo":"NousResearch/hermes-agent","slug":"could-not-find-binary-name-inside-downloaded-arc-5e453e","errorCode":null,"errorMessage":"Could not find {binary_name} inside downloaded archive (members: {zf.namelist()[:5]}...)","messagePattern":"Could not find (.+?) inside downloaded archive \\(members: (.+?)\\.\\.\\.\\)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"agent/secret_sources/bitwarden.py","lineNumber":322,"sourceCode":"\n\ndef _sha256_file(path: Path) -> str:\n    h = hashlib.sha256()\n    with open(path, \"rb\") as f:\n        for chunk in iter(lambda: f.read(65536), b\"\"):\n            h.update(chunk)\n    return h.hexdigest()\n\n\ndef _pick_zip_member(zf: zipfile.ZipFile, binary_name: str) -> str:\n    \"\"\"Find the binary inside the upstream zip.\n\n    Historically the archive has been flat (``bws`` at the root) but we\n    tolerate a top-level directory just in case upstream changes.\n    \"\"\"\n    candidates = [n for n in zf.namelist() if n.split(\"/\")[-1] == binary_name]\n    if not candidates:\n        raise RuntimeError(\n            f\"Could not find {binary_name} inside downloaded archive \"\n            f\"(members: {zf.namelist()[:5]}...)\"\n        )\n    # Prefer the shortest path (i.e. root over nested) for determinism.\n    candidates.sort(key=len)\n    return candidates[0]\n\n\ndef _safe_extract_member(\n    zf: zipfile.ZipFile, member: str, dest_dir: Path\n) -> Path:\n    \"\"\"Extract a single archive member, refusing path traversal.\n\n    ``ZipFile.extract`` will happily honour member names containing\n    ``../`` or absolute paths, letting a malicious archive write outside\n    ``dest_dir`` (a \"zip-slip\").  We resolve the would-be target and\n    confirm it stays within ``dest_dir`` before extracting.\n    \"\"\"","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/agent/secret_sources/bitwarden.py#L304-L340","documentation":"Error \"Could not find {binary_name} inside downloaded archive (members: {zf.namelist()[:5]}...)\" thrown in NousResearch/hermes-agent.","triggerScenarios":"Thrown at agent/secret_sources/bitwarden.py:322 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-download the archive; the expected binary is missing inside it.","Verify the asset for your platform actually ships the bws binary."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}